fix: 数据回显

This commit is contained in:
2023-08-16 11:15:21 +08:00
parent 9719fa1f4b
commit 450e12844c

View File

@ -2,7 +2,7 @@
* @Author: zhaojinfeng 121016171@qq.com * @Author: zhaojinfeng 121016171@qq.com
* @Date: 2023-08-14 11:07:15 * @Date: 2023-08-14 11:07:15
* @LastEditors: zhaojinfeng 121016171@qq.com * @LastEditors: zhaojinfeng 121016171@qq.com
* @LastEditTime: 2023-08-14 21:49:26 * @LastEditTime: 2023-08-16 11:11:30
* @FilePath: \vue3\packages\select-transfer-modal\index.vue * @FilePath: \vue3\packages\select-transfer-modal\index.vue
* @Description: * @Description:
* *
@ -102,7 +102,7 @@ const properties = withDefaults(
title: '选择', title: '选择',
width: '70%', width: '70%',
zIndex: 2023, zIndex: 2023,
formattter(row: Record<string, any>) { formattter: (row: Record<string, any>) => {
return { ...row } return { ...row }
}, },
}, },
@ -202,13 +202,14 @@ function transferValueInit() {
transferValue = value.map((e) => { transferValue = value.map((e) => {
temp[e[properties.props.key]] = e temp[e[properties.props.key]] = e
return e[properties.props.key] return e[properties.props.key]
}) })
} }
watch(() => properties.value, () => { transferValueInit()
transferValueInit()
}) watch(() => properties.value, transferValueInit)
watch(() => properties.show, (show) => { watch(() => properties.show, (show) => {
showDialog.value = show showDialog.value = show
}) })