需求说明
iView的table组件,使用render函数,需要展示html内容。
代码实现如下
{
    title: '内容', key: "content", minWidth: 304,
    render: function (h, params) {
        return h("div", {
            // 可以带class的样式
            class: 'quill-editor-div',
            // 可以带style样式
            style: {
              // marginTop: '10px'
            },
            domProps: {
                innerHTML: params.row.content,
            }
        })
    }
}
其中innerHTML中的内容,可以是html,例如:
<div><a href="https://www.baidu.com" target="_blank">Baidu</a></div>

文章评论