@monkeyplus/payscope 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { installFlowVuePlugins } from '@monkeyplus/flow/vue';
|
|
2
2
|
import { createApp } from 'vue';
|
|
3
|
+
import { registerPinia } from '../stores.ts';
|
|
3
4
|
import App from './App.vue';
|
|
4
5
|
import { router } from './router';
|
|
5
6
|
|
|
6
7
|
export function registerCheckoutApp() {
|
|
7
8
|
const app = createApp(App);
|
|
9
|
+
registerPinia(app);
|
|
8
10
|
app.use(router);
|
|
9
11
|
installFlowVuePlugins(app);
|
|
10
12
|
app.mount('#app');
|
package/storefront/login/main.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { createApp } from 'vue';
|
|
2
|
+
import { registerPinia } from '../stores.ts';
|
|
2
3
|
import App from './App.vue';
|
|
3
4
|
import { router } from './router';
|
|
4
5
|
|
|
5
6
|
export function registerLoginApp() {
|
|
6
7
|
const app = createApp(App);
|
|
8
|
+
registerPinia(app);
|
|
9
|
+
|
|
7
10
|
app.use(router);
|
|
8
11
|
|
|
9
12
|
app.mount('#app');
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { createApp } from 'vue';
|
|
2
|
+
import { registerPinia } from '../stores.ts';
|
|
2
3
|
import App from './App.vue';
|
|
3
4
|
import { router } from './router';
|
|
4
5
|
|
|
5
6
|
export function registerProfileApp() {
|
|
6
7
|
const app = createApp(App);
|
|
8
|
+
registerPinia(app);
|
|
9
|
+
|
|
7
10
|
app.use(router);
|
|
8
11
|
|
|
9
12
|
app.mount('#app');
|
package/storefront/stores.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { useAsyncState } from '@vueuse/core';
|
|
2
2
|
import { ofetch } from 'ofetch';
|
|
3
|
-
import { defineStore } from 'pinia';
|
|
4
|
-
import { computed, ref } from 'vue';
|
|
3
|
+
import { createPinia, defineStore } from 'pinia';
|
|
4
|
+
import { type App, computed, ref } from 'vue';
|
|
5
5
|
|
|
6
|
+
export function registerPinia(app: App) {
|
|
7
|
+
if (!(window as any)?.sharedPinia) {
|
|
8
|
+
(window as any).sharedPinia = createPinia();
|
|
9
|
+
}
|
|
10
|
+
app.use((window as any).sharedPinia);
|
|
11
|
+
}
|
|
6
12
|
export const useCartStore = defineStore('cart', () => {
|
|
7
13
|
const { state: items, isLoading: loadingInit } = useAsyncState(async () => {
|
|
8
14
|
const r = await ofetch('/storefront/cart');
|