Vue - slot-scope="scope" 的意义

     <template slot-scope="scope">
                    <el-button type="primary" size="small" @click="$router.push(`/categories/edit/${scope.row._id}`)">编辑</el-button>    <!-- $router.push()  跳转页面 -->
                    <el-button type="primary" size="small" @click="remove(scope.row._id)">删除</el-button> 
                </template>
 
 slot-scope="scope" 来取得作用域插槽:data绑定的数据,scope可以随便替换其他名称,只是定义对象来代表取得的data数据,便于使用
posted @ 2019-09-27 13:08  武卡卡  阅读(46445)  评论(6编辑  收藏  举报