1
0
Эх сурвалжийг харах

fix(Icon): Cannot access Icon before initialization #2680 (#2683)

* fix(Icon): Cannot access Icon before initialization

* fix(comps): import eslint

* fix(Icon): Cannot access Icon before initialization

* fix(comps): import eslint
xingyu 2 жил өмнө
parent
commit
7469312ffc
46 өөрчлөгдсөн 54 нэмэгдсэн , 38 устгасан
  1. 1 0
      src/components/Application/src/search/AppSearchFooter.vue
  2. 1 0
      src/components/Application/src/search/AppSearchKeyItem.vue
  3. 1 2
      src/components/Application/src/search/AppSearchModal.vue
  4. 1 0
      src/components/CardList/src/CardList.vue
  5. 1 0
      src/components/ClickOutSide/src/ClickOutSide.vue
  6. 1 1
      src/components/ContextMenu/src/ContextMenu.vue
  7. 1 1
      src/components/Cropper/src/CropperAvatar.vue
  8. 1 0
      src/components/Drawer/src/components/DrawerFooter.vue
  9. 1 0
      src/components/Drawer/src/components/DrawerHeader.vue
  10. 1 0
      src/components/Excel/src/ImportExcel.vue
  11. 1 0
      src/components/Form/src/components/ApiCascader.vue
  12. 1 0
      src/components/Form/src/components/ApiTransfer.vue
  13. 1 0
      src/components/Form/src/components/ApiTree.vue
  14. 1 0
      src/components/Form/src/components/ApiTreeSelect.vue
  15. 4 4
      src/components/Form/src/components/FormItem.vue
  16. 1 1
      src/components/Icon/index.ts
  17. 1 2
      src/components/Loading/src/Loading.vue
  18. 1 0
      src/components/Markdown/src/MarkdownViewer.vue
  19. 1 0
      src/components/Menu/src/components/BasicMenuItem.vue
  20. 2 1
      src/components/Menu/src/components/MenuItemContent.vue
  21. 1 1
      src/components/Modal/src/components/ModalFooter.vue
  22. 1 1
      src/components/Page/src/PageWrapper.vue
  23. 2 1
      src/components/Scrollbar/src/Scrollbar.vue
  24. 1 0
      src/components/SimpleMenu/src/SimpleMenu.vue
  25. 1 1
      src/components/SimpleMenu/src/SimpleSubMenu.vue
  26. 1 0
      src/components/SimpleMenu/src/components/Menu.vue
  27. 2 1
      src/components/SimpleMenu/src/components/MenuItem.vue
  28. 1 1
      src/components/SimpleMenu/src/components/SubMenuItem.vue
  29. 1 0
      src/components/Table/src/components/EditTableHeaderIcon.vue
  30. 1 1
      src/components/Table/src/components/TableAction.vue
  31. 1 1
      src/layouts/default/header/components/Breadcrumb.vue
  32. 1 1
      src/layouts/default/header/components/ErrorAction.vue
  33. 1 1
      src/layouts/default/header/components/user-dropdown/DropMenuItem.vue
  34. 1 1
      src/layouts/default/setting/index.vue
  35. 1 1
      src/views/demo/page/account/center/Application.vue
  36. 1 1
      src/views/demo/page/account/center/Article.vue
  37. 1 1
      src/views/demo/page/account/center/index.vue
  38. 1 1
      src/views/demo/page/account/setting/AccountBind.vue
  39. 1 1
      src/views/demo/page/list/basic/index.vue
  40. 1 1
      src/views/demo/page/list/card/index.vue
  41. 2 3
      src/views/demo/page/list/search/index.vue
  42. 1 1
      src/views/form-design/components/VFormDesign/components/FormNodeOperate.vue
  43. 2 1
      src/views/form-design/components/VFormDesign/components/FormOptions.vue
  44. 1 1
      src/views/form-design/components/VFormDesign/components/RuleProps.vue
  45. 1 1
      src/views/form-design/components/VFormDesign/modules/Toolbar.vue
  46. 1 2
      src/views/form-design/components/VFormItem/index.vue

