博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
iview,用render函数渲染
阅读量:4549 次
发布时间:2019-06-08

本文共 5923 字,大约阅读时间需要 19 分钟。

discountData: { total: 1, rows: [ { randomDiscountRangeMax: '', randomDiscountRangeMin: '', population: '' }, ], defaultRows: { randomDiscountRangeMax: '', randomDiscountRangeMin: '', population: '' }, } discountColumns: [ { key: 'randomDiscountRange', align: 'center', title: '随机立减范围', render: (h, params) => { var me = this return h('div', [h('Input', { props: { type: 'text', value: me.discountData.rows[params.index].randomDiscountRangeMin, disabled: this.getIsDetail(), }, style: { width: '100px' }, on: { 'on-blur': (event) => { me.discountData.rows[params.index].randomDiscountRangeMin = event.target.value } } }), h('span', '元<=随机立减金额<'), h('Input', { props: { type: 'text', value: me.discountData.rows[params.index].randomDiscountRangeMax, disabled: this.getIsDetail(), }, style: { width: '100px' }, on: { 'on-blur': (event) => { this.discountData.rows[params.index].randomDiscountRangeMax = event.target.value } } }), h('span', '元')]) } }, { key: 'population', align: 'center', title: '概率', width: 300, render: (h, params) => { var me = this return h('div', [h('Input', { props: { type: 'text', value: me.discountData.rows[params.index].population, disabled: this.getIsDetail(), }, style: { width: '100px' }, on: { 'on-blur': (event) => { this.discountData.rows[params.index].population = event.target.value } } }), h('span', '%')]) } }, { key: 'operation', align: 'center', title: '操作', width: 200, render: (h, params) => { return h('div', [ h('Button', { props: { type: 'primary', shape: 'circle', icon: 'plus', disabled: this.getIsDetail(), }, style: { display: params.index !== 0 ? 'none' : 'inline' }, on: { click: () => { this.add('discountData') } } }), h('Button', { props: { type: 'primary', shape: 'circle', icon: 'minus', disabled: this.getIsDetail(), }, style: { display: params.index === 0 ? 'none' : 'inline' }, on: { click: () => { this.remove(params.index, 'discountData') } } }) ]) } } ] add (dataName) { var obj = JSON.parse(JSON.stringify(this[dataName].defaultRows)) this[dataName].rows.push(obj) } remove (index, value) { this[value].rows.splice(index, 1) }

 

 

转载于:https://www.cnblogs.com/itrena/p/8830951.html

你可能感兴趣的文章
lua_VC6环境
查看>>
kubernetes集群搭建
查看>>
如何在eclipse中配置反编译工具JadClipse
查看>>
数据仓库和ODS 的并行
查看>>
tokenizer
查看>>
第三讲 动手动脑-1
查看>>
OpenCV中feature2D——BFMatcher和FlannBasedMatcher
查看>>
MOBILE GPU FLOATING POINT ACCURACY VARIANCES
查看>>
使用为知笔记写笔记,再发布到博客园
查看>>
GCD使用
查看>>
PostgreSQL在Update时使用Substring函数截取字符串并且加上CASE WHEN THEN条件判断
查看>>
appium 后台运行shell脚本
查看>>
User-Agent大全
查看>>
Label控件属性AssociatedControlID
查看>>
in on at 总结
查看>>
MATLAB 大数据剔除坏值
查看>>
Oracle Instant Client
查看>>
Asp.Net MVC4网站中自定义AuthorizeAttribute
查看>>
多文件上传
查看>>
POJ 1006 Biorhythnms(中国剩余定理)
查看>>