查百度和官网好像都不是这种用法,看不懂,想请教一下大佬,谢谢
主要代码
<el-tabs v-model\="activeName" type\="border-card"\>
<el-table :data\="manyTableData" border stripe\>
<el-table-column type\="expand"\>
<template slot-scope\="scope"\>
<el-tag v-for\="(item, index) in scope.row.attr\_vals" :key\="index" closable\>{{item}}</el-tag\>
<el-input class\="input--newTag" v-if\="scope.row.inputVisible" v-model\="scope.row.inputValue" ref\="saveTagInput" size\="small" @keyup.enter.native\="handleInputConfirm(scope.row)"\></el-input\>
<el-button v-else size\="small" @click\="showInput(scope.row)"\>New Tag</el-button\>
</template\>
</el-table-column\>
<el-table-column label\="操作"\>
<template slot-scope\="scope"\>
<el-button type\="primary" size\="mini" icon\="el-icon-edit" @click\="showEditDialog(scope.row.attr\_id)"\>编辑</el-button\>
<el-button type\="primary" size\="mini" icon\="el-icon-delete" @click\="removeParams(scope.row.attr\_id)"\>删除</el-button\>
</template\>
</el-table-column\>
</el-table\>
</el-tabs\>
manyTableData是这样的对象
两个 template 作为 el-table-column 组件的默认slot ,并用到了 el-table-colum 的slot-scope, slot是el-table-column组件定义的,很合理啊