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]) }