Commit e15b4f14db51812effd55670b3d2da7b082e00a7

Authored by vben
1 parent a5ff5923

fix: fix all types of errors, compatible with volar plugin

Showing 35 changed files with 69 additions and 61 deletions
src/components/Application/src/search/AppSearchModal.vue
@@ -62,6 +62,7 @@ @@ -62,6 +62,7 @@
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 import vClickOutside from '/@/directives/clickOutside'; 66 import vClickOutside from '/@/directives/clickOutside';
66 import { useDesign } from '/@/hooks/web/useDesign'; 67 import { useDesign } from '/@/hooks/web/useDesign';
67 import { useRefs } from '/@/hooks/core/useRefs'; 68 import { useRefs } from '/@/hooks/core/useRefs';
src/components/Button/src/BasicButton.vue
@@ -9,10 +9,11 @@ @@ -9,10 +9,11 @@
9 </template> 9 </template>
10 10
11 <script lang="ts"> 11 <script lang="ts">
12 - export default { 12 + import { defineComponent } from 'vue';
  13 + export default defineComponent({
13 name: 'AButton', 14 name: 'AButton',
14 inheritAttrs: false, 15 inheritAttrs: false,
15 - }; 16 + });
16 </script> 17 </script>
17 <script lang="ts" setup> 18 <script lang="ts" setup>
18 import { computed, unref } from 'vue'; 19 import { computed, unref } from 'vue';
src/components/Container/src/ScrollContainer.vue
@@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
54 return; 54 return;
55 } 55 }
56 nextTick(() => { 56 nextTick(() => {
57 - const wrap = unref(scrollbar.wrap); 57 + const wrap = unref(scrollbar.wrap) as any;
58 if (!wrap) { 58 if (!wrap) {
59 return; 59 return;
60 } 60 }
src/components/ContextMenu/src/ContextMenu.vue
@@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
46 name: 'ContextMenu', 46 name: 'ContextMenu',
47 props, 47 props,
48 setup(props) { 48 setup(props) {
49 - const wrapRef = ref<ElRef>(null); 49 + const wrapRef = ref(null);
50 const showRef = ref(false); 50 const showRef = ref(false);
51 51
52 const getStyle = computed((): CSSProperties => { 52 const getStyle = computed((): CSSProperties => {
src/components/Cropper/src/CropperAvatar.vue
@@ -103,7 +103,7 @@ @@ -103,7 +103,7 @@
103 t, 103 t,
104 prefixCls, 104 prefixCls,
105 register, 105 register,
106 - openModal, 106 + openModal: openModal as any,
107 getIconWidth, 107 getIconWidth,
108 sourceValue, 108 sourceValue,
109 getClass, 109 getClass,
src/components/Drawer/src/BasicDrawer.vue
@@ -181,9 +181,9 @@ @@ -181,9 +181,9 @@
181 onClose, 181 onClose,
182 t, 182 t,
183 prefixCls, 183 prefixCls,
184 - getMergeProps, 184 + getMergeProps: getMergeProps as any,
185 getScrollContentStyle, 185 getScrollContentStyle,
186 - getProps, 186 + getProps: getProps as any,
187 getLoading, 187 getLoading,
188 getBindValues, 188 getBindValues,
189 getFooterHeight, 189 getFooterHeight,
src/components/Form/src/BasicForm.vue
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 </FormItem> 24 </FormItem>
25 </template> 25 </template>
26 26
27 - <FormAction v-bind="{ ...getProps, ...advanceState }" @toggle-advanced="handleToggleAdvanced"> 27 + <FormAction v-bind="getFormActionBindProps" @toggle-advanced="handleToggleAdvanced">
28 <template 28 <template
29 #[item]="data" 29 #[item]="data"
30 v-for="item in ['resetBefore', 'submitBefore', 'advanceBefore', 'advanceAfter']" 30 v-for="item in ['resetBefore', 'submitBefore', 'advanceBefore', 'advanceAfter']"
@@ -62,8 +62,6 @@ @@ -62,8 +62,6 @@
62 import { basicProps } from './props'; 62 import { basicProps } from './props';
63 import { useDesign } from '/@/hooks/web/useDesign'; 63 import { useDesign } from '/@/hooks/web/useDesign';
64 64
65 - import type { RowProps } from 'ant-design-vue/lib/grid/Row';  
66 -  
67 export default defineComponent({ 65 export default defineComponent({
68 name: 'BasicForm', 66 name: 'BasicForm',
69 components: { FormItem, Form, Row, FormAction }, 67 components: { FormItem, Form, Row, FormAction },
@@ -103,7 +101,7 @@ @@ -103,7 +101,7 @@
103 }); 101 });
104 102
105 // Get uniform row style and Row configuration for the entire form 103 // Get uniform row style and Row configuration for the entire form
106 - const getRow = computed((): RowProps => { 104 + const getRow = computed((): Recordable => {
107 const { baseRowStyle = {}, rowProps } = unref(getProps); 105 const { baseRowStyle = {}, rowProps } = unref(getProps);
108 return { 106 return {
109 style: baseRowStyle, 107 style: baseRowStyle,
@@ -282,10 +280,12 @@ @@ -282,10 +280,12 @@
282 getProps, 280 getProps,
283 formElRef, 281 formElRef,
284 getSchema, 282 getSchema,
285 - formActionType, 283 + formActionType: formActionType as any,
286 setFormModel, 284 setFormModel,
287 - prefixCls,  
288 getFormClass, 285 getFormClass,
  286 + getFormActionBindProps: computed(
  287 + (): Recordable => ({ ...getProps.value, ...advanceState })
  288 + ),
289 ...formActionType, 289 ...formActionType,
290 }; 290 };
291 }, 291 },
src/components/Form/src/components/FormItem.vue
@@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
83 plain: true, 83 plain: true,
84 }); 84 });
85 } 85 }
86 - return componentProps; 86 + return componentProps as Recordable;
87 }); 87 });
88 88
89 const getDisable = computed(() => { 89 const getDisable = computed(() => {
src/components/Loading/src/useLoading.ts
@@ -4,7 +4,7 @@ import type { LoadingProps } from &#39;./typing&#39;; @@ -4,7 +4,7 @@ import type { LoadingProps } from &#39;./typing&#39;;
4 import type { Ref } from 'vue'; 4 import type { Ref } from 'vue';
5 5
6 export interface UseLoadingOptions { 6 export interface UseLoadingOptions {
7 - target?: HTMLElement | Ref<ElRef>; 7 + target?: any;
8 props?: Partial<LoadingProps>; 8 props?: Partial<LoadingProps>;
9 } 9 }
10 10
src/components/Markdown/src/Markdown.vue
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 <div ref="wrapRef"></div> 2 <div ref="wrapRef"></div>
3 </template> 3 </template>
4 <script lang="ts"> 4 <script lang="ts">
  5 + import type { Ref } from 'vue';
5 import { 6 import {
6 defineComponent, 7 defineComponent,
7 ref, 8 ref,
@@ -30,7 +31,7 @@ @@ -30,7 +31,7 @@
30 emits: ['change', 'get', 'update:value'], 31 emits: ['change', 'get', 'update:value'],
31 setup(props, { attrs, emit }) { 32 setup(props, { attrs, emit }) {
32 const wrapRef = ref<ElRef>(null); 33 const wrapRef = ref<ElRef>(null);
33 - const vditorRef = ref<Nullable<Vditor>>(null); 34 + const vditorRef = ref(null) as Ref<Nullable<Vditor>>;
34 const initedRef = ref(false); 35 const initedRef = ref(false);
35 36
36 const modalFn = useModalContext(); 37 const modalFn = useModalContext();
src/components/Menu/src/BasicMenu.vue
@@ -56,14 +56,14 @@ @@ -56,14 +56,14 @@
56 const { prefixCls } = useDesign('basic-menu'); 56 const { prefixCls } = useDesign('basic-menu');
57 const { items, mode, accordion } = toRefs(props); 57 const { items, mode, accordion } = toRefs(props);
58 58
59 - const { getCollapsed, getIsHorizontal, getTopMenuAlign, getSplit } = useMenuSetting(); 59 + const { getCollapsed, getTopMenuAlign, getSplit } = useMenuSetting();
60 60
61 const { currentRoute } = useRouter(); 61 const { currentRoute } = useRouter();
62 62
63 const { handleOpenChange, setOpenKeys, getOpenKeys } = useOpenKeys( 63 const { handleOpenChange, setOpenKeys, getOpenKeys } = useOpenKeys(
64 menuState, 64 menuState,
65 items, 65 items,
66 - mode, 66 + mode as any,
67 accordion 67 accordion
68 ); 68 );
69 69
@@ -150,8 +150,6 @@ @@ -150,8 +150,6 @@
150 } 150 }
151 151
152 return { 152 return {
153 - prefixCls,  
154 - getIsHorizontal,  
155 handleMenuClick, 153 handleMenuClick,
156 getInlineCollapseOptions, 154 getInlineCollapseOptions,
157 getMenuClass, 155 getMenuClass,
src/components/Menu/src/props.ts
@@ -4,6 +4,8 @@ import type { PropType } from &#39;vue&#39;; @@ -4,6 +4,8 @@ import type { PropType } from &#39;vue&#39;;
4 import { MenuModeEnum, MenuTypeEnum } from '/@/enums/menuEnum'; 4 import { MenuModeEnum, MenuTypeEnum } from '/@/enums/menuEnum';
5 import { ThemeEnum } from '/@/enums/appEnum'; 5 import { ThemeEnum } from '/@/enums/appEnum';
6 import { propTypes } from '/@/utils/propTypes'; 6 import { propTypes } from '/@/utils/propTypes';
  7 +import type { MenuTheme } from 'ant-design-vue';
  8 +import type { MenuMode } from 'ant-design-vue/lib/menu/src/interface';
7 export const basicProps = { 9 export const basicProps = {
8 items: { 10 items: {
9 type: Array as PropType<Menu[]>, 11 type: Array as PropType<Menu[]>,
@@ -14,7 +16,7 @@ export const basicProps = { @@ -14,7 +16,7 @@ export const basicProps = {
14 inlineIndent: propTypes.number.def(20), 16 inlineIndent: propTypes.number.def(20),
15 // 菜单组件的mode属性 17 // 菜单组件的mode属性
16 mode: { 18 mode: {
17 - type: String as PropType<MenuModeEnum>, 19 + type: String as PropType<MenuMode>,
18 default: MenuModeEnum.INLINE, 20 default: MenuModeEnum.INLINE,
19 }, 21 },
20 22
@@ -22,7 +24,10 @@ export const basicProps = { @@ -22,7 +24,10 @@ export const basicProps = {
22 type: String as PropType<MenuTypeEnum>, 24 type: String as PropType<MenuTypeEnum>,
23 default: MenuTypeEnum.MIX, 25 default: MenuTypeEnum.MIX,
24 }, 26 },
25 - theme: propTypes.string.def(ThemeEnum.DARK), 27 + theme: {
  28 + type: String as PropType<MenuTheme>,
  29 + default: ThemeEnum.DARK,
  30 + },
26 inlineCollapsed: propTypes.bool, 31 inlineCollapsed: propTypes.bool,
27 mixSider: propTypes.bool, 32 mixSider: propTypes.bool,
28 33
src/components/Modal/src/BasicModal.vue
@@ -104,7 +104,7 @@ @@ -104,7 +104,7 @@
104 } 104 }
105 105
106 // Custom title component: get title 106 // Custom title component: get title
107 - const getMergeProps = computed((): ModalProps => { 107 + const getMergeProps = computed((): Recordable => {
108 return { 108 return {
109 ...props, 109 ...props,
110 ...(unref(propsRef) as any), 110 ...(unref(propsRef) as any),
@@ -118,7 +118,7 @@ @@ -118,7 +118,7 @@
118 }); 118 });
119 119
120 // modal component does not need title and origin buttons 120 // modal component does not need title and origin buttons
121 - const getProps = computed((): ModalProps => { 121 + const getProps = computed((): Recordable => {
122 const opt = { 122 const opt = {
123 ...unref(getMergeProps), 123 ...unref(getMergeProps),
124 visible: unref(visibleRef), 124 visible: unref(visibleRef),
@@ -212,7 +212,7 @@ @@ -212,7 +212,7 @@
212 extHeightRef.value = height; 212 extHeightRef.value = height;
213 } 213 }
214 214
215 - function handleTitleDbClick(e: ChangeEvent) { 215 + function handleTitleDbClick(e) {
216 if (!props.canFullscreen) return; 216 if (!props.canFullscreen) return;
217 e.stopPropagation(); 217 e.stopPropagation();
218 handleFullScreen(e); 218 handleFullScreen(e);
src/components/Modal/src/components/ModalWrapper.vue
@@ -125,7 +125,7 @@ @@ -125,7 +125,7 @@
125 const modalDom = bodyDom.parentElement && bodyDom.parentElement.parentElement; 125 const modalDom = bodyDom.parentElement && bodyDom.parentElement.parentElement;
126 if (!modalDom) return; 126 if (!modalDom) return;
127 127
128 - const modalRect = getComputedStyle(modalDom).top; 128 + const modalRect = getComputedStyle(modalDom as Element).top;
129 const modalTop = Number.parseInt(modalRect); 129 const modalTop = Number.parseInt(modalRect);
130 let maxHeight = 130 let maxHeight =
131 window.innerHeight - 131 window.innerHeight -
src/components/Preview/src/Preview.vue
@@ -56,7 +56,7 @@ @@ -56,7 +56,7 @@
56 setup(props) { 56 setup(props) {
57 const { prefixCls } = useDesign('image-preview'); 57 const { prefixCls } = useDesign('image-preview');
58 58
59 - const getImageList = computed(() => { 59 + const getImageList = computed((): any[] => {
60 const { imageList } = props; 60 const { imageList } = props;
61 if (!imageList) { 61 if (!imageList) {
62 return []; 62 return [];
src/components/SimpleMenu/src/components/Menu.vue
@@ -124,7 +124,7 @@ @@ -124,7 +124,7 @@
124 isRemoveAllPopup, 124 isRemoveAllPopup,
125 sliceIndex, 125 sliceIndex,
126 level: 0, 126 level: 0,
127 - props, 127 + props: props as any,
128 }); 128 });
129 129
130 onMounted(() => { 130 onMounted(() => {
src/components/SimpleMenu/src/components/useSimpleMenuContext.ts
1 import type { InjectionKey, Ref } from 'vue'; 1 import type { InjectionKey, Ref } from 'vue';
  2 +import type { Emitter } from '/@/utils/mitt';
2 import { createContext, useContext } from '/@/hooks/core/useContext'; 3 import { createContext, useContext } from '/@/hooks/core/useContext';
3 -import mitt from '/@/utils/mitt';  
4 4
5 export interface SimpleRootMenuContextProps { 5 export interface SimpleRootMenuContextProps {
6 - rootMenuEmitter: typeof mitt; 6 + rootMenuEmitter: Emitter;
7 activeName: Ref<string | number>; 7 activeName: Ref<string | number>;
8 } 8 }
9 9
src/components/Table/src/BasicTable.vue
@@ -320,7 +320,7 @@ @@ -320,7 +320,7 @@
320 wrapRef, 320 wrapRef,
321 tableAction, 321 tableAction,
322 redoHeight, 322 redoHeight,
323 - getFormProps, 323 + getFormProps: getFormProps as any,
324 replaceFormSlotKey, 324 replaceFormSlotKey,
325 getFormSlotKeys, 325 getFormSlotKeys,
326 getWrapperClass, 326 getWrapperClass,
src/components/Table/src/components/TableAction.vue
@@ -95,7 +95,7 @@ @@ -95,7 +95,7 @@
95 .map((action) => { 95 .map((action) => {
96 const { popConfirm } = action; 96 const { popConfirm } = action;
97 return { 97 return {
98 - getPopupContainer: () => unref(table?.wrapRef.value) ?? document.body, 98 + getPopupContainer: () => unref((table as any)?.wrapRef.value) ?? document.body,
99 type: 'link', 99 type: 'link',
100 size: 'small', 100 size: 'small',
101 ...action, 101 ...action,
@@ -107,7 +107,7 @@ @@ -107,7 +107,7 @@
107 }); 107 });
108 }); 108 });
109 109
110 - const getDropdownList = computed(() => { 110 + const getDropdownList = computed((): any[] => {
111 return (toRaw(props.dropDownActions) || []) 111 return (toRaw(props.dropDownActions) || [])
112 .filter((action) => { 112 .filter((action) => {
113 return hasPermission(action.auth) && isIfShow(action); 113 return hasPermission(action.auth) && isIfShow(action);
@@ -133,7 +133,7 @@ @@ -133,7 +133,7 @@
133 133
134 function getTooltip(data: string | TooltipProps): TooltipProps { 134 function getTooltip(data: string | TooltipProps): TooltipProps {
135 return { 135 return {
136 - getPopupContainer: () => unref(table?.wrapRef.value) ?? document.body, 136 + getPopupContainer: () => unref((table as any)?.wrapRef.value) ?? document.body,
137 placement: 'bottom', 137 placement: 'bottom',
138 ...(isString(data) ? { title: data } : data), 138 ...(isString(data) ? { title: data } : data),
139 }; 139 };
src/components/Table/src/components/TableImg.vue
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 <template v-for="(img, index) in imgList" :key="img"> 24 <template v-for="(img, index) in imgList" :key="img">
25 <Image 25 <Image
26 :width="size" 26 :width="size"
27 - :style="{ 'margin-left': index === 0 ? 0 : margin }" 27 + :style="{ marginLeft: index === 0 ? 0 : margin }"
28 :src="srcPrefix + img" 28 :src="srcPrefix + img"
29 /> 29 />
30 </template> 30 </template>
src/components/Upload/src/UploadModal.vue
@@ -276,8 +276,8 @@ @@ -276,8 +276,8 @@
276 } 276 }
277 277
278 return { 278 return {
279 - columns: createTableColumns(),  
280 - actionColumn: createActionColumn(handleRemove), 279 + columns: createTableColumns() as any[],
  280 + actionColumn: createActionColumn(handleRemove) as any,
281 register, 281 register,
282 closeModal, 282 closeModal,
283 getHelpText, 283 getHelpText,
src/components/Upload/src/UploadPreviewModal.vue
@@ -80,8 +80,8 @@ @@ -80,8 +80,8 @@
80 register, 80 register,
81 closeModal, 81 closeModal,
82 fileListRef, 82 fileListRef,
83 - columns: createPreviewColumns(),  
84 - actionColumn: createPreviewActionColumn({ handleRemove, handleDownload }), 83 + columns: createPreviewColumns() as any[],
  84 + actionColumn: createPreviewActionColumn({ handleRemove, handleDownload }) as any,
85 }; 85 };
86 }, 86 },
87 }); 87 });
src/components/Verify/src/DragVerify.vue
1 <script lang="tsx"> 1 <script lang="tsx">
  2 + import type { Ref } from 'vue';
2 import { defineComponent, ref, computed, unref, reactive, watch, watchEffect } from 'vue'; 3 import { defineComponent, ref, computed, unref, reactive, watch, watchEffect } from 'vue';
3 import { useTimeoutFn } from '/@/hooks/core/useTimeout'; 4 import { useTimeoutFn } from '/@/hooks/core/useTimeout';
4 import { useEventListener } from '/@/hooks/event/useEventListener'; 5 import { useEventListener } from '/@/hooks/event/useEventListener';
@@ -23,7 +24,7 @@ @@ -23,7 +24,7 @@
23 const wrapElRef = ref<HTMLDivElement | null>(null); 24 const wrapElRef = ref<HTMLDivElement | null>(null);
24 const barElRef = ref<HTMLDivElement | null>(null); 25 const barElRef = ref<HTMLDivElement | null>(null);
25 const contentElRef = ref<HTMLDivElement | null>(null); 26 const contentElRef = ref<HTMLDivElement | null>(null);
26 - const actionElRef = ref<HTMLDivElement | null>(null); 27 + const actionElRef = ref(null) as Ref<HTMLDivElement | null>;
27 28
28 useEventListener({ 29 useEventListener({
29 el: document, 30 el: document,
@@ -324,13 +325,8 @@ @@ -324,13 +325,8 @@
324 color-stop(1, #333) 325 color-stop(1, #333)
325 ); 326 );
326 animation: slidetounlock 3s infinite; 327 animation: slidetounlock 3s infinite;
327 - -webkit-background-clip: text;  
328 - -moz-user-select: none;  
329 - -webkit-user-select: none;  
330 - -o-user-select: none;  
331 - -ms-user-select: none; 328 + background-clip: text;
332 user-select: none; 329 user-select: none;
333 - -webkit-text-fill-color: transparent;  
334 330
335 &.success { 331 &.success {
336 -webkit-text-fill-color: @white; 332 -webkit-text-fill-color: @white;
@@ -363,7 +359,7 @@ @@ -363,7 +359,7 @@
363 } 359 }
364 } 360 }
365 361
366 - @-webkit-keyframes slidetounlock { 362 + @keyframes slidetounlock {
367 0% { 363 0% {
368 background-position: -120px 0; 364 background-position: -120px 0;
369 } 365 }
src/hooks/event/useIntersectionObserver.ts
@@ -2,7 +2,7 @@ import { Ref, watchEffect, ref } from &#39;vue&#39;; @@ -2,7 +2,7 @@ import { Ref, watchEffect, ref } from &#39;vue&#39;;
2 2
3 interface IntersectionObserverProps { 3 interface IntersectionObserverProps {
4 target: Ref<Element | null | undefined>; 4 target: Ref<Element | null | undefined>;
5 - root?: Ref<Element | null | undefined>; 5 + root?: Ref<any>;
6 onIntersect: IntersectionObserverCallback; 6 onIntersect: IntersectionObserverCallback;
7 rootMargin?: string; 7 rootMargin?: string;
8 threshold?: number; 8 threshold?: number;
src/hooks/event/useScrollTo.ts
@@ -2,7 +2,7 @@ import { isFunction, isUnDef } from &#39;/@/utils/is&#39;; @@ -2,7 +2,7 @@ import { isFunction, isUnDef } from &#39;/@/utils/is&#39;;
2 import { ref, unref } from 'vue'; 2 import { ref, unref } from 'vue';
3 3
4 export interface ScrollToParams { 4 export interface ScrollToParams {
5 - el: HTMLElement; 5 + el: any;
6 to: number; 6 to: number;
7 duration?: number; 7 duration?: number;
8 callback?: () => any; 8 callback?: () => any;
src/layouts/default/menu/index.vue
@@ -146,11 +146,11 @@ @@ -146,11 +146,11 @@
146 <SimpleMenu {...menuProps} isSplitMenu={unref(getSplit)} items={menus} /> 146 <SimpleMenu {...menuProps} isSplitMenu={unref(getSplit)} items={menus} />
147 ) : ( 147 ) : (
148 <BasicMenu 148 <BasicMenu
149 - {...menuProps} 149 + {...(menuProps as any)}
150 isHorizontal={props.isHorizontal} 150 isHorizontal={props.isHorizontal}
151 type={unref(getMenuType)} 151 type={unref(getMenuType)}
152 showLogo={unref(getIsShowLogo)} 152 showLogo={unref(getIsShowLogo)}
153 - mode={unref(getComputedMenuMode)} 153 + mode={unref(getComputedMenuMode as any)}
154 items={menus} 154 items={menus}
155 /> 155 />
156 ); 156 );
src/layouts/default/setting/components/InputNumberItem.vue
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 setup(props) { 31 setup(props) {
32 const { prefixCls } = useDesign('setting-input-number-item'); 32 const { prefixCls } = useDesign('setting-input-number-item');
33 33
34 - function handleChange(e: ChangeEvent) { 34 + function handleChange(e) {
35 props.event && baseHandler(props.event, e); 35 props.event && baseHandler(props.event, e);
36 } 36 }
37 return { 37 return {
src/layouts/default/tabs/index.vue
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 </div> 27 </div>
28 </template> 28 </template>
29 <script lang="ts"> 29 <script lang="ts">
30 - import type { RouteLocationNormalized } from 'vue-router'; 30 + import type { RouteLocationNormalized, RouteMeta } from 'vue-router';
31 31
32 import { defineComponent, computed, unref, ref } from 'vue'; 32 import { defineComponent, computed, unref, ref } from 'vue';
33 33
@@ -94,7 +94,7 @@ @@ -94,7 +94,7 @@
94 } 94 }
95 95
96 const { path, fullPath, meta = {} } = route; 96 const { path, fullPath, meta = {} } = route;
97 - const { currentActiveMenu, hideTab } = meta; 97 + const { currentActiveMenu, hideTab } = meta as RouteMeta;
98 const isHide = !hideTab ? null : currentActiveMenu; 98 const isHide = !hideTab ? null : currentActiveMenu;
99 const p = isHide || fullPath || path; 99 const p = isHide || fullPath || path;
100 if (activeKeyRef.value !== p) { 100 if (activeKeyRef.value !== p) {
src/views/dashboard/analysis/components/GrowCard.vue
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <template v-for="(item, index) in growCardList" :key="item.title"> 3 <template v-for="(item, index) in growCardList" :key="item.title">
4 <Card 4 <Card
5 size="small" 5 size="small"
6 - :loading="$attrs.loading" 6 + :loading="loading"
7 :title="item.title" 7 :title="item.title"
8 class="md:w-1/4 w-full !md:mt-0 !mt-4" 8 class="md:w-1/4 w-full !md:mt-0 !mt-4"
9 :class="[index + 1 < 4 && '!md:mr-4']" 9 :class="[index + 1 < 4 && '!md:mr-4']"
@@ -31,4 +31,10 @@ @@ -31,4 +31,10 @@
31 import { Icon } from '/@/components/Icon'; 31 import { Icon } from '/@/components/Icon';
32 import { Tag, Card } from 'ant-design-vue'; 32 import { Tag, Card } from 'ant-design-vue';
33 import { growCardList } from '../data'; 33 import { growCardList } from '../data';
  34 +
  35 + defineProps({
  36 + loading: {
  37 + type: Boolean,
  38 + },
  39 + });
34 </script> 40 </script>
src/views/demo/comp/cropper/index.vue
@@ -73,7 +73,7 @@ @@ -73,7 +73,7 @@
73 handleCropend, 73 handleCropend,
74 handleCircleCropend, 74 handleCircleCropend,
75 avatar, 75 avatar,
76 - uploadApi, 76 + uploadApi: uploadApi as any,
77 }; 77 };
78 }, 78 },
79 }); 79 });
src/views/demo/comp/qrcode/index.vue
@@ -98,7 +98,7 @@ @@ -98,7 +98,7 @@
98 qrEl.download('Qrcode'); 98 qrEl.download('Qrcode');
99 } 99 }
100 100
101 - function onQrcodeDone({ ctx }) { 101 + function onQrcodeDone({ ctx }: any) {
102 if (ctx instanceof CanvasRenderingContext2D) { 102 if (ctx instanceof CanvasRenderingContext2D) {
103 // 额外绘制 103 // 额外绘制
104 ctx.fillStyle = 'black'; 104 ctx.fillStyle = 'black';
src/views/demo/page/account/setting/BaseSetting.vue
@@ -74,7 +74,7 @@ @@ -74,7 +74,7 @@
74 return { 74 return {
75 avatar, 75 avatar,
76 register, 76 register,
77 - uploadApi, 77 + uploadApi: uploadApi as any,
78 updateAvatar, 78 updateAvatar,
79 handleSubmit: () => { 79 handleSubmit: () => {
80 createMessage.success('更新成功!'); 80 createMessage.success('更新成功!');
src/views/demo/page/list/search/index.vue
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 {{ item.content }} 19 {{ item.content }}
20 </div> 20 </div>
21 <div :class="`${prefixCls}__action`"> 21 <div :class="`${prefixCls}__action`">
22 - <template v-for="(action, index) in actions" :key="index"> 22 + <template v-for="action in actions" :key="action.icon">
23 <div :class="`${prefixCls}__action-item`"> 23 <div :class="`${prefixCls}__action-item`">
24 <Icon 24 <Icon
25 v-if="action.icon" 25 v-if="action.icon"
src/views/demo/system/account/DeptTree.vue
@@ -29,9 +29,8 @@ @@ -29,9 +29,8 @@
29 treeData.value = (await getDeptList()) as unknown as TreeItem[]; 29 treeData.value = (await getDeptList()) as unknown as TreeItem[];
30 } 30 }
31 31
32 - function handleSelect(keys: string, e) { 32 + function handleSelect(keys) {
33 emit('select', keys[0]); 33 emit('select', keys[0]);
34 - console.log(keys, e);  
35 } 34 }
36 35
37 onMounted(() => { 36 onMounted(() => {
src/views/demo/tree/EditTree.vue
@@ -88,6 +88,7 @@ @@ -88,6 +88,7 @@
88 if (level === 3) { 88 if (level === 3) {
89 return 'ion:airplane'; 89 return 'ion:airplane';
90 } 90 }
  91 + return '';
91 } 92 }
92 return { treeData, actionList, getRightMenuList, createIcon }; 93 return { treeData, actionList, getRightMenuList, createIcon };
93 }, 94 },