iview-admin icon indicating copy to clipboard operation
iview-admin copied to clipboard

iview-admin"封装过的Tables组件"中的自定义模块能用不用render,直接使用template来使用组件吗?

Open fxllon opened this issue 6 years ago • 1 comments

fxllon avatar May 16 '19 06:05 fxllon

修改tables.vue文件,增加以下代码(刚学vue不久,如有问题 请多指教),

image image 然后在页面上可以正常使用了,如: image image

代码:

<template slot-scope="{ row, index }" :slot="column.slot" v-for="column in soltColumns">
        <slot :name="column.slot" :row="row" :index="index"></slot>
      </template>


computed: {
      soltColumns: function() {
        return this.columns.filter(column => column.slot);
      }
    }

wtf-boy avatar Aug 27 '19 02:08 wtf-boy