@viur/shop-components 0.0.1-dev.12 → 0.0.1-dev.13

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.12",
3
+ "version": "0.0.1-dev.13",
4
4
  "description": "Frontend Vue components for the shop module of ViUR",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,11 +1,7 @@
1
1
  <template>
2
- <div>test</div>
2
+ <div>test</div>
3
3
  </template>
4
4
 
5
- <script setup>
5
+ <script setup></script>
6
6
 
7
- </script>
8
-
9
- <style scoped>
10
-
11
- </style>
7
+ <style scoped></style>
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <h1>{{ state.headline }}</h1>
3
+ </template>
4
+
5
+ <script setup>
6
+ import { computed, reactive } from "vue";
7
+
8
+ const props = defineProps({
9
+ headline: { type: String, default: "TEST" },
10
+ });
11
+
12
+ const state = reactive({
13
+ headline: computed(() => {
14
+ props.headline;
15
+ }),
16
+ });
17
+ </script>
@@ -22,22 +22,12 @@ export const useCartStore = defineStore("cartstore", () => {
22
22
  // ! initializes only children for cart of type basket
23
23
  // ! for whishlists this has to be done in the component
24
24
  await getRootNodes();
25
- await getChildren(state.basketRootNode.key);
26
25
  }
27
26
 
28
27
  async function getChildren(parentKey) {
29
28
  let resp = await shopClient.cart_list({ cart_key: parentKey });
30
29
 
31
- resp.forEach(async (child) => {
32
- if (child.skel_type === "node") {
33
- await getChildren(child.key);
34
- } else {
35
- if (!Object.keys(state.children).includes(child.key)) {
36
- state.children[parentKey] = [];
37
- }
38
- state.children[parentKey].push(child);
39
- }
40
- });
30
+ return resp
41
31
  }
42
32
 
43
33
  async function getRootNodes() {