add vuex
This commit is contained in:
1 parent
7b98c36a1e
commit
504097d407
4 files changed
+33
-22
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { createApp } from 'vue';
|
||||
import { createStore } from 'vuex';
|
||||
|
||||
interface IState {
|
||||
count: number;
|
||||
}
|
||||
|
||||
const store = createStore({
|
||||
state(): IState {
|
||||
return {
|
||||
count: 0
|
||||
};
|
||||
},
|
||||
mutations: {
|
||||
increment(state: IState) {
|
||||
state.count++;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export default store;
|
||||
Reference in new issue
Block a user