Qestion:
如何给表格添加 hover 事件?
step1:
添加 domProps 选项参数
step2:
废话不多说, 直接看 demo code
- render: (h, params) => {
- let create = this.$createElement
- let dom = create('div', {
- ref: params.row.ref,
- props: {
- type: 'text',
- size: 'small'
- },
- domProps: {
- innerhtml: params.row.activeText
- },
- attrs: {
- class: 'btn'
- },
- style: {
- width: '100%',
- height: '40px',
- lineHeight: '40px',
- testAlign: 'center',
- marginRight: '5px',
- cursor: 'pointer'
- },
- on: {
- click: () => {
- this.operate(params.row)
- }
- }
- })
- return dom
- }
来源: http://www.bubuko.com/infodetail-3152842.html