When accessing data in Vuex, use the pointing problem of this here in this.$store.state.city in the component?

When accessing data in

Vuex, it is a bit confusing to use the this of this.$store.state.city in a single-file component. If the this points to the current component, there is no store option in the current component. If this points to the root component app in main.js, there is no problem with data access, but this this obviously refers to the current single-file component. I also hope that the boss will give me some advice to help my younger brother solve his doubts. Thank you

May.26,2021

clipboard.png

ide/state.html" rel=" nofollow noreferrer "> https://vuex.vuejs.org/zh/gui.


injects values into the root component like $route and is accessible in all subcomponents.


it can be understood that main.js is an ancestor. If you give something to your ancestors, something from your ancestors will be passed on to future generations, so future generations can use it through this. I don't know if I can understand this.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b167-2c27c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b167-2c27c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?