zoukankan      html  css  js  c++  java
  • el-table多选框,只选一个的方法

    <el-table
          ref="table"
          v-loading="listLoading"
          :data="tableData"
          border
          :row-key="getRow"
          stripe
          :height="tableHeight"
          :header-cell-style="{'background':'#F5F4F7'}"
          @selection-change="handleCurrentChange"
        >
          <el-table-column
            type="selection"
            width="50"
            align="center"
            fixed="left"
            :resizable="false"
          />
          <el-table-column
            type="index"
            label="序号"
            width="60"
            fixed="left"
            :index="indexMethod"
            align="center"
          />
          <el-table-column
            prop="strdate"
            label="单据日期"
            min-width="160"
          />
    </el-table>
    methods: {
        handleCurrentChange(val) {
          this.currentRow = val
          this.tableData.forEach(item => {
            if (val[val.length - 1] === item) {
              this.$refs.table.toggleRowSelection(item, true)
            } else {
              this.$refs.table.toggleRowSelection(item, false)
            }
          })
        },
    }
  • 相关阅读:
    HTML5结构
    HTML5新增的非主体元素header元素、footer元素、hgroup元素、adress元素
    CF GYM 100703G Game of numbers
    CF GYM 100703I Endeavor for perfection
    CF GYM 100703K Word order
    CF GYM 100703L Many questions
    CF GYM 100703M It's complicate
    HDU 5313 Bipartite Graph
    CF 560e Gerald and Giant Chess
    POJ 2479 Maximum sum
  • 原文地址:https://www.cnblogs.com/hellofangfang/p/15018927.html
Copyright © 2011-2022 走看看