0
私はこれまでのコードを持っています。私はラジオボタンから値を取ろうとします。私はvモデル値から取ることができますが、ラジオではいくつかの問題があります。例えば、ラジオボタンがあれば、 。ここvuejsでラジオの値をチェックするにはどうすればよいですか?
new Vue({
el:'#root',
data:{
removelines: [
{value:'a'},
{value:'b'}
]
},
methods:{
insert:function(){
let vueIn = this;
axios.post('/vue', {removelines: vueIn.removelines.value}).then(
function(response){
vueIn.removelines = response.data.removelines.value;
}
).catch(function(error){ console.log(error.message); });
}
}
});
htmlコード:
<div class="card-block">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-warning active">
<input v-model="removelines" name="removelines" type="radio" class ="cheker" autocomplete="off" v-bind:value="a" checked>
Yes
</label>
<label class="btn btn-warning">
<input v-model="removelines" name="removelines" type="radio" class ="cheker" v-bind:value="b">
No
</label>
</div>
</div>
私はあなたがaxiosポストを更新することができ、それが働いている参照してください? –
@AdrianKlarkどのメソッドが使用されているのか、使用しているエンドポイントがわからないので、 'insert'メソッドとあなたの質問との関係を見つけることができません。質問の説明を更新してください。 – choasia
ありがとう私はそれを変更する継ぎ目のブートストラップjsは他のjsと競合している –