iview table render 进阶(一)

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: {
                                 '100%',
                                height: '40px',
                                lineHeight: '40px',
                                testAlign: 'center',
                                marginRight: '5px',
                                cursor: 'pointer'
                            },
                            on: {
                                click: () => {
                                    this.operate(params.row)
                                }
                            }
                        })
                        return dom
                    }
原文地址:https://www.cnblogs.com/sweet-ice/p/11337307.html