1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-23 20:02:32 +08:00

fix bindProp for boolean

This commit is contained in:
Kevin Levron 2021-04-30 18:36:22 +02:00
parent 35eecace74
commit ddcca59d9c

View File

@ -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 (ref.value) dst[_dstProp] = src[srcProp] if (typeof ref.value === 'boolean' || ref.value) dst[_dstProp] = src[srcProp]
watch(ref, (value) => { dst[_dstProp] = value }) watch(ref, (value) => { dst[_dstProp] = value })
} }
} }