Reputation: 366
I use axios to get information from DB. I get response from server in array:
My html tags:
Js code looks like this:
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);
})
}
I get an error: Cannot read property '_wrapper' of undefined. Its very strange cause I use similar code in other module and it works correctly.
Upvotes: 12
Views: 23757
Reputation: 168
Check Pause on caught exceptions
under Breakpoints
in the sources panel.
Then you can see the name
variable that caused the problem (corresponding to @name
=an undefined method) in Scope-Local.
Upvotes: 0
Reputation: 51
You are calling some function in your component which is not defined in your component yet, Please check all of your functions in your component are defined.
For Example
You are using @click="something" but something() not defined in your component.
Upvotes: 2
Reputation: 387
It happened to me too, but with different reason (Vue + Vuetify. @click function must be attached to btn, not icon like below.
<v-btn fab small>
<v-icon @click="sendMessage">send</v-icon>
</v-btn>
Upvotes: 0
Reputation: 339
This error occurs when a v-on:click OR @click
directive in the template is missing the function it's pointing to, inside methods
in your component.
Example:
//template
@click="callAgain"
...
methods : {
//no function called callAgain
}
Upvotes: 11
Reputation: 1629
Maybe you have defined a function call somewhere (@click=something) and you haven't defined yet the function in methods. This happened to me, maybe it can be useful for someone
Upvotes: 63
Reputation: 756
you just need to initiate your departments as an array like this:
data() {
return {
departments: [
{
id: 0,
name: "name of company",
nameZod: "name of company dif"
},
],
};
},
Upvotes: 0