@unhead/vue 1.3.3 → 1.3.5
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/dist/index.cjs
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const unhead = require('unhead');
|
|
4
|
-
const useHead = require('./shared/vue.
|
|
4
|
+
const useHead = require('./shared/vue.3633f8ad.cjs');
|
|
5
5
|
const vue = require('vue');
|
|
6
6
|
const shared = require('@unhead/shared');
|
|
7
7
|
|
|
8
8
|
const VueHeadMixin = {
|
|
9
9
|
created() {
|
|
10
|
-
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
let source = false;
|
|
11
|
+
if (useHead.Vue3) {
|
|
12
|
+
const instance = vue.getCurrentInstance();
|
|
13
|
+
if (!instance)
|
|
14
|
+
return;
|
|
15
|
+
const options = instance.type;
|
|
16
|
+
if (!options || !("head" in options))
|
|
17
|
+
return;
|
|
18
|
+
source = typeof options.head === "function" ? () => options.head.call(instance.proxy) : options.head;
|
|
19
|
+
} else {
|
|
20
|
+
const head = this.$options.head;
|
|
21
|
+
if (head) {
|
|
22
|
+
source = typeof head === "function" ? () => head.call(this) : head;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
source && useHead.useHead(source);
|
|
18
26
|
}
|
|
19
27
|
};
|
|
20
28
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
export { CapoPlugin, HashHydrationPlugin, createHeadCore } from 'unhead';
|
|
2
|
-
import { u as useHead, h as headSymbol, r as resolveUnrefHeadInput, i as injectHead } from './shared/vue.
|
|
3
|
-
export { c as createHead, a as createServerHead } from './shared/vue.
|
|
2
|
+
import { V as Vue3, u as useHead, h as headSymbol, r as resolveUnrefHeadInput, i as injectHead } from './shared/vue.cf073917.mjs';
|
|
3
|
+
export { c as createHead, a as createServerHead } from './shared/vue.cf073917.mjs';
|
|
4
4
|
import { getCurrentInstance, ref, watchEffect } from 'vue';
|
|
5
5
|
import { composableNames, whitelistSafeInput, unpackMeta } from '@unhead/shared';
|
|
6
6
|
|
|
7
7
|
const VueHeadMixin = {
|
|
8
8
|
created() {
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
let source = false;
|
|
10
|
+
if (Vue3) {
|
|
11
|
+
const instance = getCurrentInstance();
|
|
12
|
+
if (!instance)
|
|
13
|
+
return;
|
|
14
|
+
const options = instance.type;
|
|
15
|
+
if (!options || !("head" in options))
|
|
16
|
+
return;
|
|
17
|
+
source = typeof options.head === "function" ? () => options.head.call(instance.proxy) : options.head;
|
|
18
|
+
} else {
|
|
19
|
+
const head = this.$options.head;
|
|
20
|
+
if (head) {
|
|
21
|
+
source = typeof head === "function" ? () => head.call(this) : head;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
source && useHead(source);
|
|
17
25
|
}
|
|
18
26
|
};
|
|
19
27
|
|
package/dist/polyfill.cjs
CHANGED
package/dist/polyfill.mjs
CHANGED
|
@@ -100,4 +100,4 @@ function clientUseHead(head, input, options = {}) {
|
|
|
100
100
|
return entry;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
export { createServerHead as a, createHead as c, headSymbol as h, injectHead as i, resolveUnrefHeadInput as r, useHead as u };
|
|
103
|
+
export { Vue3 as V, createServerHead as a, createHead as c, headSymbol as h, injectHead as i, resolveUnrefHeadInput as r, useHead as u };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.5",
|
|
5
5
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"hookable": "^5.5.3",
|
|
41
|
-
"@unhead/schema": "1.3.
|
|
42
|
-
"unhead": "1.3.
|
|
43
|
-
"
|
|
41
|
+
"@unhead/schema": "1.3.5",
|
|
42
|
+
"@unhead/shared": "1.3.5",
|
|
43
|
+
"unhead": "1.3.5"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"vue": "^3.3.4"
|