使用iview中的table表格时避免不了使用render函数渲染自定义内容,或者渲染组件。可是在正常使用时出现了props传值没法识别,iview
按照官网介绍使用props以下:dom
render: (h, params) => { return h('div', [ h('Input', { props: { value: params.row.maxCommissionAmount, type: 'number', min:'0' }, style: { width: '100%', height: '25px', border: '1px solid #dcdee2', borderRadius: '4px', textAlign: 'center', outline: 'none', }, }) ]) }
直接使用props赋值没法识别函数
要将props转写成domProps,这样就能够正常传值啦code
render: (h, params) => { return h('div', [ h('Input', { domProps: { value: params.row.maxCommissionAmount, type: 'number', min:'0' }, style: { width: '100%', height: '25px', border: '1px solid #dcdee2', borderRadius: '4px', textAlign: 'center', outline: 'none', }, }) ]) }