@unhead/vue 1.8.0-beta.6 → 1.8.0-beta.7
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 +6 -4
- package/dist/index.mjs +6 -4
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -103,10 +103,12 @@ function useScript(_input, _options) {
|
|
|
103
103
|
const status = vue.ref("awaitingLoad");
|
|
104
104
|
shared.NetworkEvents.forEach((fn) => {
|
|
105
105
|
const _fn = typeof input[fn] === "function" ? input[fn].bind(ctx) : null;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
if (_fn) {
|
|
107
|
+
input[fn] = (e) => {
|
|
108
|
+
status.value = fn === "onload" ? "loaded" : fn === "onerror" ? "error" : "loading";
|
|
109
|
+
_fn && _fn(e);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
110
112
|
});
|
|
111
113
|
options.stub = ({ script, fn }) => {
|
|
112
114
|
if (fn === "$script") {
|
package/dist/index.mjs
CHANGED
|
@@ -103,10 +103,12 @@ function useScript(_input, _options) {
|
|
|
103
103
|
const status = ref("awaitingLoad");
|
|
104
104
|
NetworkEvents.forEach((fn) => {
|
|
105
105
|
const _fn = typeof input[fn] === "function" ? input[fn].bind(ctx) : null;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
if (_fn) {
|
|
107
|
+
input[fn] = (e) => {
|
|
108
|
+
status.value = fn === "onload" ? "loaded" : fn === "onerror" ? "error" : "loading";
|
|
109
|
+
_fn && _fn(e);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
110
112
|
});
|
|
111
113
|
options.stub = ({ script, fn }) => {
|
|
112
114
|
if (fn === "$script") {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.8.0-beta.
|
|
4
|
+
"version": "1.8.0-beta.7",
|
|
5
5
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"hookable": "^5.5.3",
|
|
51
|
-
"@unhead/schema": "1.8.0-beta.
|
|
52
|
-
"@unhead/shared": "1.8.0-beta.
|
|
53
|
-
"unhead": "1.8.0-beta.
|
|
51
|
+
"@unhead/schema": "1.8.0-beta.7",
|
|
52
|
+
"@unhead/shared": "1.8.0-beta.7",
|
|
53
|
+
"unhead": "1.8.0-beta.7"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"vue": "^3.3.4"
|