index.js
738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { defineStore } from 'pinia';
export const mainStore = defineStore('main', {
state: () => {
return {
msg: 'Hello world',
count: 0,
auth: false,
comment_num: 0,
video_detail: {},
scrollTop: 0,
scrollTopCollection: 0,
scrollTopLike: 0,
};
},
getters: {},
actions: {
changeState (state) {
this.auth = state;
},
changeCommentNum (num) {
this.comment_num = num;
},
changeVideoDetail (v) {
this.video_detail = v;
},
changeScrollTop (v) {
this.scrollTop = v;
},
changeScrollTopCollection (v) {
this.scrollTopCollection = v;
},
changeScrollTopLike (v) {
this.scrollTopLike = v;
},
},
});