From e90e1fb8c373a715a655bb3d9a89e46d1ab1dc68 Mon Sep 17 00:00:00 2001 From: zhl Date: Fri, 7 May 2021 11:43:12 +0800 Subject: [PATCH] fix some error and warning --- src/router/modules/shop.ts | 2 +- src/views/question/list.vue | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/router/modules/shop.ts b/src/router/modules/shop.ts index e84e4cf..65abf20 100644 --- a/src/router/modules/shop.ts +++ b/src/router/modules/shop.ts @@ -60,7 +60,7 @@ const shopRoutes: RouteConfig = { elicon: 'el-icon-arrow-right', hidden: true } - }, + } ] } diff --git a/src/views/question/list.vue b/src/views/question/list.vue index d429601..fb475c7 100644 --- a/src/views/question/list.vue +++ b/src/views/question/list.vue @@ -90,7 +90,6 @@ - = new Set() private tagOptions: string[] = [] @@ -188,13 +187,16 @@ export default class extends Vue { typeSelect: [] } + $refs!: { + filterForm: HTMLFormElement + } + created() { this.getList() this.getRemoteTags() this.getRemoteCategory() } - private async getList() { this.listLoading = true const { data } = await getQuestions(this.listQuery) @@ -235,26 +237,27 @@ export default class extends Vue { } private resetFilterForm() { - const ref =
this.$refs.filterForm - ref.resetFields() + this.$refs.filterForm.resetFields() } + private async getRemoteDeptList(name: string) { const { data } = await getShops({ key: name }) if (!data.records) return this.allDepts = data.records } + private async getRemoteTags() { - let { data } = await getAllTags() + const { data } = await getAllTags() console.log(data) this.tagSet = new Set(data) this.tagOptions = data } private async getRemoteCategory() { - let {data} = await getAllCategory() - for (let cat of data) { - let subArr = [] - for (let s of cat.children) { + const { data } = await getAllCategory() + for (const cat of data) { + const subArr = [] + for (const s of cat.children) { subArr.push({ value: s._id, label: s.name @@ -267,7 +270,6 @@ export default class extends Vue { }) } } - }