zoukankan      html  css  js  c++  java
  • elementUI多选框的其他样式

    1.按钮样式

    使用el-checkbox-group标签即可

    2.带边框的多选框

    在每个el-checkbox添加属性border即可

    3.定义多选框的大小

    在el-checkbox-group定义属性size,属性值可以选,medium,small,mini

    4.text-color 被选中时按钮文字的颜色,用在el-checkbox-group标签里

    5.fill 被选中时,按钮背景颜色,用在el-checkbox-group标签里

    例子:

    <template>
    <div>
    <el-checkbox-group v-model="test" @change="getValue()" size="mini" text-color="red" fill="green">
       <el-checkbox-button v-for="(item,i) in items" :label="item.content" :key="i" :disabled="item.disabled" :checked="item.checked" ></el-checkbox-button>
    </el-checkbox-group>
    </div>
    </template>
    <script>
    export default {
      name: "HelloWorld",
      data () {
        return {
          test:[],
          items:[
            {id:0,content:"选项一",disabled:false,checked:true},
            {id:1,content:"选项二",disabled:false,checked:true},
            {id:2,content:"选项三",disabled:true,checked:false},
          ]
        };
      },
      methods: {
        getValue(){
          console.log(this.test)
        }
      },
    }
    </script>
    <style lang="css" scoped>
    </style>
  • 相关阅读:
    javascript学习7
    javascript学习6
    javascript学习5
    javascript学习4
    javascript学习3
    javascript学习2
    兼容性
    工作中总结的经验之git篇
    git解决内容冲突
    Gulp压缩JavaScript代码
  • 原文地址:https://www.cnblogs.com/luguankun/p/11626095.html
Copyright © 2011-2022 走看看