mirror of
https://github.com/vbenjs/vben-admin-thin-next.git
synced 2025-01-23 09:40:22 +08:00
* fix: direct import for antdv subcomponents supported 修复commit<8b00112>使用直接过滤部分antdv子组件的方式,导致build后刷新页面子组件样式会丢失的问题。 * Update styleImport.ts * Update styleImport.ts
This commit is contained in:
parent
97fe8e2058
commit
d6cdff97b6
@ -14,29 +14,15 @@ export function configStyleImportPlugin(isBuild: boolean) {
|
|||||||
libraryName: 'ant-design-vue',
|
libraryName: 'ant-design-vue',
|
||||||
esModule: true,
|
esModule: true,
|
||||||
resolveStyle: (name) => {
|
resolveStyle: (name) => {
|
||||||
// 这里是“子组件”列表,无需额外引入样式文件
|
// 这里是无需额外引入样式文件的“子组件”列表
|
||||||
const ignoreList = [
|
const ignoreList = [
|
||||||
'typography-text',
|
|
||||||
'typography-title',
|
|
||||||
'typography-paragraph',
|
|
||||||
'typography-link',
|
|
||||||
'anchor-link',
|
'anchor-link',
|
||||||
'sub-menu',
|
'sub-menu',
|
||||||
'menu-item',
|
'menu-item',
|
||||||
'menu-item-group',
|
'menu-item-group',
|
||||||
'dropdown-button',
|
|
||||||
'breadcrumb-item',
|
'breadcrumb-item',
|
||||||
'breadcrumb-separator',
|
'breadcrumb-separator',
|
||||||
'input-password',
|
|
||||||
'input-search',
|
|
||||||
'input-group',
|
|
||||||
'form-item',
|
'form-item',
|
||||||
'radio-group',
|
|
||||||
'checkbox-group',
|
|
||||||
'layout-sider',
|
|
||||||
'layout-content',
|
|
||||||
'layout-footer',
|
|
||||||
'layout-header',
|
|
||||||
'step',
|
'step',
|
||||||
'select-option',
|
'select-option',
|
||||||
'select-opt-group',
|
'select-opt-group',
|
||||||
@ -59,7 +45,31 @@ export function configStyleImportPlugin(isBuild: boolean) {
|
|||||||
'skeleton-image',
|
'skeleton-image',
|
||||||
'skeleton-button',
|
'skeleton-button',
|
||||||
];
|
];
|
||||||
return ignoreList.includes(name) ? '' : `ant-design-vue/es/${name}/style/index`;
|
// 这里是需要额外引入样式的子组件列表
|
||||||
|
// 单独引入子组件时需引入组件样式,否则会在打包后导致子组件样式丢失
|
||||||
|
const replaceList = {
|
||||||
|
'typography-text': 'typography',
|
||||||
|
'typography-title': 'typography',
|
||||||
|
'typography-paragraph': 'typography',
|
||||||
|
'typography-link': 'typography',
|
||||||
|
'dropdown-button': 'dropdown',
|
||||||
|
'input-password': 'input',
|
||||||
|
'input-search': 'input',
|
||||||
|
'input-group': 'input',
|
||||||
|
'radio-group': 'radio',
|
||||||
|
'checkbox-group': 'checkbox',
|
||||||
|
'layout-sider': 'layout',
|
||||||
|
'layout-content': 'layout',
|
||||||
|
'layout-footer': 'layout',
|
||||||
|
'layout-header': 'layout',
|
||||||
|
'month-picker': 'date-picker',
|
||||||
|
};
|
||||||
|
|
||||||
|
return ignoreList.includes(name)
|
||||||
|
? ''
|
||||||
|
: replaceList.hasOwnProperty(name)
|
||||||
|
? `ant-design-vue/es/${replaceList[name]}/style/index`
|
||||||
|
: `ant-design-vue/es/${name}/style/index`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user