JakHuang / form-generator

:sparkles:Element UI表单设计及代码生成器
https://jakhuang.github.io/form-generator
MIT License
8.91k stars 2.16k forks source link

__methods__ 里按钮事件请求接口数据 回显到页面 数据回显不了 #157

Closed linyuanjie closed 2 years ago

linyuanjie commented 2 years ago

element.formConf.methods = { clickcity() { gtearea({ name: this.formData.city }).then((c) => { if (c.code === 0) { this.formConf.fields.forEach((row) => { if (row.vModel == 'area') { row.slot = { options: c['rows'].map((v) => { return { label: v.name, value: v.value } }), } } }) } }) }, }