How should vuex be configured?

making a vue imitating Wechat"s demo
I want to store the title of the page header (Wechat, address book, discovery, me) in vuex, and change the title of the page header every time I click the navigation button at the bottom.

before I wrote a default home page currentpagename, in store.js under the vuex folder, I thought that after clicking the navigation at the bottom, I would write a $store.state.currentPageName=" Wechat"in these three files of vcontact.vue/vexplore.vue/vme.vue to change the title of the page, but I don"t know how to write it and keep reporting an error or can"t show it, or is there something wrong with my mind?

Code address: https://github.com/RicardoCao.

Please give me some advice, thank you!

Mar.01,2021

there's no need to bother. Just configure it in router/index.js

.

index.js

...
routes: [
    {
      path: '/',
      redirect: '/weixin'
    },
    {
      path: '/weixin',
      name: 'Weixin',
      component: Weixin,
      meta: {title: ''}
    },
    {
      path: '/contact',
      name: 'Contact',
      component: Contact,
      meta: {title: ''}
    },
    {
      path: '/find',
      name: 'Find',
      component: Find,
      meta: {title: ''}
    },
    {
      path: '/my',
      name: 'My',
      component: My,
      meta: {title: ''}
    },
  ]

get the title in the component

this.$route.meta
Menu