Ant Design语法

1、父子组件传值

// 父组件存值
store.dispatch("SetAllAddFormData", {test: test}

// 子组件取值
const { basicInfo } = store.getters.addFormData
// 定义
state: {
    // 表单数据
    addFormData: {test: {}},
},
mutations: {
    SetAllAddFormData: ({ commit }, data) => {
      return new Promise((resolve) => {
        for (let key in data) {
          commit("SET_FORM_DATA", { key, data: data[key] });
        }
        resolve();
      });
    },
}
作者:何贤刚  创建时间:2024-04-24 17:21
最后编辑:何贤刚  更新时间:2024-04-24 17:26