@viur/shop-components 0.0.1-dev.17 → 0.0.1-dev.18
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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { onBeforeMount, reactive, shallowRef } from "vue";
|
|
6
|
+
import { onBeforeMount, reactive, shallowRef, ref } from "vue";
|
|
7
7
|
import { ListRequest } from "@viur/vue-utils";
|
|
8
8
|
|
|
9
9
|
import CartView from "../../cart/CartView.vue";
|
|
@@ -17,6 +17,7 @@ import { useCartStore } from "../../../stores/cart";
|
|
|
17
17
|
|
|
18
18
|
const cartStore = useCartStore();
|
|
19
19
|
|
|
20
|
+
const rootNode = ref(null);
|
|
20
21
|
const state = reactive({
|
|
21
22
|
rootNode: {},
|
|
22
23
|
tabs: {
|
|
@@ -25,7 +26,7 @@ const state = reactive({
|
|
|
25
26
|
props: {
|
|
26
27
|
sidebar: true,
|
|
27
28
|
mode: "basket",
|
|
28
|
-
cartKey:
|
|
29
|
+
cartKey: rootNode.value.key,
|
|
29
30
|
}, // cartKey (on initial call has to be a root node) is a required prop, make sure that cartStore.init() is called before cart is mounted
|
|
30
31
|
displayName: "Warenkorb",
|
|
31
32
|
icon: { name: "cart", library: "hsk" },
|
|
@@ -101,7 +102,10 @@ function handleTabs(e) {
|
|
|
101
102
|
|
|
102
103
|
onBeforeMount(async () => {
|
|
103
104
|
await cartStore.init();
|
|
104
|
-
state.rootNode = cartStore.state.basketRootNode.key
|
|
105
105
|
await cartStore.getAdressStructure();
|
|
106
|
+
|
|
107
|
+
console.log("debug init exampleusage :", cartStore.state.basketRootNode);
|
|
108
|
+
|
|
109
|
+
rootNode.value = cartStore.state.basketRootNode.key;
|
|
106
110
|
});
|
|
107
111
|
</script>
|