Vue开关始终关闭

时间:2018-10-31 11:00:34

标签: vue.js

当我单击页面上的编辑按钮时,将打开编辑表单,其中包含一些开关。我从数据库中获取值“ 1”,但在编辑表单开关中始终处于关闭状态。我该如何解决?

edit.vue

<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);
            });
        },

enter image description here

enter image description here

0 个答案:

没有答案