iview table render 進階(一)

Qestion: dom

如何給表格添加hover 事件?this

step1: spa

添加 domProps 選項參數code

step2: blog

廢話很少說,直接看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
                    }
相關文章
相關標籤/搜索