小编Mys*_*dev的帖子

我无法从 Pinia Vuejs3 商店访问我的路线

我无法从商店访问我的路线。对此或许有一个很好的解释。我使用 Vuejs3 和 Pinia

我的商店:

import {defineStore} from 'pinia'
import {useRoute} from "vue-router";


type navigationState = {
    selectedNavigationItem: INavigationItem | null,
    selectedNavigationPage: INavigationPage | null,
}

export const useNavigationStore = defineStore('navigationStore', {
    state: () => ({
        /**
         * when the user clicks on an element of the navbar we store the navigation item here
         */
        selectedNavigationItem: null,
        /**
         * when the user clicks on an element of the sidebar we store the navigation page here
         */
        selectedNavigationPage: null,
    } as …
Run Code Online (Sandbox Code Playgroud)

javascript vue-router vuejs3 pinia

5
推荐指数
2
解决办法
6803
查看次数

标签 统计

javascript ×1

pinia ×1

vue-router ×1

vuejs3 ×1