[关闭]
@Wangww0925 2020-04-16T08:18:13.000000Z 字数 431 阅读 186

vue中使用render

vue-cli


params 数据

直接输出(单个标签)

  1. render: (h, params) => {
  2. return h('div', '直接输出')
  3. }

直接输出(多个标签)

  1. render: (h, params) => {
  2. return h('div', [
  3. h('p', '标题'),
  4. h('p', '内容内容'),
  5. ])
  6. }

设置样式

  1. render: (h, params) => {
  2. return h('div', [
  3. h('p', {
  4. style: { color: '#00A436', fontSize: '16px' }
  5. }, params.row.status),
  6. ])
  7. }

设置元素属性 class等

  1. render: (h, params) => {
  2. return h('div', [
  3. h('img', {
  4. attrs: { src: '1.png', width: '16', height: '16', class: 'va-4 mr5' },
  5. }),
  6. ])
  7. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注