如何根据 b-form-select 中的 selected 值 disable/enable 文本字段?
How to disable/enable text field according to a selected value in b-form-select?
我正在尝试 enable/disable 根据输入的值 select 输入文本字段
b-形式-select
如果有人能帮助我,我将不胜感激。
new Vue({
el: "#app",
data: {
selected: 0,
options: [
{ value: 0, text: 'Enabled' },
{ value: 1, text: 'Disabled' }
]
}
});
<div id="app" class="m-5">
<b-form-select v-model="selected" :options="options"></b-form-select>
<b-form-input type="text" :disabled="selected === 1" class="mt-3"></b-form-input>
</div>
我正在尝试 enable/disable 根据输入的值 select 输入文本字段 b-形式-select
如果有人能帮助我,我将不胜感激。
new Vue({
el: "#app",
data: {
selected: 0,
options: [
{ value: 0, text: 'Enabled' },
{ value: 1, text: 'Disabled' }
]
}
});
<div id="app" class="m-5">
<b-form-select v-model="selected" :options="options"></b-form-select>
<b-form-input type="text" :disabled="selected === 1" class="mt-3"></b-form-input>
</div>