From 6b152f68b7ba850b4c93f860b4aaa10f2a1db4ac Mon Sep 17 00:00:00 2001 From: yuping <82253452@qq.com> Date: Fri, 2 Dec 2022 17:42:33 +0800 Subject: [PATCH] =?UTF-8?q?--=20=E9=A1=B9=E7=9B=AE=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/project/OrgClass.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/project/OrgClass.vue b/src/components/project/OrgClass.vue index d0a197c9..e08c2b9b 100644 --- a/src/components/project/OrgClass.vue +++ b/src/components/project/OrgClass.vue @@ -46,9 +46,15 @@ export default { watch(state.id, () => { ctx.emit('update:modelValue', state.id) }) - onMounted(() => { - state.options = [{id: props.modelValue, name: props.name}, ...store.state.orgtreeList] + watch(props, () => { + if (props.modelValue !== state.id) { + state.id = props.modelValue + } }) + onMounted(() => { + state.options = [...store.state.orgtreeList] + }) + function change(key, obj) { ctx.emit('update:name', obj[0]) }