Commit feadf64ee365e9bce77c1bac478f60c66b5d16fe
1 parent
553ee9c7
fix: Icon加载问题
Showing
26 changed files
with
35 additions
and
32 deletions
internal/vite-config/src/config/application.ts
@@ -31,13 +31,6 @@ function defineApplicationConfig(defineOptions: DefineOptions = {}) { | @@ -31,13 +31,6 @@ function defineApplicationConfig(defineOptions: DefineOptions = {}) { | ||
31 | const pathResolve = (pathname: string) => resolve(root, '.', pathname); | 31 | const pathResolve = (pathname: string) => resolve(root, '.', pathname); |
32 | 32 | ||
33 | const applicationConfig: UserConfig = { | 33 | const applicationConfig: UserConfig = { |
34 | - optimizeDeps: { | ||
35 | - include: [ | ||
36 | - '@iconify/iconify', | ||
37 | - 'ant-design-vue/es/locale/zh_CN', | ||
38 | - 'ant-design-vue/es/locale/en_US', | ||
39 | - ], | ||
40 | - }, | ||
41 | resolve: { | 34 | resolve: { |
42 | alias: [ | 35 | alias: [ |
43 | { | 36 | { |
src/components/Application/src/search/AppSearchModal.vue
@@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
61 | import { computed, unref, ref, watch, nextTick } from 'vue'; | 61 | import { computed, unref, ref, watch, nextTick } from 'vue'; |
62 | import { SearchOutlined } from '@ant-design/icons-vue'; | 62 | import { SearchOutlined } from '@ant-design/icons-vue'; |
63 | import AppSearchFooter from './AppSearchFooter.vue'; | 63 | import AppSearchFooter from './AppSearchFooter.vue'; |
64 | - import Icon from '/@/components/Icon'; | 64 | + import { Icon } from '/@/components/Icon'; |
65 | // @ts-ignore | 65 | // @ts-ignore |
66 | import vClickOutside from '/@/directives/clickOutside'; | 66 | import vClickOutside from '/@/directives/clickOutside'; |
67 | import { useDesign } from '/@/hooks/web/useDesign'; | 67 | import { useDesign } from '/@/hooks/web/useDesign'; |
src/components/ContextMenu/src/ContextMenu.vue
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | import type { ContextMenuItem, ItemContentProps, Axis } from './typing'; | 2 | import type { ContextMenuItem, ItemContentProps, Axis } from './typing'; |
3 | import type { FunctionalComponent, CSSProperties, PropType } from 'vue'; | 3 | import type { FunctionalComponent, CSSProperties, PropType } from 'vue'; |
4 | import { defineComponent, nextTick, onMounted, computed, ref, unref, onUnmounted } from 'vue'; | 4 | import { defineComponent, nextTick, onMounted, computed, ref, unref, onUnmounted } from 'vue'; |
5 | - import Icon from '/@/components/Icon'; | 5 | + import { Icon } from '/@/components/Icon'; |
6 | import { Menu, Divider } from 'ant-design-vue'; | 6 | import { Menu, Divider } from 'ant-design-vue'; |
7 | 7 | ||
8 | const prefixCls = 'context-menu'; | 8 | const prefixCls = 'context-menu'; |
src/components/Cropper/src/CropperAvatar.vue
@@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
45 | import { useMessage } from '/@/hooks/web/useMessage'; | 45 | import { useMessage } from '/@/hooks/web/useMessage'; |
46 | import { useI18n } from '/@/hooks/web/useI18n'; | 46 | import { useI18n } from '/@/hooks/web/useI18n'; |
47 | import type { ButtonProps } from '/@/components/Button'; | 47 | import type { ButtonProps } from '/@/components/Button'; |
48 | - import Icon from '/@/components/Icon'; | 48 | + import { Icon } from '/@/components/Icon'; |
49 | 49 | ||
50 | const props = { | 50 | const props = { |
51 | width: { type: [String, Number], default: '200px' }, | 51 | width: { type: [String, Number], default: '200px' }, |
src/components/Icon/index.ts
@@ -3,5 +3,3 @@ import SvgIcon from './src/SvgIcon.vue'; | @@ -3,5 +3,3 @@ import SvgIcon from './src/SvgIcon.vue'; | ||
3 | import IconPicker from './src/IconPicker.vue'; | 3 | import IconPicker from './src/IconPicker.vue'; |
4 | 4 | ||
5 | export { Icon, IconPicker, SvgIcon }; | 5 | export { Icon, IconPicker, SvgIcon }; |
6 | - | ||
7 | -export default Icon; |
src/components/Menu/src/components/MenuItemContent.vue
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | <script lang="ts"> | 7 | <script lang="ts"> |
8 | import { computed, defineComponent } from 'vue'; | 8 | import { computed, defineComponent } from 'vue'; |
9 | 9 | ||
10 | - import Icon from '/@/components/Icon/index'; | 10 | + import { Icon } from '/@/components/Icon/index'; |
11 | import { useI18n } from '/@/hooks/web/useI18n'; | 11 | import { useI18n } from '/@/hooks/web/useI18n'; |
12 | import { useDesign } from '/@/hooks/web/useDesign'; | 12 | import { useDesign } from '/@/hooks/web/useDesign'; |
13 | import { contentProps } from '../props'; | 13 | import { contentProps } from '../props'; |
src/components/SimpleMenu/src/SimpleSubMenu.vue
@@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
48 | 48 | ||
49 | import { defineComponent, computed } from 'vue'; | 49 | import { defineComponent, computed } from 'vue'; |
50 | import { useDesign } from '/@/hooks/web/useDesign'; | 50 | import { useDesign } from '/@/hooks/web/useDesign'; |
51 | - import Icon from '/@/components/Icon/index'; | 51 | + import { Icon } from '/@/components/Icon/index'; |
52 | 52 | ||
53 | import MenuItem from './components/MenuItem.vue'; | 53 | import MenuItem from './components/MenuItem.vue'; |
54 | import SubMenu from './components/SubMenuItem.vue'; | 54 | import SubMenu from './components/SubMenuItem.vue'; |
src/components/SimpleMenu/src/components/SubMenuItem.vue
@@ -75,7 +75,7 @@ | @@ -75,7 +75,7 @@ | ||
75 | import { useMenuItem } from './useMenu'; | 75 | import { useMenuItem } from './useMenu'; |
76 | import { useSimpleRootMenuContext } from './useSimpleMenuContext'; | 76 | import { useSimpleRootMenuContext } from './useSimpleMenuContext'; |
77 | import { CollapseTransition } from '/@/components/Transition'; | 77 | import { CollapseTransition } from '/@/components/Transition'; |
78 | - import Icon from '/@/components/Icon'; | 78 | + import { Icon } from '/@/components/Icon'; |
79 | import { Popover } from 'ant-design-vue'; | 79 | import { Popover } from 'ant-design-vue'; |
80 | import { isBoolean, isObject } from '/@/utils/is'; | 80 | import { isBoolean, isObject } from '/@/utils/is'; |
81 | import { mitt } from '/@/utils/mitt'; | 81 | import { mitt } from '/@/utils/mitt'; |
src/components/Table/src/components/TableAction.vue
@@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
34 | import { defineComponent, PropType, computed, toRaw, unref } from 'vue'; | 34 | import { defineComponent, PropType, computed, toRaw, unref } from 'vue'; |
35 | import { MoreOutlined } from '@ant-design/icons-vue'; | 35 | import { MoreOutlined } from '@ant-design/icons-vue'; |
36 | import { Divider, Tooltip, TooltipProps } from 'ant-design-vue'; | 36 | import { Divider, Tooltip, TooltipProps } from 'ant-design-vue'; |
37 | - import Icon from '/@/components/Icon/index'; | 37 | + import { Icon } from '/@/components/Icon/index'; |
38 | import { ActionItem, TableActionType } from '/@/components/Table'; | 38 | import { ActionItem, TableActionType } from '/@/components/Table'; |
39 | import { PopConfirmButton } from '/@/components/Button'; | 39 | import { PopConfirmButton } from '/@/components/Button'; |
40 | import { Dropdown } from '/@/components/Dropdown'; | 40 | import { Dropdown } from '/@/components/Dropdown'; |
src/layouts/default/header/components/Breadcrumb.vue
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | import { defineComponent, ref, watchEffect } from 'vue'; | 21 | import { defineComponent, ref, watchEffect } from 'vue'; |
22 | 22 | ||
23 | import { Breadcrumb } from 'ant-design-vue'; | 23 | import { Breadcrumb } from 'ant-design-vue'; |
24 | - import Icon from '/@/components/Icon'; | 24 | + import { Icon } from '/@/components/Icon'; |
25 | 25 | ||
26 | import { useDesign } from '/@/hooks/web/useDesign'; | 26 | import { useDesign } from '/@/hooks/web/useDesign'; |
27 | import { useRootSetting } from '/@/hooks/setting/useRootSetting'; | 27 | import { useRootSetting } from '/@/hooks/setting/useRootSetting'; |
src/layouts/default/header/components/ErrorAction.vue
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | <script lang="ts"> | 13 | <script lang="ts"> |
14 | import { defineComponent, computed } from 'vue'; | 14 | import { defineComponent, computed } from 'vue'; |
15 | import { Tooltip, Badge } from 'ant-design-vue'; | 15 | import { Tooltip, Badge } from 'ant-design-vue'; |
16 | - import Icon from '/@/components/Icon'; | 16 | + import { Icon } from '/@/components/Icon'; |
17 | 17 | ||
18 | import { useI18n } from '/@/hooks/web/useI18n'; | 18 | import { useI18n } from '/@/hooks/web/useI18n'; |
19 | import { useErrorLogStore } from '/@/store/modules/errorLog'; | 19 | import { useErrorLogStore } from '/@/store/modules/errorLog'; |
src/layouts/default/header/components/user-dropdown/DropMenuItem.vue
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | 11 | ||
12 | import { computed, defineComponent, getCurrentInstance } from 'vue'; | 12 | import { computed, defineComponent, getCurrentInstance } from 'vue'; |
13 | 13 | ||
14 | - import Icon from '/@/components/Icon/index'; | 14 | + import { Icon } from '/@/components/Icon/index'; |
15 | import { propTypes } from '/@/utils/propTypes'; | 15 | import { propTypes } from '/@/utils/propTypes'; |
16 | 16 | ||
17 | export default defineComponent({ | 17 | export default defineComponent({ |
src/layouts/default/setting/index.vue
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | <script lang="ts"> | 7 | <script lang="ts"> |
8 | import { defineComponent } from 'vue'; | 8 | import { defineComponent } from 'vue'; |
9 | import SettingDrawer from './SettingDrawer'; | 9 | import SettingDrawer from './SettingDrawer'; |
10 | - import Icon from '/@/components/Icon'; | 10 | + import { Icon } from '/@/components/Icon'; |
11 | 11 | ||
12 | import { useDrawer } from '/@/components/Drawer'; | 12 | import { useDrawer } from '/@/components/Drawer'; |
13 | 13 |
src/views/demo/page/account/center/Application.vue
@@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
30 | <script lang="ts"> | 30 | <script lang="ts"> |
31 | import { defineComponent } from 'vue'; | 31 | import { defineComponent } from 'vue'; |
32 | import { List, Card, Row, Col } from 'ant-design-vue'; | 32 | import { List, Card, Row, Col } from 'ant-design-vue'; |
33 | - import Icon from '/@/components/Icon/index'; | 33 | + import { Icon } from '/@/components/Icon/index'; |
34 | import { applicationList } from './data'; | 34 | import { applicationList } from './data'; |
35 | 35 | ||
36 | export default defineComponent({ | 36 | export default defineComponent({ |
src/views/demo/page/account/center/Article.vue
@@ -42,7 +42,7 @@ | @@ -42,7 +42,7 @@ | ||
42 | <script lang="ts"> | 42 | <script lang="ts"> |
43 | import { defineComponent } from 'vue'; | 43 | import { defineComponent } from 'vue'; |
44 | import { List, Tag } from 'ant-design-vue'; | 44 | import { List, Tag } from 'ant-design-vue'; |
45 | - import Icon from '/@/components/Icon/index'; | 45 | + import { Icon } from '/@/components/Icon/index'; |
46 | import { actions, articleList } from './data'; | 46 | import { actions, articleList } from './data'; |
47 | 47 | ||
48 | export default defineComponent({ | 48 | export default defineComponent({ |
src/views/demo/page/account/center/index.vue
@@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
56 | import { Tag, Tabs, Row, Col } from 'ant-design-vue'; | 56 | import { Tag, Tabs, Row, Col } from 'ant-design-vue'; |
57 | import { defineComponent, computed } from 'vue'; | 57 | import { defineComponent, computed } from 'vue'; |
58 | import { CollapseContainer } from '/@/components/Container/index'; | 58 | import { CollapseContainer } from '/@/components/Container/index'; |
59 | - import Icon from '/@/components/Icon/index'; | 59 | + import { Icon } from '/@/components/Icon/index'; |
60 | import Article from './Article.vue'; | 60 | import Article from './Article.vue'; |
61 | import Application from './Application.vue'; | 61 | import Application from './Application.vue'; |
62 | import Project from './Project.vue'; | 62 | import Project from './Project.vue'; |
src/views/demo/page/account/setting/AccountBind.vue
@@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
26 | import { List } from 'ant-design-vue'; | 26 | import { List } from 'ant-design-vue'; |
27 | import { defineComponent } from 'vue'; | 27 | import { defineComponent } from 'vue'; |
28 | import { CollapseContainer } from '/@/components/Container/index'; | 28 | import { CollapseContainer } from '/@/components/Container/index'; |
29 | - import Icon from '/@/components/Icon/index'; | 29 | + import { Icon } from '/@/components/Icon/index'; |
30 | 30 | ||
31 | import { accountBindList } from './data'; | 31 | import { accountBindList } from './data'; |
32 | 32 |
src/views/demo/page/list/basic/index.vue
@@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
53 | <script lang="ts"> | 53 | <script lang="ts"> |
54 | import { Progress, Row, Col, List } from 'ant-design-vue'; | 54 | import { Progress, Row, Col, List } from 'ant-design-vue'; |
55 | import { defineComponent } from 'vue'; | 55 | import { defineComponent } from 'vue'; |
56 | - import Icon from '/@/components/Icon/index'; | 56 | + import { Icon } from '/@/components/Icon/index'; |
57 | import { cardList } from './data'; | 57 | import { cardList } from './data'; |
58 | import { PageWrapper } from '/@/components/Page'; | 58 | import { PageWrapper } from '/@/components/Page'; |
59 | 59 |
src/views/demo/page/list/card/index.vue
@@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
34 | </template> | 34 | </template> |
35 | <script lang="ts"> | 35 | <script lang="ts"> |
36 | import { defineComponent } from 'vue'; | 36 | import { defineComponent } from 'vue'; |
37 | - import Icon from '/@/components/Icon/index'; | 37 | + import { Icon } from '/@/components/Icon/index'; |
38 | import { cardList } from './data'; | 38 | import { cardList } from './data'; |
39 | import { PageWrapper } from '/@/components/Page'; | 39 | import { PageWrapper } from '/@/components/Page'; |
40 | import { Card, Row, Col, List } from 'ant-design-vue'; | 40 | import { Card, Row, Col, List } from 'ant-design-vue'; |
src/views/demo/page/list/search/index.vue
@@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
55 | <script lang="ts"> | 55 | <script lang="ts"> |
56 | import { Tag, List } from 'ant-design-vue'; | 56 | import { Tag, List } from 'ant-design-vue'; |
57 | import { defineComponent } from 'vue'; | 57 | import { defineComponent } from 'vue'; |
58 | - import Icon from '/@/components/Icon/index'; | 58 | + import { Icon } from '/@/components/Icon/index'; |
59 | import { BasicForm } from '/@/components/Form/index'; | 59 | import { BasicForm } from '/@/components/Form/index'; |
60 | import { actions, searchList, schemas } from './data'; | 60 | import { actions, searchList, schemas } from './data'; |
61 | import { PageWrapper } from '/@/components/Page'; | 61 | import { PageWrapper } from '/@/components/Page'; |
src/views/form-design/components/VFormDesign/components/FormNodeOperate.vue
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | import { IVFormComponent } from '../../../typings/v-form-component'; | 17 | import { IVFormComponent } from '../../../typings/v-form-component'; |
18 | import { remove } from '../../../utils'; | 18 | import { remove } from '../../../utils'; |
19 | import { useFormDesignState } from '../../../hooks/useFormDesignState'; | 19 | import { useFormDesignState } from '../../../hooks/useFormDesignState'; |
20 | - import Icon from '/@/components/Icon/index'; | 20 | + import { Icon } from '/@/components/Icon/index'; |
21 | 21 | ||
22 | export default defineComponent({ | 22 | export default defineComponent({ |
23 | name: 'FormNodeOperate', | 23 | name: 'FormNodeOperate', |
src/views/form-design/components/VFormDesign/components/FormOptions.vue
@@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
38 | import { remove } from '../../../utils'; | 38 | import { remove } from '../../../utils'; |
39 | import message from '../../../utils/message'; | 39 | import message from '../../../utils/message'; |
40 | import { Input } from 'ant-design-vue'; | 40 | import { Input } from 'ant-design-vue'; |
41 | - import Icon from '/@/components/Icon/index'; | 41 | + import { Icon } from '/@/components/Icon/index'; |
42 | 42 | ||
43 | export default defineComponent({ | 43 | export default defineComponent({ |
44 | name: 'FormOptions', | 44 | name: 'FormOptions', |
src/views/form-design/components/VFormDesign/components/RuleProps.vue
@@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
38 | import { useFormDesignState } from '../../../hooks/useFormDesignState'; | 38 | import { useFormDesignState } from '../../../hooks/useFormDesignState'; |
39 | import { isArray } from 'lodash-es'; | 39 | import { isArray } from 'lodash-es'; |
40 | import { Form, FormItem, AutoComplete, Input } from 'ant-design-vue'; | 40 | import { Form, FormItem, AutoComplete, Input } from 'ant-design-vue'; |
41 | - import Icon from '/@/components/Icon'; | 41 | + import { Icon } from '/@/components/Icon'; |
42 | 42 | ||
43 | export default defineComponent({ | 43 | export default defineComponent({ |
44 | name: 'RuleProps', | 44 | name: 'RuleProps', |
src/views/form-design/components/VFormDesign/modules/Toolbar.vue
@@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
31 | import { UseRefHistoryReturn } from '@vueuse/core'; | 31 | import { UseRefHistoryReturn } from '@vueuse/core'; |
32 | import { IFormConfig } from '../../../typings/v-form-component'; | 32 | import { IFormConfig } from '../../../typings/v-form-component'; |
33 | import { Tooltip, Divider } from 'ant-design-vue'; | 33 | import { Tooltip, Divider } from 'ant-design-vue'; |
34 | - import Icon from '/@/components/Icon/index'; | 34 | + import { Icon } from '/@/components/Icon/index'; |
35 | 35 | ||
36 | interface IToolbarsConfig { | 36 | interface IToolbarsConfig { |
37 | type: string; | 37 | type: string; |
src/views/form-design/components/VFormItem/index.vue
@@ -40,13 +40,13 @@ | @@ -40,13 +40,13 @@ | ||
40 | </Col> | 40 | </Col> |
41 | </template> | 41 | </template> |
42 | <script lang="ts"> | 42 | <script lang="ts"> |
43 | + import { type Recordable } from '@vben/types'; | ||
43 | import { defineComponent, reactive, toRefs, computed, PropType, unref } from 'vue'; | 44 | import { defineComponent, reactive, toRefs, computed, PropType, unref } from 'vue'; |
44 | import { componentMap } from '../../core/formItemConfig'; | 45 | import { componentMap } from '../../core/formItemConfig'; |
45 | import { IVFormComponent, IFormConfig } from '../../typings/v-form-component'; | 46 | import { IVFormComponent, IFormConfig } from '../../typings/v-form-component'; |
46 | import { asyncComputed } from '@vueuse/core'; | 47 | import { asyncComputed } from '@vueuse/core'; |
47 | import { handleAsyncOptions } from '../../utils'; | 48 | import { handleAsyncOptions } from '../../utils'; |
48 | import { omit } from 'lodash-es'; | 49 | import { omit } from 'lodash-es'; |
49 | - import { type Recordable } from '@vben/types'; | ||
50 | import { Tooltip, FormItem, Divider, Col } from 'ant-design-vue'; | 50 | import { Tooltip, FormItem, Divider, Col } from 'ant-design-vue'; |
51 | import { Icon } from '/@/components/Icon'; | 51 | import { Icon } from '/@/components/Icon'; |
52 | import { useFormModelState } from '../../hooks/useFormDesignState'; | 52 | import { useFormModelState } from '../../hooks/useFormDesignState'; |
vite.config.ts
@@ -2,6 +2,18 @@ import { defineApplicationConfig } from '@vben/vite-config'; | @@ -2,6 +2,18 @@ import { defineApplicationConfig } from '@vben/vite-config'; | ||
2 | 2 | ||
3 | export default defineApplicationConfig({ | 3 | export default defineApplicationConfig({ |
4 | overrides: { | 4 | overrides: { |
5 | + optimizeDeps: { | ||
6 | + include: [ | ||
7 | + 'echarts/core', | ||
8 | + 'echarts/charts', | ||
9 | + 'echarts/components', | ||
10 | + 'echarts/renderers', | ||
11 | + 'qrcode', | ||
12 | + '@iconify/iconify', | ||
13 | + 'ant-design-vue/es/locale/zh_CN', | ||
14 | + 'ant-design-vue/es/locale/en_US', | ||
15 | + ], | ||
16 | + }, | ||
5 | server: { | 17 | server: { |
6 | proxy: { | 18 | proxy: { |
7 | '/basic-api': { | 19 | '/basic-api': { |