-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Description
Hello.
I have a simple registration page which loads some data from the server before I show the form. When the data is being loaded I get 2 warnings in the console:
[Vue warn]: You are setting a non-existent path "ok" on a vm instance. Consider pre-initializing the property with the "data" option for more reliable reactivity and better performance.
[Vue warn]: You are setting a non-existent path "data" on a vm instance. Consider pre-initializing the property with the "data" option for more reliable reactivity and better performance.
My hook and method:
route: {
data: function (transition) {
return this.fetchTags()
}
},
methods: {
fetchTags: function () {
return this.$http.get('tags', function(data, status) {
this.tags = data.data
}).error(function(data, status) {
console.warn(data.error.message)
})
},
// ...
Why is it returning warning in the console if I did exactly as the documentation suggests to return a promise? Did I need to do something in another way?
EDIT:
It seems like what it does is running the $set
method on the Promise object that is being returned which has the ok
and data
keys.
How can I not run it? All I really want to do is to fetch the tags, update the this.tags
array and only then show the route. How can I achieve that?
_Note: I'm using vue-resource
for my http requests._
Metadata
Metadata
Assignees
Labels
No labels