我有一个 vuetify 开关,应该从 API True 或 False 接收值。
API 返回 True,但 Switch 始终显示 False。
<v-switch label="Habilitado">{{props.item.habilitado}}</v-switch>
该开关位于包含其他值的 vuetify 数据表内。其他值接收数据,但似乎开关没有。
我的 data() 项目返回:
items:[{
habilitado: "",
}],
在Postman中显示True值
我的 axios 获取方法:
cargarTanques(){
axios
.get("http://localhost:58209/api/Tanque/GetTanques", {
headers: {
Authorization: "Bearer " + localStorage.getItem("token")
}
})
.then(response => {
console.log(response);
this.items = response.data;
//this.snackbar = true;
//this.textSnackbar = "Se han cargado correctamente las estaciones";
})
.catch(error => {
console.log(error.response);
this.snackbar = true;
this.textSnackbar =
"Lo sentimos, no pudimos cargar la información de los tanques";
});
},
谢谢
EDIT
接收该值的类有:
公共 bool Habilitado {get;放;}
我遇到了同样的问题,这是因为我的应用程序不在 v-app 标签内。
Vuetify 与 v-menu 的问题 https://stackoverflow.com/questions/51596881/vuetify-issue-with-v-menu/51598858
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)