+ 1 - 0
src/components/Application/src/search/AppSearchFooter.vue

@@ -14,6 +14,7 @@
   import AppSearchKeyItem from './AppSearchKeyItem.vue';
   import { useDesign } from '/@/hooks/web/useDesign';
   import { useI18n } from '/@/hooks/web/useI18n';
+
   const { prefixCls } = useDesign('app-search-footer');
   const { t } = useI18n();
 </script>

+ 1 - 0
src/components/Application/src/search/AppSearchKeyItem.vue

@@ -5,6 +5,7 @@
 </template>
 <script lang="ts" setup>
   import { Icon } from '/@/components/Icon';
+
   defineProps({
     icon: String,
   });

+ 1 - 2
src/components/Application/src/search/AppSearchModal.vue

@@ -61,8 +61,7 @@
   import { computed, unref, ref, watch, nextTick } from 'vue';
   import { SearchOutlined } from '@ant-design/icons-vue';
   import AppSearchFooter from './AppSearchFooter.vue';
-  import Icon from '/@/components/Icon';
-  // @ts-ignore
+  import { Icon } from '/@/components/Icon';
   import vClickOutside from '/@/directives/clickOutside';
   import { useDesign } from '/@/hooks/web/useDesign';
   import { useRefs } from '/@/hooks/core/useRefs';

+ 1 - 0
src/components/CardList/src/CardList.vue

@@ -90,6 +90,7 @@
   import { Button } from '/@/components/Button';
   import { isFunction } from '/@/utils/is';
   import { useSlider, grid } from './data';
+
   const ListItem = List.Item;
   const CardMeta = Card.Meta;
   const TypographyText = Typography.Text;

+ 1 - 0
src/components/ClickOutSide/src/ClickOutSide.vue

@@ -6,6 +6,7 @@
 <script lang="ts" setup>
   import { ref, onMounted } from 'vue';
   import { onClickOutside } from '@vueuse/core';
+
   const emit = defineEmits(['mounted', 'clickOutside']);
   const wrap = ref<ElRef>(null);
 

+ 1 - 1
src/components/ContextMenu/src/ContextMenu.vue

@@ -2,7 +2,7 @@
   import type { ContextMenuItem, ItemContentProps, Axis } from './typing';
   import type { FunctionalComponent, CSSProperties, PropType } from 'vue';
   import { defineComponent, nextTick, onMounted, computed, ref, unref, onUnmounted } from 'vue';
-  import Icon from '/@/components/Icon';
+  import { Icon } from '/@/components/Icon';
   import { Menu, Divider } from 'ant-design-vue';
 
   const prefixCls = 'context-menu';

+ 1 - 1
src/components/Cropper/src/CropperAvatar.vue

@@ -45,7 +45,7 @@
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useI18n } from '/@/hooks/web/useI18n';
   import type { ButtonProps } from '/@/components/Button';
