zoukankan      html  css  js  c++  java
  • 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,就是后端所需要你传的参数,从上面的点击事件中传过来
      }
      }
    }
  • 相关阅读:
    使用基本的socket函数
    ODBC、ADO
    MFC开发ActiveX控件的简介
    MFC线程
    系统API函数实现多线程及线程同步
    IP地址控件
    加速键
    属性页对话框
    Tab控件
    树控件
  • 原文地址:https://www.cnblogs.com/ll15888/p/11305256.html
Copyright © 2011-2022 走看看