elementUI禁用radio

Posted on 2019-10-05 00:08  猫头唔食鱼  阅读(7602)  评论(0编辑  收藏  举报
禁用el-radio,用disabled即可,
如果是循环的选项,那么需要绑定disabled属性
例子:
 <template>
 <div>
<el-radio-group v-model="radio" @change="getValue()">
  <!-- 禁用el-radio,用disabled即可,如果是循环的选项,那么需要绑定disabled属性 -->
  <el-radio v-for="(item,i) in items" :key="i" :label="item.id" :disabled="item.disabled">{{item.content}}</el-radio>
</el-radio-group>
 </div>
 </template>
 <script>
 export default {
   name: "HelloWorld",
   data () {
     return {
       radio:1,
       items:[
         {id:0,disabled:true,content:"选项一"},
         {id:1,disabled:false,content:"选项二"},
       ]
     };
   },
   methods: {
     getValue(){

     }
   },
 }
 </script>
 <style lang="css" scoped>
 </style>