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数据,便于使用


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。