提交源文件
This commit is contained in:
5
src/store/index.js
Normal file
5
src/store/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import { createPinia } from "pinia";
|
||||
|
||||
const store = createPinia();
|
||||
|
||||
export default store;
|
||||
13
src/store/user.js
Normal file
13
src/store/user.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { defineStore } from "pinia";
|
||||
export const useUserStore = defineStore({
|
||||
id: "user",
|
||||
state: () => ({
|
||||
name: "张三",
|
||||
token: "sas121sasdADSAD",
|
||||
}),
|
||||
actions: {
|
||||
login(data) {
|
||||
this.name = data;
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user