zoukankan      html  css  js  c++  java
  • el-switch 初始值(默认值)不能正确显示状态问题

    <el-table-column align="center" label="状态">
          <template slot-scope="scope">
             <el-switch
                  @change="usertypefun(scope.row.us_id,$event)"
                   v-model="scope.row.us_state"
                   active-color="#13ce66"
                   inactive-color="#ff4949"
                   active-value= "1"
                   inactive-value= "0">
            </el-switch>
        </template>
    </el-table-column>
    说明:当用如上的【active-value="1" inactive-value="0"】,此时的【active-value】值类型为string,如果要求【active-value】值类型为number时,必须在其前面加上    : 
    <el-table-column align="center" label="状态">
          <template slot-scope="scope">
             <el-switch
                  @change="usertypefun(scope.row.us_id,$event)"
                   v-model="scope.row.us_state"
                   active-color="#13ce66"
                   inactive-color="#ff4949"
                   :active-value= "1"
                   :inactive-value= "0">
            </el-switch>
        </template>
    </el-table-column>
     
  • 相关阅读:
    supervise 用来监控服务,自动启动
    tee -a /var/log/jd.log
    类的构造函数与析构函数的调用顺序
    c++之带默认形参值的函数
    zoj1001-A + B Problem
    zoj1037-Gridland
    cf499A-Watching a movie
    cf478B-Random Teams 【排列组合】
    C++版修真小说
    Python_12-线程编程
  • 原文地址:https://www.cnblogs.com/xuxiaoyu/p/13202339.html
Copyright © 2011-2022 走看看