mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
better fix for bindProp
This commit is contained in:
parent
559e8f2cc7
commit
8801b9bac5
@ -21,7 +21,7 @@ export function bindProp(src: any, srcProp: string, dst: any, dstProp?: string):
|
|||||||
setFromProp(dst[_dstProp], ref.value)
|
setFromProp(dst[_dstProp], ref.value)
|
||||||
watch(ref, (value) => { setFromProp(dst[_dstProp], value) }, { deep: true })
|
watch(ref, (value) => { setFromProp(dst[_dstProp], value) }, { deep: true })
|
||||||
} else {
|
} else {
|
||||||
if (typeof ref.value === 'boolean' || ref.value) dst[_dstProp] = src[srcProp]
|
if (ref.value !== undefined) dst[_dstProp] = src[srcProp]
|
||||||
watch(ref, (value) => { dst[_dstProp] = value })
|
watch(ref, (value) => { dst[_dstProp] = value })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user