kailong321200875 / vue-element-plus-admin

A backend management system based on vue3, typescript, element-plus, and vite
https://element-plus-admin.cn/
MIT License
2.81k stars 682 forks source link

表单项组件之间无法通过数据联动 #533

Closed wheakerd closed 2 months ago

wheakerd commented 2 months ago

表单项的数据收集和渲染是分开的

wheakerd commented 2 months ago

optionApi 加载无法通过监听其他组件的数据变化,实时加载新的数据

wheakerd commented 2 months ago

解决方案:

在 Form 组件中监听 findModel 数据变动,注册事件传递至上层组件

watch(
            () => formModel.value,
            (newModel) => {
                emit('update', newModel);
            },
            {
                deep: true,
            },
);