@lancom/shared 0.0.240 → 0.0.241
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/components/faq/faq-async.vue +34 -0
- package/components/placeholder/placeholder.scss +19 -0
- package/components/placeholder/placeholder.vue +13 -0
- package/components/product/printed_product_images/printed-product-images-async.vue +30 -0
- package/components/product/product_info_tabs/product-info-tabs-async.vue +30 -0
- package/components/product/product_reviews/product-reviews-async.vue +30 -0
- package/components/product/related_products/related-products-async.vue +30 -0
- package/mixins/component-async.js +26 -0
- package/nuxt.config.js +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="FaqAsync__wrapper">
|
|
3
|
+
<placeholder
|
|
4
|
+
v-if="!isLoadedComponent"
|
|
5
|
+
style="height: 300px" />
|
|
6
|
+
<faq
|
|
7
|
+
v-else
|
|
8
|
+
v-bind="$attrs">
|
|
9
|
+
<template v-for="(_, slot) of $scopedSlots" v-slot:[slot]="scope">
|
|
10
|
+
<slot :name="slot" v-bind="scope"></slot>
|
|
11
|
+
</template>
|
|
12
|
+
</faq>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import Vue from 'vue';
|
|
18
|
+
import ComponentAsyncMixin from '@lancom/shared/mixins/component-async';
|
|
19
|
+
import Placeholder from '@lancom/shared/components/placeholder/placeholder';
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'FaqAsync',
|
|
23
|
+
components: {
|
|
24
|
+
Placeholder
|
|
25
|
+
},
|
|
26
|
+
mixins: [ComponentAsyncMixin],
|
|
27
|
+
methods: {
|
|
28
|
+
async importComponents() {
|
|
29
|
+
const component = await import('./faq');
|
|
30
|
+
Vue.component('faq', component.default);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.Placeholder {
|
|
2
|
+
&__wrapper{
|
|
3
|
+
width: 100%;
|
|
4
|
+
animation-name: backgroundColorPalette;
|
|
5
|
+
animation-duration: 1s;
|
|
6
|
+
animation-iteration-count: infinite;
|
|
7
|
+
animation-direction: alternate;
|
|
8
|
+
margin: 10px 0;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@keyframes backgroundColorPalette {
|
|
13
|
+
0% {
|
|
14
|
+
background: #efefef;
|
|
15
|
+
}
|
|
16
|
+
100% {
|
|
17
|
+
background: #e4e2e2;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="PrintedProductImagesAsync__wrapper">
|
|
3
|
+
<placeholder
|
|
4
|
+
v-if="!isLoadedComponent"
|
|
5
|
+
style="height: 200px" />
|
|
6
|
+
<printed-product-images
|
|
7
|
+
v-else
|
|
8
|
+
v-bind="$attrs" />
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import Vue from 'vue';
|
|
14
|
+
import ComponentAsyncMixin from '@lancom/shared/mixins/component-async';
|
|
15
|
+
import Placeholder from '@lancom/shared/components/placeholder/placeholder';
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: 'PrintedProductImagesAsync',
|
|
19
|
+
components: {
|
|
20
|
+
Placeholder
|
|
21
|
+
},
|
|
22
|
+
mixins: [ComponentAsyncMixin],
|
|
23
|
+
methods: {
|
|
24
|
+
async importComponents() {
|
|
25
|
+
const component = await import('./printed-product-images');
|
|
26
|
+
Vue.component('printed-product-images', component.default);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ProductInfoTabsAsync__wrapper">
|
|
3
|
+
<placeholder
|
|
4
|
+
v-if="!isLoadedComponent"
|
|
5
|
+
style="height: 200px" />
|
|
6
|
+
<product-info-tabs
|
|
7
|
+
v-else
|
|
8
|
+
v-bind="$attrs" />
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import Vue from 'vue';
|
|
14
|
+
import ComponentAsyncMixin from '@lancom/shared/mixins/component-async';
|
|
15
|
+
import Placeholder from '@lancom/shared/components/placeholder/placeholder';
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: 'ProductInfoTabsAsync',
|
|
19
|
+
components: {
|
|
20
|
+
Placeholder
|
|
21
|
+
},
|
|
22
|
+
mixins: [ComponentAsyncMixin],
|
|
23
|
+
methods: {
|
|
24
|
+
async importComponents() {
|
|
25
|
+
const component = await import('./product-info-tabs');
|
|
26
|
+
Vue.component('product-info-tabs', component.default);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ProductReviewsAsync__wrapper">
|
|
3
|
+
<placeholder
|
|
4
|
+
v-if="!isLoadedComponent"
|
|
5
|
+
style="height: 200px" />
|
|
6
|
+
<product-reviews
|
|
7
|
+
v-else
|
|
8
|
+
v-bind="$attrs" />
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import Vue from 'vue';
|
|
14
|
+
import ComponentAsyncMixin from '@lancom/shared/mixins/component-async';
|
|
15
|
+
import Placeholder from '@lancom/shared/components/placeholder/placeholder';
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: 'ProductReviewsAsync',
|
|
19
|
+
components: {
|
|
20
|
+
Placeholder
|
|
21
|
+
},
|
|
22
|
+
mixins: [ComponentAsyncMixin],
|
|
23
|
+
methods: {
|
|
24
|
+
async importComponents() {
|
|
25
|
+
const component = await import('./product-reviews');
|
|
26
|
+
Vue.component('product-reviews', component.default);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="RelatedProductsAsync__wrapper">
|
|
3
|
+
<placeholder
|
|
4
|
+
v-if="!isLoadedComponent"
|
|
5
|
+
style="height: 200px" />
|
|
6
|
+
<related-products
|
|
7
|
+
v-else
|
|
8
|
+
v-bind="$attrs" />
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import Vue from 'vue';
|
|
14
|
+
import ComponentAsyncMixin from '@lancom/shared/mixins/component-async';
|
|
15
|
+
import Placeholder from '@lancom/shared/components/placeholder/placeholder';
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: 'RelatedProductsAsync',
|
|
19
|
+
components: {
|
|
20
|
+
Placeholder
|
|
21
|
+
},
|
|
22
|
+
mixins: [ComponentAsyncMixin],
|
|
23
|
+
methods: {
|
|
24
|
+
async importComponents() {
|
|
25
|
+
const component = await import('./related-products');
|
|
26
|
+
Vue.component('related-products', component.default);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
data() {
|
|
3
|
+
return {
|
|
4
|
+
isLoadedComponent: false,
|
|
5
|
+
observer: null
|
|
6
|
+
};
|
|
7
|
+
},
|
|
8
|
+
async mounted() {
|
|
9
|
+
if (process.client && !this.isLoadedComponent) {
|
|
10
|
+
this.observer = new IntersectionObserver(async (entries) => {
|
|
11
|
+
if(entries[0].isIntersecting === true) {
|
|
12
|
+
await this.importComponents();
|
|
13
|
+
this.isLoadedComponent = true;
|
|
14
|
+
}
|
|
15
|
+
}, { threshold: [0.1] });
|
|
16
|
+
|
|
17
|
+
this.observer.observe(this.$el);
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
destroyed() {
|
|
21
|
+
this.observer.unobserve(this.$el);
|
|
22
|
+
},
|
|
23
|
+
methods: {
|
|
24
|
+
async importComponents() {}
|
|
25
|
+
}
|
|
26
|
+
};
|
package/nuxt.config.js
CHANGED
|
@@ -91,9 +91,9 @@ module.exports = (config, axios, { raygunClient, publicPath } = {}) => ({
|
|
|
91
91
|
},
|
|
92
92
|
build: {
|
|
93
93
|
splitChunks: {
|
|
94
|
-
layouts:
|
|
95
|
-
pages:
|
|
96
|
-
commons:
|
|
94
|
+
layouts: true,
|
|
95
|
+
pages: true,
|
|
96
|
+
commons: true
|
|
97
97
|
},
|
|
98
98
|
publicPath: publicPath || '/client/',
|
|
99
99
|
postcss: null,
|