I have two pages: a login page and a Vue-based dashboard page. When a submit button on the login page is clicked, it redirects to the dashboard page. This is simply a typical login scenario.
Now I want to pass some data entered on the login page to the dashboard page, like user name, etc. What's the typical way of doing it? Maybe one can pass the data in main.js while instantiating a Vue instance, but I don't know how to pass the data to main.js.
Updated:
For example, here are the pages.
Login page, which is just a Vue-agnostic, vanilla html page:
<input id="userName"/>
<a href="dashboard.html"></a>
The main.js file in Vue-based Dashboard page:
new Vue({
el: '#app',
router,
template: '<App/>',
components: {
App
}
})
How can I pass userName entered in the input on the Login page to the Vue instance?
Any advice would be appreciated. I am very new to Vue. Thanks.