首页 > 其他 > 详细

iview table render 进阶(一)

时间:2019-08-12 00:08:33      阅读:95      评论:0      收藏:0      [点我收藏+]

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 进阶(一)

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!