-  import Icon from '/@/components/Icon';
+  import { Icon } from '/@/components/Icon';
 
   const props = {
     width: { type: [String, Number], default: '200px' },

+ 1 - 0
src/components/Drawer/src/components/DrawerFooter.vue

@@ -30,6 +30,7 @@
   import { useDesign } from '/@/hooks/web/useDesign';
 
   import { footerProps } from '../props';
+
   export default defineComponent({
     name: 'BasicDrawerFooter',
     props: {

+ 1 - 0
src/components/Drawer/src/components/DrawerHeader.vue

@@ -25,6 +25,7 @@
   import { useDesign } from '/@/hooks/web/useDesign';
 
   import { propTypes } from '/@/utils/propTypes';
+
   export default defineComponent({
     name: 'BasicDrawerHeader',
     components: { BasicTitle, ArrowLeftOutlined },

+ 1 - 0
src/components/Excel/src/ImportExcel.vue

@@ -18,6 +18,7 @@
   import { dateUtil } from '/@/utils/dateUtil';
 
   import type { ExcelData } from './typing';
+
   export default defineComponent({
     name: 'ImportExcel',
     props: {

+ 1 - 0
src/components/Form/src/components/ApiCascader.vue

@@ -27,6 +27,7 @@
   import { useRuleFormItem } from '/@/hooks/component/useFormItem';
   import { LoadingOutlined } from '@ant-design/icons-vue';
   import { useI18n } from '/@/hooks/web/useI18n';
+
   interface Option {
     value: string;
     label: string;

+ 1 - 0
src/components/Form/src/components/ApiTransfer.vue

@@ -19,6 +19,7 @@
   import { propTypes } from '/@/utils/propTypes';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { TransferDirection, TransferItem } from 'ant-design-vue/lib/transfer';
+
   export default defineComponent({
     name: 'ApiTransfer',
     components: { Transfer },

+ 1 - 0
src/components/Form/src/components/ApiTree.vue

@@ -16,6 +16,7 @@
   import { get } from 'lodash-es';
   import { propTypes } from '/@/utils/propTypes';
   import { LoadingOutlined } from '@ant-design/icons-vue';
+
   export default defineComponent({
     name: 'ApiTree',
     components: { ATree: Tree, LoadingOutlined },

+ 1 - 0
src/components/Form/src/components/ApiTreeSelect.vue

@@ -16,6 +16,7 @@
   import { get } from 'lodash-es';
   import { propTypes } from '/@/utils/propTypes';
   import { LoadingOutlined } from '@ant-design/icons-vue';
+
   export default defineComponent({
     name: 'ApiTreeSelect',
     components: { ATreeSelect: TreeSelect, LoadingOutlined },

+ 4 - 4
src/components/Form/src/components/FormItem.vue

@@ -2,7 +2,7 @@
   import type { PropType, Ref } from 'vue';
   import { computed, defineComponent, toRefs, unref } from 'vue';
   import type { FormActionType, FormProps, FormSchema } from '../types/form';
-  import type { ValidationRule } from 'ant-design-vue/lib/form/Form';
+  import type { Rule } from 'ant-design-vue/lib/form';
   import type { TableActionType } from '/@/components/Table';
   import { Col, Divider, Form } from 'ant-design-vue';
   import { componentMap } from '../componentMap';
@@ -138,7 +138,7 @@
         return { isShow, isIfShow };
       }
 
-      function handleRules(): ValidationRule[] {
+      function handleRules(): Rule[] {
         const {
           rules: defRules = [],
           component,
@@ -149,10 +149,10 @@
         } = props.schema;
 
         if (isFunction(dynamicRules)) {
-          return dynamicRules(unref(getValues)) as ValidationRule[];
+          return dynamicRules(unref(getValues)) as Rule[];
         }
 
-        let rules: ValidationRule[] = cloneDeep(defRules) as ValidationRule[];
+        let rules: Rule[] = cloneDeep(defRules) as Rule[];
         const { rulesMessageJoinLabel: globalRulesMessageJoinLabel } = props.formProps;
 
         const joinLabel = Reflect.has(props.schema, 'rulesMessageJoinLabel')

+ 1 - 1
src/components/Icon/index.ts

@@ -4,4 +4,4 @@ import IconPicker from './src/IconPicker.vue';
 
 export { Icon, IconPicker, SvgIcon };
 
-export default Icon;
+// export default Icon;

+ 1 - 2
src/components/Loading/src/Loading.vue

@@ -9,8 +9,7 @@
   </section>
 </template>
 <script lang="ts">
-  import { PropType } from 'vue';
-  import { defineComponent } from 'vue';
+  import { PropType, defineComponent } from 'vue';
   import { Spin } from 'ant-design-vue';
   import { SizeEnum } from '/@/enums/sizeEnum';
 

+ 1 - 0
src/components/Markdown/src/MarkdownViewer.vue

@@ -8,6 +8,7 @@
   import { onMountedOrActivated } from '@vben/hooks';
   import { useRootSetting } from '/@/hooks/setting/useRootSetting';
   import { getTheme } from './getTheme';
+
   const props = defineProps({
     value: { type: String },
     class: { type: String },

+ 1 - 0
src/components/Menu/src/components/BasicMenuItem.vue

@@ -9,6 +9,7 @@
   import { itemProps } from '../props';
 
   import MenuItemContent from './MenuItemContent.vue';
+
   export default defineComponent({
     name: 'BasicMenuItem',
     components: { MenuItem: Menu.Item, MenuItemContent },

+ 2 - 1
src/components/Menu/src/components/MenuItemContent.vue

@@ -7,10 +7,11 @@
 <script lang="ts">
   import { computed, defineComponent } from 'vue';
 
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useDesign } from '/@/hooks/web/useDesign';
   import { contentProps } from '../props';
+
   const { t } = useI18n();
 
   export default defineComponent({

+ 1 - 1
src/components/Modal/src/components/ModalFooter.vue

@@ -19,8 +19,8 @@
 </template>
 <script lang="ts">
   import { defineComponent } from 'vue';
-
   import { basicProps } from '../props';
+
   export default defineComponent({
     name: 'BasicModalFooter',
     props: basicProps,

+ 1 - 1
src/components/Page/src/PageWrapper.vue

@@ -33,7 +33,7 @@
   </div>
 </template>
 <script lang="ts">
-  import { CSSProperties, PropType, provide } from 'vue';
+  import type { CSSProperties, PropType, provide } from 'vue';
 
   import { defineComponent, computed, watch, ref, unref } from 'vue';
   import PageFooter from './PageFooter.vue';

+ 2 - 1
src/components/Scrollbar/src/Scrollbar.vue

@@ -19,7 +19,6 @@
 <script lang="ts">
   import { addResizeListener, removeResizeListener } from '/@/utils/event';
   import componentSetting from '/@/settings/componentSetting';
-  const { scrollbar } = componentSetting;
   import { toObject } from './util';
   import {
     defineComponent,
@@ -33,6 +32,8 @@
   } from 'vue';
   import Bar from './bar';
 
+  const { scrollbar } = componentSetting;
+
   export default defineComponent({
     name: 'Scrollbar',
     // inheritAttrs: false,

+ 1 - 0
src/components/SimpleMenu/src/SimpleMenu.vue

@@ -33,6 +33,7 @@
   import { openWindow } from '/@/utils';
 
   import { useOpenKeys } from './useOpenKeys';
+
   export default defineComponent({
     name: 'SimpleMenu',
     components: {

+ 1 - 1
src/components/SimpleMenu/src/SimpleSubMenu.vue

@@ -48,7 +48,7 @@
 
   import { defineComponent, computed } from 'vue';
   import { useDesign } from '/@/hooks/web/useDesign';
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
 
   import MenuItem from './components/MenuItem.vue';
   import SubMenu from './components/SubMenuItem.vue';

+ 1 - 0
src/components/SimpleMenu/src/components/Menu.vue

@@ -23,6 +23,7 @@
   import { propTypes } from '/@/utils/propTypes';
   import { createSimpleRootMenuContext } from './useSimpleMenuContext';
   import mitt from '/@/utils/mitt';
+
   export default defineComponent({
     name: 'Menu',
     props: {

+ 2 - 1
src/components/SimpleMenu/src/components/MenuItem.vue

@@ -17,13 +17,14 @@
 </template>
 
 <script lang="ts">
-  import { PropType } from 'vue';
+  import type { PropType } from 'vue';
   import { defineComponent, ref, computed, unref, getCurrentInstance, watch } from 'vue';
   import { useDesign } from '/@/hooks/web/useDesign';
   import { propTypes } from '/@/utils/propTypes';
   import { useMenuItem } from './useMenu';
   import { Tooltip } from 'ant-design-vue';
   import { useSimpleRootMenuContext } from './useSimpleMenuContext';
+
   export default defineComponent({
     name: 'MenuItem',
     components: { Tooltip },

+ 1 - 1
src/components/SimpleMenu/src/components/SubMenuItem.vue

@@ -74,7 +74,7 @@
   import { useMenuItem } from './useMenu';
   import { useSimpleRootMenuContext } from './useSimpleMenuContext';
   import { CollapseTransition } from '/@/components/Transition';
-  import Icon from '/@/components/Icon';
+  import { Icon } from '/@/components/Icon';
   import { Popover } from 'ant-design-vue';
   import { isBoolean, isObject } from '/@/utils/is';
   import mitt from '/@/utils/mitt';

+ 1 - 0
src/components/Table/src/components/EditTableHeaderIcon.vue

@@ -8,6 +8,7 @@
 <script lang="ts">
   import { defineComponent } from 'vue';
   import { FormOutlined } from '@ant-design/icons-vue';
+
   export default defineComponent({
     name: 'EditTableHeaderIcon',
     components: { FormOutlined },

+ 1 - 1
src/components/Table/src/components/TableAction.vue

@@ -34,7 +34,7 @@
   import { defineComponent, PropType, computed, toRaw, unref } from 'vue';
   import { MoreOutlined } from '@ant-design/icons-vue';
   import { Divider, Tooltip, TooltipProps } from 'ant-design-vue';
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
   import { ActionItem, TableActionType } from '/@/components/Table';
   import { PopConfirmButton } from '/@/components/Button';
   import { Dropdown } from '/@/components/Dropdown';

+ 1 - 1
src/layouts/default/header/components/Breadcrumb.vue

@@ -21,7 +21,7 @@
   import { defineComponent, ref, watchEffect } from 'vue';
 
   import { Breadcrumb } from 'ant-design-vue';
-  import Icon from '/@/components/Icon';
+  import { Icon } from '/@/components/Icon';
 
   import { useDesign } from '/@/hooks/web/useDesign';
   import { useRootSetting } from '/@/hooks/setting/useRootSetting';

+ 1 - 1
src/layouts/default/header/components/ErrorAction.vue

@@ -13,7 +13,7 @@
 <script lang="ts">
   import { defineComponent, computed } from 'vue';
   import { Tooltip, Badge } from 'ant-design-vue';
-  import Icon from '/@/components/Icon';
+  import { Icon } from '/@/components/Icon';
 
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useErrorLogStore } from '/@/store/modules/errorLog';

+ 1 - 1
src/layouts/default/header/components/user-dropdown/DropMenuItem.vue

@@ -11,7 +11,7 @@
 
   import { computed, defineComponent, getCurrentInstance } from 'vue';
 
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
   import { propTypes } from '/@/utils/propTypes';
 
   export default defineComponent({

+ 1 - 1
src/layouts/default/setting/index.vue

@@ -7,7 +7,7 @@
 <script lang="ts">
   import { defineComponent } from 'vue';
   import SettingDrawer from './SettingDrawer';
-  import Icon from '/@/components/Icon';
+  import { Icon } from '/@/components/Icon';
 
   import { useDrawer } from '/@/components/Drawer';
 

+ 1 - 1
src/views/demo/page/account/center/Application.vue

@@ -30,7 +30,7 @@
 <script lang="ts">
   import { defineComponent } from 'vue';
   import { List, Card, Row, Col } from 'ant-design-vue';
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
   import { applicationList } from './data';
 
   export default defineComponent({

+ 1 - 1
src/views/demo/page/account/center/Article.vue

@@ -42,7 +42,7 @@
 <script lang="ts">
   import { defineComponent } from 'vue';
   import { List, Tag } from 'ant-design-vue';
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
   import { actions, articleList } from './data';
 
   export default defineComponent({

+ 1 - 1
src/views/demo/page/account/center/index.vue

@@ -56,7 +56,7 @@
   import { Tag, Tabs, Row, Col } from 'ant-design-vue';
   import { defineComponent, computed } from 'vue';
   import { CollapseContainer } from '/@/components/Container/index';
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
   import Article from './Article.vue';
   import Application from './Application.vue';
   import Project from './Project.vue';

+ 1 - 1
src/views/demo/page/account/setting/AccountBind.vue

@@ -26,7 +26,7 @@
   import { List } from 'ant-design-vue';
   import { defineComponent } from 'vue';
   import { CollapseContainer } from '/@/components/Container/index';
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
 
   import { accountBindList } from './data';
 

+ 1 - 1
src/views/demo/page/list/basic/index.vue

@@ -53,7 +53,7 @@
 <script lang="ts">
   import { Progress, Row, Col } from 'ant-design-vue';
   import { defineComponent } from 'vue';
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
   import { cardList } from './data';
   import { PageWrapper } from '/@/components/Page';
   import { List } from 'ant-design-vue';

+ 1 - 1
src/views/demo/page/list/card/index.vue

@@ -34,7 +34,7 @@
 </template>
 <script lang="ts">
   import { defineComponent } from 'vue';
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
   import { cardList } from './data';
   import { PageWrapper } from '/@/components/Page';
   import { Card, Row, Col, List } from 'ant-design-vue';

+ 2 - 3
src/views/demo/page/list/search/index.vue

@@ -53,13 +53,12 @@
   </PageWrapper>
 </template>
 <script lang="ts">
-  import { Tag } from 'ant-design-vue';
+  import { Tag, List } from 'ant-design-vue';
   import { defineComponent } from 'vue';
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
   import { BasicForm } from '/@/components/Form/index';
   import { actions, searchList, schemas } from './data';
   import { PageWrapper } from '/@/components/Page';
-  import { List } from 'ant-design-vue';
 
   export default defineComponent({
     components: {

+ 1 - 1
src/views/form-design/components/VFormDesign/components/FormNodeOperate.vue

@@ -17,7 +17,7 @@
   import { IVFormComponent } from '../../../typings/v-form-component';
   import { remove } from '../../../utils';
   import { useFormDesignState } from '../../../hooks/useFormDesignState';
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
 
   export default defineComponent({
     name: 'FormNodeOperate',

+ 2 - 1
src/views/form-design/components/VFormDesign/components/FormOptions.vue

@@ -38,7 +38,8 @@
   import { remove } from '../../../utils';
   import message from '../../../utils/message';
   import { Input } from 'ant-design-vue';
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
+
   export default defineComponent({
     name: 'FormOptions',
     components: { Input, Icon },

+ 1 - 1
src/views/form-design/components/VFormDesign/components/RuleProps.vue

@@ -38,7 +38,7 @@
   import { useFormDesignState } from '../../../hooks/useFormDesignState';
   import { isArray } from 'lodash-es';
   import { Form, FormItem, AutoComplete, Input } from 'ant-design-vue';
-  import Icon from '/@/components/Icon';
+  import { Icon } from '/@/components/Icon';
 
   export default defineComponent({
     name: 'RuleProps',

+ 1 - 1
src/views/form-design/components/VFormDesign/modules/Toolbar.vue

@@ -31,7 +31,7 @@
   import { UseRefHistoryReturn } from '@vueuse/core';
   import { IFormConfig } from '../../../typings/v-form-component';
   import { Tooltip, Divider } from 'ant-design-vue';
-  import Icon from '/@/components/Icon/index';
+  import { Icon } from '/@/components/Icon';
 
   interface IToolbarsConfig {
     type: string;

+ 1 - 2
src/views/form-design/components/VFormItem/index.vue

@@ -47,11 +47,10 @@
   import { handleAsyncOptions } from '../../utils';
   import { omit } from 'lodash-es';
   import { Tooltip, FormItem, Divider, Col } from 'ant-design-vue';
-
   // import FormItem from '/@/components/Form/src/components/FormItem.vue';
-
   import { Icon } from '/@/components/Icon';
   import { useFormModelState } from '../../hooks/useFormDesignState';
+
   export default defineComponent({
     name: 'VFormItem',
     components: {