element Switch開關 添加提示效果


 <el-table-column label="是否通過" align="center">
        <template slot-scope="scope">
          <el-switch
            v-model="scope.row.isFinish"
            disabled
            @click.native="setSwitch(scope.row)"
          />
        </template>
      </el-table-column>
setSwitch(row) {
      if (row.isFinish) {
        this.$message({
          showClose: true,
          message: '暫時不可操作,如需修改請重新發起計划',
          type: 'warning'
        })
        return
      }
      var _this = this
      const text = row.isFinish ? '關閉' : '啟用'
      this.$confirm('確定本次計划通過嗎?通過以后操作不可逆', '系統提示', {
        confirmButtonText: '確定',
        cancelButtonText: '取消',
        type: 'warning',
        callback: function(action, instance) {
          if (action === 'confirm') {
            _this.$emit('switchChange', row)
          } else {
            _this.$emit('switchChange', '')
          }
        }
      })
    }

 

 效果

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM