PM是山山啊 2022-07-16 22:46 采纳率: 0%
浏览 42

关于#vue.js#的问题:想要拿到一行的数据

想要拿到一行的数据
问题相关代码,请勿粘贴截图
'scope' is defined but never used
我的解答思路和尝试过的方法
vue项目正常运行
      <!-- 用户列表区域 -->
      <el-table :data="userlist" border stripe>
        <el-table-column type="index"></el-table-column>
        <el-table-column label="姓名" prop="username"></el-table-column>
        <el-table-column label="邮箱" prop="email"></el-table-column>
        <el-table-column label="电话" prop="mobile"></el-table-column>
        <el-table-column label="角色" prop="role_name"></el-table-column>
        <el-table-column label="状态">
          <template slot-scope="scope">
            <el-switch v-model="scope.row.mg_state" @change="userStateChanged(scope.row)">
            </el-switch>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="180px">
          <template slot-scope="scope">
            <!-- 修改按钮 -->
            <el-button type="primary" icon="el-icon-edit" size="mini"></el-button>
            <!-- 删除按钮 -->
            <el-button type="danger" icon="el-icon-delete" size="mini"></el-button>
            <!-- 分配角色按钮 -->
            <el-tooltip effect="dark" content="分配角色" placement="top" :enterable="false">
              <el-button type="warning" icon="el-icon-setting" size="mini"></el-button>
            </el-tooltip>
          </template>
        </el-table-column>
      </el-table>

  • 写回答

4条回答 默认 最新

  • 前端不释卷leo 前端领域新星创作者 2022-07-16 23:31
    关注

    你的作用域插槽,按钮显示那里,不需要scope的话就去掉,只写slot-scope

    评论 编辑记录

报告相同问题?

问题事件

  • 创建了问题 7月16日

悬赏问题

  • ¥15 网站设计与开发职业技能大赛试题
  • ¥20 在使用CESM2.2.0模型进行case.submit过程中出现如下错误(关键词-Map)
  • ¥15 有办法改变通过wifi进入的网站的设置吗
  • ¥15 所以到底怎么算!算到凌晨五点都算不出来!
  • ¥15 label_studio
  • ¥15 请教如何phython发邮件
  • ¥15 linux系统安装问题
  • ¥15 路径规划如何采用矢量法让他们尽量在一个方向
  • ¥15 crypto 一道rsa解密题
  • ¥15 survIDINRI已将生存时间转为数值变量,仍错误 Time variable is not numeric。