0👍
You can grab the value via params of route
var app = new Vue({
el: "#app",
data: {
// here i need the data/value of myvar
myvar: this.$route.params.myvar
}
- [Vuejs]-Import/export of external types failing in jest unit tests (vue2)
- [Vuejs]-Items not aligning properly in vue
0👍
var app = new Vue({
el: "#app",
data: {
myvar: '{{ myvar }}' //myvar comes from django urls.py
}
Works for me, this.$route.params.myvar doesn’t cause im not using vuerouter.
- [Vuejs]-How to store previous page even if I refresh the page in Vue
- [Vuejs]-TypeScript+ vue+property decorator : prop default value type
Source:stackexchange.com