iview Table列表中增加字体图标
一:
{ 'title': this.$t('设备别名'), 'key': 'actStatus', render: (h, params) => { return h('div', [ h('Icon', { props: { type: 'ios-create-outline' }, style: { color: '#4071FF' }, on: { click: () => { console.log('23') } } }), h('span', params.row.actStatus) ]) } },
二: 通过伪元素
{ 'title': this.$t('设备别名'), 'key': 'actStatus', render: (h, params) => { return h('span', { class: 'otherName', on: { click: () => { console.log('点击') } } }, params.row.actStatus) } },
.otherName { position: relative; } /deep/.otherName::after { content: '\F1A2'; font-family: Ionicons; font-size: 16px; width: 0; height: 0; position: absolute; color: #2D8CF0; }