@viur/shop-components 0.0.1-dev.20 → 0.0.1-dev.21

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.20",
3
+ "version": "0.0.1-dev.21",
4
4
  "description": "Frontend Vue components for the shop module of ViUR",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,7 +1,13 @@
1
1
  <template>
2
- <div>test</div>
2
+ <pre>{{ leaf }}</pre>
3
3
  </template>
4
4
 
5
- <script setup></script>
5
+ <script setup>
6
+ import { computed, reactive } from "vue";
6
7
 
7
- <style scoped></style>
8
+ const props = defineProps({
9
+ leaf: { type: Object, required: true },
10
+ });
11
+
12
+ const state = reactive({});
13
+ </script>
@@ -1,17 +1,17 @@
1
1
  <template>
2
- <h1>{{ state.headline }}</h1>
2
+ <pre>{{ state.headline }}</pre>
3
3
  </template>
4
4
 
5
5
  <script setup>
6
6
  import { computed, reactive } from "vue";
7
7
 
8
8
  const props = defineProps({
9
- headline: { type: String, default: "TEST" },
9
+ node: { type: Object, required: true },
10
10
  });
11
11
 
12
12
  const state = reactive({
13
13
  headline: computed(() => {
14
- props.headline;
14
+ props.node;
15
15
  }),
16
16
  });
17
17
  </script>
@@ -1,7 +1,20 @@
1
1
  <template>
2
2
  <Loader v-if="!cartKey.length"></Loader>
3
3
  <template v-else>
4
- <pre> {{ state.nodes }}</pre>
4
+ <div v-for="node in state.nodes">
5
+ <template
6
+ v-if="Object.keys(state.leaves).includes(node.key)"
7
+ :key="node.key"
8
+ >
9
+ <CartNode :node="node"> </CartNode>
10
+ <CartLeaf
11
+ v-for="leaf in state.leaves[node.key]"
12
+ :key="leaf.key"
13
+ :leaf="leaf"
14
+ >
15
+ </CartLeaf>
16
+ </template>
17
+ </div>
5
18
  <pre> {{ state.leaves }}</pre>
6
19
  </template>
7
20
 
@@ -19,8 +19,6 @@ export const useCartStore = defineStore("cartstore", () => {
19
19
  });
20
20
 
21
21
  async function init() {
22
- // ! initializes only children for cart of type basket
23
- // ! for whishlists this has to be done in the component
24
22
  await getRootNodes();
25
23
  }
26
24