Hor*_*wis 0 webpack vue.js axios
我使用axios从数据库获取信息。我从阵列中的服务器得到响应:

我的html标签:

Js代码如下所示:
data() {
return {
departments: {
id: 0,
name: "name of company",
nameZod: "name of company dif"
},
};
},
created() {
axios
.get('/SomeController/Departments')
.then(response => {
this.departments = response.data;
console.log(this.departments);
})
}
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:无法读取未定义的属性'_wrapper'。这是非常奇怪的原因,因为我在其他模块中使用了类似的代码,并且可以正常工作。
小智 7
当v-on:click OR @click模板中的指令在methods组件内部缺少它指向的函数时,会发生此错误。
例子:
//template
@click="callAgain"
...
methods : {
//no function called callAgain
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1922 次 |
| 最近记录: |