Commit feadf64ee365e9bce77c1bac478f60c66b5d16fe

Authored by vben
1 parent 553ee9c7

fix: Icon加载问题

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