0👍
If you serve your json file as static file. You can use fetch
api or any other fetch library to access your json file.
fetch('path/to/your.json')
.then(response => response.json())
.then(data => {
// do something
})
See more about Fetch API.
In case you want to pass some json data as url query. Don’t forget to use encodeURIComponent
or btoa
to escape some special characters.
window.open('/some/path?data=' + encodeURIComponent(JSON.stringify(data)))
- [Vuejs]-Mixin with access-functionality in vue
- [Vuejs]-How to make child components aware of nested init data in Vue?
0👍
I have solved it by using Vuex and setting the JSON in the state of Vuex, so it can be accessible from other pages.
Source:stackexchange.com