no message
parent
a50ec76341
commit
8a6051bcef
@ -1,13 +1,16 @@
|
|||||||
import { createSSRApp } from 'vue'
|
import {
|
||||||
import store from './store'
|
createSSRApp
|
||||||
import App from './App.vue'
|
} from 'vue'
|
||||||
import $lu from './lu'
|
import * as Pinia from 'pinia';
|
||||||
|
import App from './App.vue'
|
||||||
uni.$lu = $lu
|
import $lu from './lu'
|
||||||
export function createApp() {
|
|
||||||
const app = createSSRApp(App)
|
uni.$lu = $lu
|
||||||
app.use(store)
|
export function createApp() {
|
||||||
return {
|
const app = createSSRApp(App)
|
||||||
app
|
app.use(Pinia.createPinia())
|
||||||
}
|
return {
|
||||||
}
|
app,
|
||||||
|
Pinia
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,22 +1,19 @@
|
|||||||
import {
|
import {
|
||||||
createStore
|
defineStore
|
||||||
} from "vuex";
|
} from 'pinia';
|
||||||
|
|
||||||
export default createStore({
|
export const useStore = defineStore('counter', {
|
||||||
state: {
|
state: () => ({
|
||||||
count: 1,
|
count: 1,
|
||||||
loading: 0,
|
loading: 0,
|
||||||
},
|
}),
|
||||||
mutations: {
|
actions: {
|
||||||
loadingStart(state) {
|
loadingStart() {
|
||||||
state.loading++
|
this.loading++
|
||||||
},
|
},
|
||||||
loadingDone(state) {
|
loadingDone() {
|
||||||
state.loading--
|
this.loading--
|
||||||
if (state.loading < 0) state.loading = 0
|
if (this.loading < 0) this.loading = 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {},
|
});
|
||||||
getters: {},
|
|
||||||
modules: {}
|
|
||||||
});
|
|
||||||
|
|||||||
Loading…
Reference in New Issue