码迷,mamicode.com
首页 > 其他好文 > 详细

iview table render 进阶(一)

时间:2019-08-12 01:19:05      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:ext   text   strong   div   create   表格   col   inter   demo   

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
                    }

 

iview table render 进阶(一)

标签:ext   text   strong   div   create   表格   col   inter   demo   

原文地址:https://www.cnblogs.com/sweet-ice/p/11337307.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!