当我单击页面上的编辑按钮时,将打开编辑表单,其中包含一些开关。我从数据库中获取值“ 1”,但在编辑表单开关中始终处于关闭状态。我该如何解决?
<d-field-group class="field-group field-row" label-for = "Zip_Need" label="Does it need zip/postal code?" label-class="col-4">
<d-switch id="Zip_Need" name="Zip_Need" v-model="form.Zip_Need" ></d-switch>
</d-field-group>
editCountry(id){
axios.defaults.headers.common['Authorization'] = "Bearer "+localStorage.getItem('token');
axios.get(baseUrl+'/country/edit/'+id)
.then((response) => {
this.form = response.data[0].form;
setTimeout(() => {
this.subComponentLoading = true;
}, 500);
})
.catch(function (error) {
console.log(error);
});
},