美文网首页
VUE 插槽的使用

VUE 插槽的使用

作者: 一个健康马 | 来源:发表于2023-01-11 13:46 被阅读0次

    插槽传参

    模板组件

    //name 插槽名称,:参数名=‘参数值’进行传参
     <slot name='footer' :$index='123' :row='3'>
     </slot>
    

    接收参数

    //v-slot:参数名=‘参数名’
     <template  v-slot:footer='scope'>
              <el-button size="mini" type="text"  @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
            </template> 
    
    

    相关文章

      网友评论

          本文标题:VUE 插槽的使用

          本文链接:https://www.haomeiwen.com/subject/xuibcdtx.html