mirror of
https://github.com/chatopera/cosin.git
synced 2025-08-01 16:38:02 +08:00
add: navigate module
Signed-off-by: Kaifuny <superbiger.github@gmail.com>
This commit is contained in:
parent
8b1a0dbe94
commit
f32879cada
@ -8,3 +8,15 @@
|
||||
* module 为模块,一个模块对应一个 store,一个 store 对应一个模块
|
||||
* action 为模块的 action,一个 action 对应一个执行命令指令 (通常以 ``do`` 开头)
|
||||
* getter 为模块的 getter,一个 getter 对应一个获取命令指令 (通常以 ``get / is`` 开头)
|
||||
|
||||
参照:
|
||||
|
||||
module 与 action 的关系应该类似于, 模块名 类似于 npm 执行命令,install 行为对应 actions, xxx 为actions的参数
|
||||
```
|
||||
npm install xxx
|
||||
```
|
||||
|
||||
module 与 getters 的关系应该类似于
|
||||
```
|
||||
npm --version
|
||||
```
|
||||
|
@ -2,7 +2,7 @@ import { defineStore } from 'pinia'
|
||||
import { Apperance } from '@cskefu/models'
|
||||
import { useStorage } from '@vueuse/core'
|
||||
|
||||
export const useApperance = defineStore('alerts', {
|
||||
export const useApperance = defineStore('apperance', {
|
||||
state: () => ({
|
||||
apperance: useStorage<Apperance>('apperance', {
|
||||
lang: 'zh-CN',
|
||||
|
@ -0,0 +1,12 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useApperance = defineStore('auth', {
|
||||
state: () => ({
|
||||
currentUser: {},
|
||||
}),
|
||||
actions: {
|
||||
doLogin() {},
|
||||
doLogout() {},
|
||||
doSocialLogin() {},
|
||||
},
|
||||
})
|
@ -0,0 +1,18 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useApperance = defineStore('auth', {
|
||||
state: () => ({
|
||||
currentPathName: '',
|
||||
}),
|
||||
actions: {
|
||||
doWindowOpen(url: string, target?: string, features?: string) {
|
||||
window.open(url, target, features)
|
||||
},
|
||||
doRouteToByServiceName(serviceName: string) {
|
||||
console.log(serviceName)
|
||||
},
|
||||
doRouteToByPathName(path: string) {
|
||||
this.currentPathName = path
|
||||
},
|
||||
},
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user