fix: 修改物模型事件回显BUG

This commit is contained in:
wangshuaiswim 2023-03-22 15:49:54 +08:00
parent e1e6bea2a7
commit 93f56a6441
1 changed files with 11 additions and 8 deletions

View File

@ -108,6 +108,9 @@ watchEffect(() => {
_value.value = props.value || { _value.value = props.value || {
expands: {} expands: {}
} }
if (props.onlyObject) {
_value.value.type = 'object'
}
}) })
watch(_value, watch(_value,
@ -116,14 +119,14 @@ watch(_value,
}, },
{ deep: true, immediate: true }) { deep: true, immediate: true })
onMounted(() => { // onMounted(() => {
if (props.onlyObject) { // if (props.onlyObject) {
_value.value = { // _value.value = props.value || {
type: 'object', // type: 'object',
expands: {} // expands: {}
} // }
} // }
}) // })
const unit = reactive({ const unit = reactive({
unitOptions: [] as DefaultOptionType[], unitOptions: [] as DefaultOptionType[],