Vuejs2 基于数组的无线电输入列表存在问题
在我的Laravel 2.6/应用程序中,我需要显示基于阵列的无线电输入列表:Vuejs2 基于数组的无线电输入列表存在问题,vuejs2,radio,Vuejs2,Radio,在我的Laravel 2.6/应用程序中,我需要显示基于阵列的无线电输入列表: customerAccountTypeValueArray::[ { "key": "I", "label": "Individual" }, { "key": "B", "label": "Business" } ] 我是这样做的: <div class="custom-control custom-radio m-3" v-for="nextCustomerAccountTypeValue, index
customerAccountTypeValueArray::[ { "key": "I", "label": "Individual" }, { "key": "B", "label": "Business" } ]
我是这样做的:
<div class="custom-control custom-radio m-3" v-for="nextCustomerAccountTypeValue, index in customerAccountTypeValueArray"
:key="nextCustomerAccountTypeValue.key">
<input
:id="'customer_account_type_' + nextCustomerAccountTypeValue.key"
type="radio"
name="radio_account_type"
class="custom-control-input"
v-model="customerRow.account_type"
:value="customerRow.account_type"
>
<label class="custom-control-label" :for="'customer_account_type_' + nextCustomerAccountTypeValue.key">{{ nextCustomerAccountTypeValue.label}}</label>
...
where customerRow is defined as :
customerRow: {
account_type: '',
...
{{nextCustomerAccountTypeValue.label}
...
其中customerRow定义为:
customerRow:{
帐户类型:“”,
...
因此,我看到了我的无线电输入,但选择任何无线电输入customerRow.account\u类型值都不会更改
如何修复它?更换
:value="customerRow.account_type"
与
它应该能工作。替换
:value="customerRow.account_type"
与
它应该会起作用