@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viur/shop-components",
3
- "version": "0.0.1-dev.16",
3
+ "version": "0.0.1-dev.17",
4
4
  "description": "Frontend Vue components for the shop module of ViUR",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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: cartStore.state.basketRootNode.key,
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>
@@ -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
- console.log("debug getChildren: ", resp)
29
+
31
30
  return resp
32
31
  }
33
32