Element-UI单选框(el-radio-group)点击事情的问题

结合el-radio-group元素和子元素el-radio可以实现单选组:

template部分:


    

script部分:

export default {
  data() {
    return {
      tabPosition: '英语',
      tabs: []
    };
  },
  created() {
    this.getTabs();
  },
  methods: {
    getTabs() {
      this.$http.getData('/categories').then(val => {
        this.tabs = val.data;
      })
    }
 }
 

发现,点击按钮没有效果。查阅文档发现radio-group点击事情使用的是change,而我之前惯性使用了click。

clipboard.png

此外,如果你绑定的属性为value,而不是v-model,此时,你应该使用@input:

Element-UI单选框(el-radio-group)点击事情的问题_第1张图片

你可能感兴趣的:(Element-UI单选框(el-radio-group)点击事情的问题)