@wikala/spmkt 2.25.0 → 2.25.2

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.
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="cart-badge-container has-text-white button is-text text-decoration-none">
3
3
  <span class="icon is-small" @click="qtyClick">
4
- <i class="fas fa-shopping-cart"></i>
4
+ <i class="fa-light fa-basket-shopping-simple"></i>
5
5
  <div class="cart-qty">{{ badgeQty }}</div>
6
6
  </span>
7
7
  <span class="cart-badge" @click="qtyClick">{{ label }}</span>
@@ -12,6 +12,8 @@
12
12
  </template>
13
13
 
14
14
  <script>
15
+ import Price from '../Product/Price.vue';
16
+
15
17
  export default {
16
18
  name: 'LoadMore',
17
19
  props: {
@@ -44,28 +46,30 @@ export default {
44
46
 
45
47
  const url = new URL(window.location.href);
46
48
  url.searchParams.set('page', this.currentPage);
47
- url.searchParams.set('partial', '1');
48
-
49
- const response = await fetch(url);
50
- console.log("response.status =", response.status);
51
-
52
- const html = await response.text();
49
+ url.searchParams.set('partial', '1')
53
50
 
54
- const temp = document.createElement('div');
55
- temp.innerHTML = html;
51
+ const response = await fetch(url)
52
+ const html = await response.text()
53
+
54
+ const temp = document.createElement('div')
55
+ temp.innerHTML = html
56
56
 
57
- const categoryProducts = this.$el.closest('.category-products').firstChild
58
- const newProducts = temp.querySelectorAll('.prod-box-container');
59
- newProducts.forEach(element => {
60
- categoryProducts.appendChild(element);
57
+ const loadMoreContainer = this.$el.closest('.load-more-container')
58
+ loadMoreContainer.insertAdjacentElement('beforebegin', temp)
59
+
60
+ //We need to initialize and mount all Vue components inside fetched content
61
+ const FetchedContent = Vue.extend({
62
+ template: temp.innerHTML,
63
+ components: { Price }
61
64
  });
65
+ new FetchedContent().$mount(temp);
62
66
  } catch (error) {
63
- console.error('Error loading more content:', error);
67
+ console.error('Error loading more content:', error)
64
68
  } finally {
65
69
  this.isLoading = false;
66
70
  if(this.currentPage === this.totalPages) {
67
- this.hasMoreContent = false;
68
- return;
71
+ this.hasMoreContent = false
72
+ return
69
73
  }
70
74
  }
71
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikala/spmkt",
3
- "version": "2.25.0",
3
+ "version": "2.25.2",
4
4
  "private": false,
5
5
  "description": "supermarket",
6
6
  "scripts": {