封装方法,搭建项目
This commit is contained in:
12
src/stores/notice.js
Normal file
12
src/stores/notice.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
export const noticeStore = defineStore('noticeNum', {
|
||||
state: () => {
|
||||
return { data: { num: 0 } };
|
||||
},
|
||||
actions: {
|
||||
increment() {
|
||||
this.data.num++;
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user