5👍
✅
It’s an issue of scope (binding of this
)
Try defining the created
method like this:
created () {
console.log(this.test) //should log hello
}
For full example see this JSFiddle I created: https://jsfiddle.net/u96L1maz/1/
- [Vuejs]-Getting an internal server error when I try to make a request to a Seneca.js API using Axios
0👍
In addition to the other solutions, this also will work.
new Vue({
el: '#app',
data: () => {
return {
hello: 'hello',
bye: 'bye'
}
},
created: () => {
console.log(hello) // hello
console.log(bye) // bye
}
})
- [Vuejs]-Getting an internal server error when I try to make a request to a Seneca.js API using Axios
Source:stackexchange.com