vue + iview的render添加ref属性

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
                    }
Logo

前往低代码交流专区

更多推荐