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