diff --git a/package.json b/package.json index 50050c3a..2b265fab 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,8 @@ "eslintConfig": { "root": true, "env": { - "node": true + "node": true, + "vue/setup-compiler-macros": true }, "extends": [ "plugin:vue/vue3-essential", diff --git a/src/api/request.js b/src/api/request.js index 707aba9f..54e2361d 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -121,11 +121,17 @@ export function usePage(_url, params, init = true) { }) if (isRef(params)) { - watch(params, () => { + watch(params.value, () => { fetch() }) } + if (isRef(_url)) { + watchEffect(fetch) + } else { + init && fetch() + } + function reset(){ state.data = [] state.loading = false @@ -142,12 +148,6 @@ export function usePage(_url, params, init = true) { }) } - if (isRef(_url)) { - watchEffect(fetch) - } else { - init && fetch() - } - return { ...toRefs(state), fetch, diff --git a/src/components/student/OwnerTableModelStudent.vue b/src/components/student/OwnerTableModelStudent.vue index ae453810..8b02aa74 100644 --- a/src/components/student/OwnerTableModelStudent.vue +++ b/src/components/student/OwnerTableModelStudent.vue @@ -29,7 +29,7 @@ import { defineProps, ref } from "vue"; import TableModelStudent from "@/components/student/TableModelStudent"; import CommonStudent from "@/components/student/CommonStudent"; -const props = defineProps({ +defineProps({ id: String, type: Number, types: { @@ -37,7 +37,6 @@ const props = defineProps({ default: () => [], }, }); -console.log("props", props.types); const tableModelRef = ref(); function submitCall(flag) { diff --git a/src/components/student/TableModelStudent.vue b/src/components/student/TableModelStudent.vue index e47a8e46..0310229e 100644 --- a/src/components/student/TableModelStudent.vue +++ b/src/components/student/TableModelStudent.vue @@ -1,61 +1,51 @@