@lancom/shared 0.0.180 → 0.0.182
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/mixins/meta-info.js +5 -2
- package/package.json +1 -1
- package/utils/head.js +18 -0
package/mixins/meta-info.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mapGetters } from 'vuex';
|
|
2
|
+
import { generateShopHeadScripts } from '@lancom/shared/utils/head';
|
|
2
3
|
|
|
3
4
|
const metaInfo = {
|
|
4
5
|
data() {
|
|
@@ -7,7 +8,8 @@ const metaInfo = {
|
|
|
7
8
|
};
|
|
8
9
|
},
|
|
9
10
|
computed: {
|
|
10
|
-
...mapGetters('page', ['routeInfo'])
|
|
11
|
+
...mapGetters('page', ['routeInfo']),
|
|
12
|
+
...mapGetters(['shop'])
|
|
11
13
|
},
|
|
12
14
|
methods: {
|
|
13
15
|
generateTitleFromRoute() {
|
|
@@ -97,7 +99,8 @@ const metaInfo = {
|
|
|
97
99
|
hid: 'canonical',
|
|
98
100
|
rel: 'canonical',
|
|
99
101
|
href: `https://${process.env.HOST_NAME}${this.$route.path === '/' ? '' : this.$route.path}`
|
|
100
|
-
}]
|
|
102
|
+
}],
|
|
103
|
+
...generateShopHeadScripts(this.shop)
|
|
101
104
|
};
|
|
102
105
|
},
|
|
103
106
|
getRoute() {
|
package/package.json
CHANGED
package/utils/head.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function generateShopHeadScripts(shop) {
|
|
2
|
+
const script = [];
|
|
3
|
+
if (shop.settings?.app?.LOG_ROCKET) {
|
|
4
|
+
script.push({
|
|
5
|
+
hid: 'LogRocket',
|
|
6
|
+
src: 'https://cdn.lr-in-prod.com/LogRocket.min.js',
|
|
7
|
+
crossorigin: 'anonymous'
|
|
8
|
+
}, {
|
|
9
|
+
hid: 'LogRocketInline',
|
|
10
|
+
type: 'text/javascript',
|
|
11
|
+
innerHTML: `window.LogRocket && window.LogRocket.init('${shop.settings?.app?.LOG_ROCKET}');`
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
script,
|
|
16
|
+
__dangerouslyDisableSanitizers: ['script']
|
|
17
|
+
};
|
|
18
|
+
}
|