Skip to content

Commit

Permalink
fix: 应用最新eslint规则 删除未使用的变量
Browse files Browse the repository at this point in the history
  • Loading branch information
yuntian001 committed May 13, 2023
1 parent ac5fee4 commit c2bd051
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 27 deletions.
1 change: 0 additions & 1 deletion mock/apiDemo/menu.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { objectEach } from 'xe-utils';
import { success, fail } from '../helper';
let id = 100000;
const menu = [
Expand Down
2 changes: 1 addition & 1 deletion mock/apiDemo/statistics.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { success, fail } from '../helper';
import { success } from '../helper';
//请求地址是按先后顺序模糊匹配
export default [
{
Expand Down
5 changes: 2 additions & 3 deletions src/components/meComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default defineComponent({
transition: Object as PropType<TransitionProps>,
},
setup(props, { attrs }) {
const { loadMessages, clearCache } = useLoadMessages();
const loadMessages = useLoadMessages();
const componentIs: Ref<any> = ref(undefined);
const key = ref(props.componentKey);
const _attrs = ref(attrs);
Expand All @@ -26,12 +26,11 @@ export default defineComponent({
async (is) => {
if (is) {
localeConfig.loadMessageConfig.componentLoad && (await Promise.allSettled(loadMessages(is as any, false))); // 自动加载语言包
clearCache();
componentIs.value = is;
key.value = props.componentKey;
_attrs.value = attrs;
props.doneProgress && done();
props.closeLoading && closeLoading(false,1,props.closeLoading);
props.closeLoading && closeLoading(false, 1, props.closeLoading);
}
},
{ immediate: true },
Expand Down
6 changes: 3 additions & 3 deletions src/components/meDialog/hooks/minMax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default (el: HTMLDivElement & { fullscreen: boolean }) => {
//设置其背景颜色为主色
maxMinButton.style.color = 'var(--el-color-primary)';
};
maxMinButton.onmouseout = function (e) {
maxMinButton.onmouseout = function () {
//设置其背景颜色为默认色
maxMinButton.style.color = 'var(--el-color-info)';
};
Expand Down Expand Up @@ -80,7 +80,7 @@ export default (el: HTMLDivElement & { fullscreen: boolean }) => {
//binding.value({x:e.pageX,y:e.pageY})
};

document.onmouseup = function (e) {
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
};
Expand Down Expand Up @@ -148,7 +148,7 @@ export default (el: HTMLDivElement & { fullscreen: boolean }) => {
dragDom.style.height = y > minHeight ? `${y}px` : minHeight + 'px';
};
//拉伸结束
document.onmouseup = function (e) {
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
el.dispatchEvent(resizeEvent);
Expand Down
2 changes: 1 addition & 1 deletion src/components/meDialog/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<el-dialog ref="elDialogRef" class="me-dialog" :style="{ maxHeight }">
<template v-for="(item, key) in $slots" :key="key" #[key]>
<component :is="item"></component>
<component :is="item as any"></component>
</template>
</el-dialog>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/meTable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</div>
</div>
<el-table v-bind="$attrs" ref="elTableRef" v-loading="loading">
<component :is="customColumnProps!.children"></component>
<component :is="customColumnProps!.children as any"></component>
<template v-if="$slots.append" #append>
<slot name="append"></slot>
</template>
Expand Down
2 changes: 0 additions & 2 deletions src/components/meVxeTable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ import {
VxeTablePropTypes,
} from 'vxe-table';
import { debounce } from 'lodash-es';
import { ElPagination } from 'element-plus';
import { useGlobalStore } from '@/store';
const props = {
meClass: [String, Array as PropType<string[]>],
name: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/meWangEditor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { onBeforeUnmount, shallowRef, PropType } from 'vue';
import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
import { i18nChangeLanguage, IEditorConfig, IToolbarConfig, IDomEditor, SlateDescendant } from '@wangeditor/editor';
import { useGlobalStore } from '@/store';
const props = defineProps({
defineProps({
mode: {
type: String as PropType<'simple' | 'default'>,
default: 'default',
Expand Down
6 changes: 1 addition & 5 deletions src/locales/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ export const useLoadMessages = () => {
locale: string | undefined = undefined,
importArr: Array<Promise<any>> = [],
) => {
if (cache.has(options)) {
return importArr;
}
cache.add(options);
if (typeof options === 'string') {
const component = app.component(capitalize(camelize(options)));
loadMessages(component as ComponentOptions, isLoading, locale, importArr);
Expand Down Expand Up @@ -107,5 +103,5 @@ export const useLoadMessages = () => {
}
return importArr;
};
return { loadMessages, clearCache: () => cache.clear() };
return loadMessages;
};
2 changes: 1 addition & 1 deletion src/views/customForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import {
ElUpload,
ElSpace,
} from 'element-plus';
import { ElDesignForm, ElGenerateForm } from 'vue-form-create';
import { ElDesignForm } from 'vue-form-create';
const app = getCurrentInstance()?.appContext.app;
if (app && !app.config.globalProperties.$initCreate) {
[
Expand Down
9 changes: 4 additions & 5 deletions src/views/rolePermissions/components/menu/components/add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@
<script setup lang="ts" name="Add">
import { addMenuApi, MenuInfo, editMenuApi, menuListApi } from '@/api/menu';
import { FormInstance, FormRules } from 'element-plus';
import { PropType } from 'vue';
import { type, status } from '../dict';
const props = defineProps<{
show:boolean,
data?:Required<MenuInfo>
show: boolean;
data?: Required<MenuInfo>;
}>();
const emit = defineEmits<{
(e:'update:show',show: boolean):void,
(e:'success'):void
(e: 'update:show', show: boolean): void;
(e: 'success'): void;
}>();
const formRef = ref<FormInstance>();
const formData = ref(new MenuInfo());
Expand Down
7 changes: 4 additions & 3 deletions types/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
export {};
declare global {
const EffectScope: typeof import('vue')['EffectScope'];
const ElLoading: typeof import('element-plus/es')['ElLoading'];
const ElMessage: typeof import('element-plus/es')['ElMessage'];
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'];
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'];
const asyncComputed: typeof import('@vueuse/core')['asyncComputed'];
const autoResetRef: typeof import('@vueuse/core')['autoResetRef'];
Expand Down Expand Up @@ -118,10 +115,12 @@ declare global {
const useArrayFilter: typeof import('@vueuse/core')['useArrayFilter'];
const useArrayFind: typeof import('@vueuse/core')['useArrayFind'];
const useArrayFindIndex: typeof import('@vueuse/core')['useArrayFindIndex'];
const useArrayFindLast: typeof import('@vueuse/core')['useArrayFindLast'];
const useArrayJoin: typeof import('@vueuse/core')['useArrayJoin'];
const useArrayMap: typeof import('@vueuse/core')['useArrayMap'];
const useArrayReduce: typeof import('@vueuse/core')['useArrayReduce'];
const useArraySome: typeof import('@vueuse/core')['useArraySome'];
const useArrayUnique: typeof import('@vueuse/core')['useArrayUnique'];
const useAsyncQueue: typeof import('@vueuse/core')['useAsyncQueue'];
const useAsyncState: typeof import('@vueuse/core')['useAsyncState'];
const useAttrs: typeof import('vue')['useAttrs'];
Expand Down Expand Up @@ -205,12 +204,14 @@ declare global {
const useParallax: typeof import('@vueuse/core')['useParallax'];
const usePermission: typeof import('@vueuse/core')['usePermission'];
const usePointer: typeof import('@vueuse/core')['usePointer'];
const usePointerLock: typeof import('@vueuse/core')['usePointerLock'];
const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe'];
const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme'];
const usePreferredContrast: typeof import('@vueuse/core')['usePreferredContrast'];
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark'];
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages'];
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion'];
const usePrevious: typeof import('@vueuse/core')['usePrevious'];
const useRafFn: typeof import('@vueuse/core')['useRafFn'];
const useRefHistory: typeof import('@vueuse/core')['useRefHistory'];
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver'];
Expand Down

0 comments on commit c2bd051

Please sign in to comment.