1.主要涉及computed屬性
這是模板內容,在input綁定一個v-model,提供參考
聲明一個計算屬性computed,將changeValue 綁定到input上,其中getValue()爲axios 請求方法。裏面接收來自input框的值
也就是我們綁定的v-model=“input”,值爲this.input。
computed: {
changeValue: function(e) {
// let value = this.input
this.getValue(this.input)
return this.input
}
提交數據,value就是我們獲取的input值(this.input)
大概就是這樣