Home >Web Front-end >JS Tutorial >Detailed explanation of how to use the render function of the vue iview component table

Detailed explanation of how to use the render function of the vue iview component table

亚连
亚连Original
2018-05-30 10:53:035113browse

Below I will share with you a detailed explanation of how to use the render function of the vue iview component table. It has a good reference value and I hope it will be helpful to everyone.

If you want to add attributes to the tag, such as the src attribute in img and the href attribute in a tag, you need to use

attrs to add instead of props

{
 title: '操作',
 key: 'action',
 align: 'center',
 render: function (h, params) {
 return h('p', [
  h('Button', {
  props: {
   type: 'primary',
   size: 'small'
  },
  style: {
   marginRight: '8px'
  },
  on: {
   click: function () {
   mCheck.singleShow(params.row);
   }
  }
  }, '查看'),
  h('Button', {
  props: {
   type: 'error',
   size: 'small'
  },
  on: {
   click: function () {
   mCheck.singleDel(params.row, params.index);
   }
  }
  }, '删除')
 ]);
 }
}

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

JavaScript code to implement the upload preview function of txt files

Angular uses the operation event command ng-click Example of passing multiple parameters

Angular uses filter uppercase/lowercase to implement letter case conversion function example

The above is the detailed content of Detailed explanation of how to use the render function of the vue iview component table. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn