美文网首页Vue驿站Vue.js
element Cascader数据回显问题

element Cascader数据回显问题

作者: zhudying | 来源:发表于2020-06-28 09:10 被阅读0次

element 中 cascader 组件可以直接显示 省 市 县,三级联动,但是在数据回显时,通常不会给你符合他的数据格式,而是返回三个字段,这就需要我们手动拼接:

// 如果这样,通常数据可以回显,但是视图没有回显出来
this.cxaddressarr.push(this.form.outDangerProvince)
this.cxaddressarr.push(this.form.outDangerCity)
this.cxaddressarr.push(this.form.outDangerArea)
// 改为
this.cxaddressarr = [
  this.form.outDangerProvince,
  this.form.outDangerCity,
  this.form.outDangerArea
]
// 就可以了

相关文章

网友评论

    本文标题:element Cascader数据回显问题

    本文链接:https://www.haomeiwen.com/subject/qnevahtx.html