elementUI禁用radio


禁用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>

 


免責聲明!

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



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