Does import mapGetters have any path requirements in vue? Why do sublevel directories see undefined?

use
src/views/xxx/index.vue

here

import {mapGetters} from "vuex"
computed: {

...mapGetters([
  "user_id",
  "username",
])

},

this.username can be printed in created

the same code is put in
src/views/xxx/yyy/index.vue
print this.username becomes undefined

Mar.07,2021

there is no problem in theory. Could it be that your username getter itself does not have data


how your store file is referenced? it should be the wrong path referenced by store. src/views/xxx/yyy/index.vue the store reference in this file should also be looked up one more level

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-1ea12ac-1b32.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-1ea12ac-1b32.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?