@viur/shop-components 0.0.1-dev.16 → 0.0.1-dev.17
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
|
@@ -18,13 +18,14 @@ import { useCartStore } from "../../../stores/cart";
|
|
|
18
18
|
const cartStore = useCartStore();
|
|
19
19
|
|
|
20
20
|
const state = reactive({
|
|
21
|
+
rootNode: {},
|
|
21
22
|
tabs: {
|
|
22
23
|
cart: {
|
|
23
24
|
component: shallowRef(CartView),
|
|
24
25
|
props: {
|
|
25
26
|
sidebar: true,
|
|
26
27
|
mode: "basket",
|
|
27
|
-
cartKey:
|
|
28
|
+
cartKey: state.rootNode.key,
|
|
28
29
|
}, // 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
|
|
29
30
|
displayName: "Warenkorb",
|
|
30
31
|
icon: { name: "cart", library: "hsk" },
|
|
@@ -100,6 +101,7 @@ function handleTabs(e) {
|
|
|
100
101
|
|
|
101
102
|
onBeforeMount(async () => {
|
|
102
103
|
await cartStore.init();
|
|
104
|
+
state.rootNode = cartStore.state.basketRootNode.key
|
|
103
105
|
await cartStore.getAdressStructure();
|
|
104
106
|
});
|
|
105
107
|
</script>
|
package/src/stores/cart.js
CHANGED
|
@@ -25,9 +25,8 @@ export const useCartStore = defineStore("cartstore", () => {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
async function getChildren(parentKey) {
|
|
28
|
-
console.log("debug getChildren parentKey: ", parentKey)
|
|
29
28
|
let resp = await shopClient.cart_list({ cart_key: parentKey });
|
|
30
|
-
|
|
29
|
+
|
|
31
30
|
return resp
|
|
32
31
|
}
|
|
33
32
|
|