search

Home  >  Q&A  >  body text

javascript - How to use v-model to display an array in vue radio button

As shown in the picture, I want to push a value after selecting it. How should I do it? Thank you

黄舟黄舟2824 days ago558

reply all(1)I'll reply

  • 滿天的星座

    滿天的星座2017-05-19 10:31:59

    js

    new Vue({
            el: "#app",
            data: {
                myCheck: '',
                //用来存放每一次点击的value
                arr: []
            },
            watch: {
                myCheck: function () {
                    this.arr.push(this.myCheck)
                }
            }
        })

    What does this mean? ? Every time you click, the value after the click is saved

    reply
    0
  • Cancelreply