Home >Web Front-end >JS Tutorial >Detailed explanation of how to use the render function of the vue iview component table
Below I will share with you a detailed explanation of how to use the render function of the vue iview component table. It has a good reference value and I hope it will be helpful to everyone.
If you want to add attributes to the tag, such as the src attribute in img and the href attribute in a tag, you need to use
attrs to add instead of props
{ title: '操作', key: 'action', align: 'center', render: function (h, params) { return h('p', [ h('Button', { props: { type: 'primary', size: 'small' }, style: { marginRight: '8px' }, on: { click: function () { mCheck.singleShow(params.row); } } }, '查看'), h('Button', { props: { type: 'error', size: 'small' }, on: { click: function () { mCheck.singleDel(params.row, params.index); } } }, '删除') ]); } }
The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
JavaScript code to implement the upload preview function of txt files
Angular uses the operation event command ng-click Example of passing multiple parameters
Angular uses filter uppercase/lowercase to implement letter case conversion function example
The above is the detailed content of Detailed explanation of how to use the render function of the vue iview component table. For more information, please follow other related articles on the PHP Chinese website!