Vue el-radio listens to the instance of the selected change

  1. //change is the event of the radio-group tag
  2. <div>
  3. <el-radio-group v-model="radioSex" @change="changeHandler">
  4. <el-radio class="radio" label="man">男</el-radio>
  5. <el-radio class="radio" label="woman">女</el-radio>
  6. </el-radio-group>
  7. </div>
  8. export default {
  9. name: 'Radio',
  10. data () {
  11. return {
  12. radioSex: 'man'
  13. }
  14. },
  15. methods: {
  16. changeHandler(value) {
  17. console.log('The changed value is:' + value)
  18. }
  19. }
  20. }

おすすめ

転載: blog.csdn.net/weixin_43167662/article/details/130055459