优化页面
This commit is contained in:
17
stores/counter.js
Normal file
17
stores/counter.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
export const useCounterStore = defineStore('counter', {
|
||||
state: () => {
|
||||
return {
|
||||
myitem:{},
|
||||
youritem:{},
|
||||
};
|
||||
},
|
||||
// 也可以这样定义
|
||||
// state: () => ({ count: 0 })
|
||||
actions: {
|
||||
increment() {
|
||||
this.count++;
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user