• slot-scope


    <el-table>
      <el-table-column label="测试" >
         <template slot-scope="scope" prop="testType">
          //prop可以接收接口的参数,例如这个testType是后端传给你的用来选择状态的参数,就可以这样用
            <span v-if="scope.row.testType==0" >会议进行中</span>
            <span v-if="scope.row.testType==1" >会议准备中</span>
            <span v-if="scope.row.testType==2" >会议结束</span>
         </template>
      </el-table-column>
    </el-table>
    <el-table-column label="弹出框">
      <template slot-scope="scope">
         <el-button @click="testBtn(scope.row)">查看弹框</el-button>
    这个scope.row是当前表格一行的所有数据,例如 scope.row.id就可以拿到后端传过来的id,然后把这个id传给后端,用来操作这一行(例如各种点击事件)
      </template>
    </el-table-column>
    
    export default{
      data(){},
    methods:{
      testBtn(item){
      let val = {
        id= item.id
      这个id,就是后端所需要你传的参数,从上面的点击事件中传过来
      }
      }
    }
  • 相关阅读:
    夜空中最亮的星
    让我留在你身边
    反思
    又想起民谣那诗
    初学积性函数
    P1049 装箱问题(01背包)
    set
    紫书 习题 10-4 UVa 1644(素数筛)
    紫书 习题 10-2 UVa 808(建立坐标+找规律)
    紫书 习题 10-1UVa 111040(找规律)
  • 原文地址:https://www.cnblogs.com/ll15888/p/11305256.html
Copyright © 2020-2023  润新知