Blogger Information
Blog 47
fans 0
comment 2
visits 102679
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
uniapp中单选按钮的实现
拾一枝樱花的博客
Original
8755 people have browsed it
  1. <template>
  2. <view>
  3. <radio-group @change="chan">
  4. <label v-for="item in radioGroup" :key="item">
  5. <radio :value="item" :checked="item==activeRadio" />{{item}}
  6. </label>
  7. </radio-group>
  8. </view>
  9. </template>
  10. <script>
  11. export default{
  12. data(){
  13. return{
  14. activeRadio:'', //存的是选中的value值
  15. radioGroup:['苹果','香蕉','梨','西红柿','西瓜']
  16. }
  17. },
  18. methods:{
  19. chan(e){
  20. this.activeRadio = e.detail.value;
  21. console.log(this.activeRadio);
  22. }
  23. }
  24. }

</script>

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post