@viur/shop-components 0.0.1-dev.18 → 0.0.1-dev.19
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,6 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
2
|
+
<Loader v-if="!cartKey.length"></Loader>
|
|
3
|
+
<template v-else>
|
|
4
|
+
<pre> {{ state.nodes }}</pre>
|
|
5
|
+
<pre> {{ state.leaves }}</pre>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
4
8
|
<!-- <CartNode></CartNode>
|
|
5
9
|
<CartLeaf></CartLeaf> -->
|
|
6
10
|
<!-- <template v-else>
|
|
@@ -314,9 +318,9 @@ function onDialogHide() {
|
|
|
314
318
|
}
|
|
315
319
|
|
|
316
320
|
async function getChildren(parentKey = props.key) {
|
|
317
|
-
console.log("debug getChildren parentKey from comp: ", parentKey)
|
|
321
|
+
console.log("debug getChildren parentKey from comp: ", parentKey);
|
|
318
322
|
const children = await cartStore.getChildren(parentKey);
|
|
319
|
-
console.log("getChildren children: ", children)
|
|
323
|
+
console.log("getChildren children: ", children);
|
|
320
324
|
|
|
321
325
|
children.forEach(async (child) => {
|
|
322
326
|
if (child.skel_type === "node") {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { onBeforeMount, reactive, shallowRef,
|
|
6
|
+
import { onBeforeMount, reactive, shallowRef, computed } from "vue";
|
|
7
7
|
import { ListRequest } from "@viur/vue-utils";
|
|
8
8
|
|
|
9
9
|
import CartView from "../../cart/CartView.vue";
|
|
@@ -17,7 +17,9 @@ import { useCartStore } from "../../../stores/cart";
|
|
|
17
17
|
|
|
18
18
|
const cartStore = useCartStore();
|
|
19
19
|
|
|
20
|
-
const rootNode =
|
|
20
|
+
const rootNode = computed(() =>
|
|
21
|
+
cartStore.state.basketRootNode.key ? cartStore.state.basketRootNode.key : "",
|
|
22
|
+
);
|
|
21
23
|
const state = reactive({
|
|
22
24
|
rootNode: {},
|
|
23
25
|
tabs: {
|
|
@@ -26,7 +28,7 @@ const state = reactive({
|
|
|
26
28
|
props: {
|
|
27
29
|
sidebar: true,
|
|
28
30
|
mode: "basket",
|
|
29
|
-
cartKey: rootNode
|
|
31
|
+
cartKey: rootNode,
|
|
30
32
|
}, // 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
|
|
31
33
|
displayName: "Warenkorb",
|
|
32
34
|
icon: { name: "cart", library: "hsk" },
|
|
@@ -105,7 +107,5 @@ onBeforeMount(async () => {
|
|
|
105
107
|
await cartStore.getAdressStructure();
|
|
106
108
|
|
|
107
109
|
console.log("debug init exampleusage :", cartStore.state.basketRootNode);
|
|
108
|
-
|
|
109
|
-
rootNode.value = cartStore.state.basketRootNode.key;
|
|
110
110
|
});
|
|
111
111
|
</script>
|