for example, the user logs in and gets the user data after the login is successful. What if there are multiple JS files that need user data?
for example, the user logs in and gets the user data after the login is successful. What if there are multiple JS files that need user data?
two solutions:
store the retrieved data in local local storage or in vueX
vuex, refresh the page will be lost. It is recommended that sessionStorage
vuex is responsible for communication between components. If it does not cooperate with storage, refreshing the page will lead to data loss. Then storage is divided into local and session, with different life cycle, so it can be used reasonably according to the needs. If you save login information, it's best to use localstorage.
Previous: How python deletes the following numbers
does Mini Program have such a mechanism, or is it written incorrectly? This kind of application scenario is quite common, isn t it? ...
key ...
here s the thing. Vue.js has a project to set a lot of default values. There are about 20 or 30 default values. put in data is too long, the subject is just a piece of cake, want to ask if there is a better solution, do not have to put so many, too u...
use this edit box, < div contenteditable= "true " > when I edit a line wrap, it automatically adds a p tag, but I pass the data to the service and refresh the data obtained from the page to be displayed on the page, right? this tag is also displayed. ...
recently, I was working on a project with vue+elementUI. When I was doing a shopping cart, I was thinking about how it was sent to the backend when the number in the shopping cart changed. If I changed it once, it would definitely be bad. Then I went to ...
Why better-scroll can t scroll with the mouse, it can only be dragged. Awkward. I don t know 50 meters ...
I just wrote a test demo,. I don t know if it s my webpack configuration problem or something. When I run it, webpack-dev-server-- mode=development-- inline-- progress-- config build webpack.dev.conf.js the terminal display is as follows: ite...
I used a custom column in a table build using element ui. The fields are successfully bound. The code is as follows <el-table-column label="" align="center" sortable width="100"> <template slot-scope="s...
everyone knows that vue is a relatively popular framework recently, and it is indeed an excellent front-end framework, but when we see that many open source projects use vue family buckets and webpack four-piece sets, the cost of learning is a little hig...
binding keyup.tab.prevent in vue cannot prevent tab browser default events related codes @keyup.stop.prevent="onKeyup" methods: { onKeyup(e){ e.preventDefault(); switch (e.keyCode) { tab case 9: ...
I code like this: layout_1.vue <template> <nuxt > <h2>Hello China< h2> < template> <script> export default { layout: layout_0 }; < script> ...
I have a question. What if I have two vuecli projects and there is a button in project-1 and project-2; project-1 that wants to click one of the load routing project-2 components into a router-view in project-1? ...
...
projects built using 3.4.0 scaffolding ...