Commit 8b00112d5a7142bb33b982baade2831647f8e16f
1 parent
853bde92
fix: direct import for antdv subcomponents supported
修复直接import部分antdv子组件时会在build过程中报错的问题
Showing
2 changed files
with
47 additions
and
1 deletions
CHANGELOG.zh_CN.md
build/vite/plugin/styleImport.ts
... | ... | @@ -14,7 +14,52 @@ export function configStyleImportPlugin(isBuild: boolean) { |
14 | 14 | libraryName: 'ant-design-vue', |
15 | 15 | esModule: true, |
16 | 16 | resolveStyle: (name) => { |
17 | - return `ant-design-vue/es/${name}/style/index`; | |
17 | + // 这里是“子组件”列表,无需额外引入样式文件 | |
18 | + const ignoreList = [ | |
19 | + 'typography-text', | |
20 | + 'typography-title', | |
21 | + 'typography-paragraph', | |
22 | + 'typography-link', | |
23 | + 'anchor-link', | |
24 | + 'sub-menu', | |
25 | + 'menu-item', | |
26 | + 'menu-item-group', | |
27 | + 'dropdown-button', | |
28 | + 'breadcrumb-item', | |
29 | + 'breadcrumb-separator', | |
30 | + 'input-password', | |
31 | + 'input-search', | |
32 | + 'input-group', | |
33 | + 'form-item', | |
34 | + 'radio-group', | |
35 | + 'checkbox-group', | |
36 | + 'layout-sider', | |
37 | + 'layout-content', | |
38 | + 'layout-footer', | |
39 | + 'layout-header', | |
40 | + 'step', | |
41 | + 'select-option', | |
42 | + 'select-opt-group', | |
43 | + 'card-grid', | |
44 | + 'card-meta', | |
45 | + 'collapse-panel', | |
46 | + 'descriptions-item', | |
47 | + 'list-item', | |
48 | + 'list-item-meta', | |
49 | + 'table-column', | |
50 | + 'table-column-group', | |
51 | + 'tab-pane', | |
52 | + 'tab-content', | |
53 | + 'timeline-item', | |
54 | + 'tree-node', | |
55 | + 'skeleton-input', | |
56 | + 'skeleton-avatar', | |
57 | + 'skeleton-title', | |
58 | + 'skeleton-paragraph', | |
59 | + 'skeleton-image', | |
60 | + 'skeleton-button', | |
61 | + ]; | |
62 | + return ignoreList.includes(name) ? '' : `ant-design-vue/es/${name}/style/index`; | |
18 | 63 | }, |
19 | 64 | }, |
20 | 65 | ], | ... | ... |