From c3337f21cebf86eae18b1ad9186e3d03b98840c4 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 28 Feb 2024 00:07:25 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=B8=BB=E5=AD=90=E8=A1=A8=20props?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../codegen/vue3/views/components/list_sub_erp.vue.vm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm index 71a7511be..3f0710e01 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm @@ -94,7 +94,7 @@ const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 const props = defineProps<{ - ${subJoinColumn.javaField}: undefined // ${subJoinColumn.columnComment}(主表的关联字段) + ${subJoinColumn.javaField}?: number // ${subJoinColumn.columnComment}(主表的关联字段) }>() const loading = ref(false) // 列表的加载中 const list = ref([]) // 列表的数据 @@ -103,17 +103,20 @@ const total = ref(0) // 列表的总页数 const queryParams = reactive({ pageNo: 1, pageSize: 10, - ${subJoinColumn.javaField}: undefined + ${subJoinColumn.javaField}: undefined as unknown }) /** 监听主表的关联字段的变化,加载对应的子表数据 */ watch( () => props.${subJoinColumn.javaField}, - (val) => { + (val: number) => { + if (!val) { + return + } queryParams.${subJoinColumn.javaField} = val handleQuery() }, - { immediate: false } + { immediate: true, deep: true } ) #end