From 154d23ca563f2a1413a9ff5dac036940ca96a2e7 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Tue, 20 May 2025 11:05:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E5=90=AC=E8=B7=AF=E7=94=B1=E5=86=99?= =?UTF-8?q?=E9=94=99=E4=BD=8D=E7=BD=AE=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/records/checkin/index.vue | 12 +----------- src/views/residence/checkIn/index.vue | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/views/records/checkin/index.vue b/src/views/records/checkin/index.vue index 5e3db51..17dd187 100644 --- a/src/views/records/checkin/index.vue +++ b/src/views/records/checkin/index.vue @@ -726,17 +726,7 @@ export default { deptName(val) { this.$refs.tree.filter(val); }, - $route:{ - handler: function (newVal, oldVal) { - console.log(newVal); - if (newVal.query) { - this.queryParams.idCard = newVal.query.idCard; - this.handleQuery() - } - }, - immediate: true, - deep: true, - } + }, created() { this.getList(); diff --git a/src/views/residence/checkIn/index.vue b/src/views/residence/checkIn/index.vue index 1a6861d..7d7b093 100644 --- a/src/views/residence/checkIn/index.vue +++ b/src/views/residence/checkIn/index.vue @@ -423,6 +423,21 @@ export default { mounted() { // 挂载后执行的逻辑 }, + watch: { + // 这里可以监听数据变化 + $route:{ + handler: function (newVal, oldVal) { + if (newVal.query) { + this.$nextTick(()=>{ + this.checnInForm.idCard = newVal.query.idCard; + this.handleQuery() + }) + } + }, + immediate: true, + deep: true, + } + } };