VUE element table组件

最近在高一个ERP 有一个问题 销售的时候 需要批量支付,用的Table组件来。


如图,每一个input表格利用 v-model进行数据绑定的时候 会出现 相同的问题
接下来就是解决的办法
首先在created里面

 for (let i = 0; i < this.data.length; i++) {
    this.data[i].marketweight = ''//这个都是需要添加的字段
    this.data[i].marketprice = ''
    this.data[i].purchaser = ''
    this.data[i].remark = ''
    this.data[i].radios = '1'
}
<el-table-column  label="销售重量" show-overflow-tooltip>
    <template slot-scope="scope">
        <el-input v-model="scope.row.marketweight" type="number" ></el-input>
    </template>
</el-table-column>

利用组件中的 solot 插槽 scope.row.marketprice这个就可以吧这个问题解决了!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容