youtil 2.1.1 → 3.0.0
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/cjs/enum.d.ts +30 -0
- package/cjs/enum.js +49 -0
- package/cjs/index.d.ts +3 -28
- package/cjs/index.js +3 -73
- package/cjs/loading.js +13 -8
- package/cjs/message.d.ts +12 -0
- package/cjs/message.js +220 -0
- package/cjs/other.d.ts +28 -0
- package/cjs/other.js +81 -0
- package/cjs/time.js +2 -3
- package/{build → docs}/404.html +5 -5
- package/{build → docs}/api/functions/copyToClipboard/index.html +7 -7
- package/docs/api/functions/createEnum/index.html +23 -0
- package/{build → docs}/api/functions/decodeHtml/index.html +6 -6
- package/{build → docs}/api/functions/deepCopy/index.html +6 -6
- package/{build → docs}/api/functions/delParam/index.html +6 -6
- package/{build → docs}/api/functions/encodeHtml/index.html +6 -6
- package/docs/api/functions/formatDate/index.html +16 -0
- package/{build → docs}/api/functions/getParam/index.html +6 -6
- package/docs/api/functions/getParamInt/index.html +16 -0
- package/{build → docs}/api/functions/getParams/index.html +6 -6
- package/{build → docs}/api/functions/hideLoading/index.html +6 -6
- package/docs/api/functions/initWindowMessage/index.html +16 -0
- package/{build → docs}/api/functions/parseDate/index.html +6 -6
- package/docs/api/functions/request/index.html +16 -0
- package/{build → docs}/api/functions/setParam/index.html +6 -6
- package/docs/api/functions/showLoading/index.html +16 -0
- package/{build → docs}/api/functions/sleep/index.html +6 -6
- package/docs/api/functions/toUrlParams/index.html +16 -0
- package/{build → docs}/api/globals/index.html +6 -6
- package/{build → docs}/api/index.html +5 -5
- package/{build → docs}/api/interfaces/IRequestOptions/index.html +6 -6
- package/{build → docs}/api/interfaces/IShowLoadingConfig/index.html +6 -6
- package/{build → docs}/api/variables/Request/index.html +6 -6
- package/{build/assets/css/styles.7386cae3.css → docs/assets/css/styles.077146e6.css} +1 -1
- package/{build/assets/js/cfbb2394.98f0002a.js → docs/assets/js/00078de9.173140af.js} +1 -1
- package/docs/assets/js/04050071.b3b813d2.js +1 -0
- package/docs/assets/js/08f709b9.bb9aaec2.js +1 -0
- package/docs/assets/js/094cfbf1.64e888ff.js +1 -0
- package/docs/assets/js/0c2147ef.22a9a26a.js +1 -0
- package/docs/assets/js/1501a739.33da7da3.js +1 -0
- package/docs/assets/js/1608b181.f8ebe997.js +1 -0
- package/docs/assets/js/194adc5f.3f8c66de.js +1 -0
- package/docs/assets/js/2ac048f8.e05a6f25.js +1 -0
- package/docs/assets/js/2e314e38.0c85c0e0.js +1 -0
- package/docs/assets/js/3b14ef11.66bab689.js +1 -0
- package/docs/assets/js/3ec39cd5.2ed05a62.js +1 -0
- package/docs/assets/js/6bc50bd8.aef6e92f.js +1 -0
- package/docs/assets/js/7891b53e.d158808a.js +1 -0
- package/{build/assets/js/982ac012.0b99c940.js → docs/assets/js/8b76e124.81bfed83.js} +1 -1
- package/docs/assets/js/9104954f.ca7e3c49.js +1 -0
- package/docs/assets/js/92b7d874.2abc7844.js +1 -0
- package/docs/assets/js/9334cb7c.728e3930.js +1 -0
- package/docs/assets/js/935f2afb.a8948813.js +1 -0
- package/docs/assets/js/969412eb.fd816377.js +1 -0
- package/docs/assets/js/9be94766.3025327f.js +1 -0
- package/docs/assets/js/9dd5329b.ea3ca743.js +1 -0
- package/docs/assets/js/ab2af742.4d5a6a91.js +1 -0
- package/docs/assets/js/ba6f0f15.354d08f6.js +1 -0
- package/docs/assets/js/ccb851b4.d3793804.js +1 -0
- package/docs/assets/js/d4323bca.607d9dab.js +1 -0
- package/docs/assets/js/e2aa7f69.a6fdcea3.js +1 -0
- package/docs/assets/js/f7d87c57.c068bff5.js +1 -0
- package/docs/assets/js/f97ec998.1e303b3c.js +1 -0
- package/docs/assets/js/fc1c80db.04c70e96.js +1 -0
- package/docs/assets/js/fdb649b1.c7a470c8.js +1 -0
- package/{build/assets/js/main.4125cc03.js → docs/assets/js/main.59fb527f.js} +2 -2
- package/docs/assets/js/runtime~main.48288ccf.js +1 -0
- package/docs/demos/IcePkgDemo_doc_01_request_0/index.html +16 -0
- package/docs/demos/IcePkgDemo_doc_02_time_0/index.html +16 -0
- package/docs/demos/IcePkgDemo_doc_03_loading_0/index.html +16 -0
- package/{build → docs}/index.html +5 -5
- package/{build → docs}/loading/index.html +19 -19
- package/{build → docs}/request/index.html +19 -19
- package/docs/sitemap.xml +1 -0
- package/{build → docs}/time/index.html +19 -19
- package/es/bb1b9025.esm.es5.production.mjs +1 -0
- package/es/index.mjs +1 -0
- package/esm/enum.d.ts +30 -0
- package/esm/enum.js +50 -0
- package/esm/index.d.ts +3 -28
- package/esm/index.js +3 -73
- package/esm/loading.js +13 -8
- package/esm/message.d.ts +12 -0
- package/esm/message.js +215 -0
- package/esm/other.d.ts +28 -0
- package/esm/other.js +73 -0
- package/esm/time.js +2 -3
- package/package.json +18 -14
- package/umd/index.js +1 -0
- package/build/api/functions/formatDate/index.html +0 -16
- package/build/api/functions/getParamInt/index.html +0 -16
- package/build/api/functions/request/index.html +0 -16
- package/build/api/functions/showLoading/index.html +0 -16
- package/build/api/functions/toUrlParams/index.html +0 -16
- package/build/assets/js/1e8774bf.a8076694.js +0 -1
- package/build/assets/js/2b9e9ebb.8b1bb2e0.js +0 -1
- package/build/assets/js/358cbd84.214cbcce.js +0 -1
- package/build/assets/js/3f625ddf.fafbd287.js +0 -1
- package/build/assets/js/3ff0b6ff.4aa3b03c.js +0 -1
- package/build/assets/js/4b7ca2c5.d374f1d8.js +0 -1
- package/build/assets/js/5073eb2c.5dbc3b80.js +0 -1
- package/build/assets/js/54d7cbb7.b9fd0fad.js +0 -1
- package/build/assets/js/6078fdd3.eef71966.js +0 -1
- package/build/assets/js/6392a959.a5fa60d1.js +0 -1
- package/build/assets/js/83c40e8c.4693dc24.js +0 -1
- package/build/assets/js/873da38a.256d0c8c.js +0 -1
- package/build/assets/js/935f2afb.e0378f63.js +0 -1
- package/build/assets/js/981cc417.b7073788.js +0 -1
- package/build/assets/js/9c41fa8d.9a95f783.js +0 -1
- package/build/assets/js/9d165430.29db1f9b.js +0 -1
- package/build/assets/js/9d56384c.c18bf977.js +0 -1
- package/build/assets/js/a6679872.549f32da.js +0 -1
- package/build/assets/js/a7c15914.45b7f495.js +0 -1
- package/build/assets/js/af2154c4.293659ba.js +0 -1
- package/build/assets/js/c1e910ce.185449fd.js +0 -1
- package/build/assets/js/c377a04b.ef55c8e9.js +0 -1
- package/build/assets/js/c6ecbd42.0ae84add.js +0 -1
- package/build/assets/js/ce34ed50.06b31f6a.js +0 -1
- package/build/assets/js/d7207929.b11b2b8c.js +0 -1
- package/build/assets/js/d9e679a2.8f6eedd6.js +0 -1
- package/build/assets/js/ed709621.3d98a8ef.js +0 -1
- package/build/assets/js/runtime~main.a83f69d1.js +0 -1
- package/build/demos/IcePkgDemo_docs_01_request_0/index.html +0 -16
- package/build/demos/IcePkgDemo_docs_02_time_0/index.html +0 -16
- package/build/demos/IcePkgDemo_docs_03_loading_0/index.html +0 -16
- package/build/sitemap.xml +0 -1
- package/dist/53aa46fe.esm.es5.production.js +0 -1
- package/dist/index.esm.es5.production.js +0 -1
- package/dist/index.umd.es5.production.js +0 -1
- /package/{build → docs}/assets/images/iphoneX-1fc37282d0e9b32fcd03fd96f461e7d5.png +0 -0
- /package/{build → docs}/assets/js/17896441.6674ffec.js +0 -0
- /package/{build → docs}/assets/js/1be78505.537008e6.js +0 -0
- /package/{build → docs}/assets/js/638.7a9f2ae8.js +0 -0
- /package/{build → docs}/assets/js/638.7a9f2ae8.js.LICENSE.txt +0 -0
- /package/{build → docs}/assets/js/7263d0e6.ab50c755.js +0 -0
- /package/{build → docs}/assets/js/774.fa0d167d.js +0 -0
- /package/{build → docs}/assets/js/830.d8724ce6.js +0 -0
- /package/{build → docs}/assets/js/888.800281f1.js +0 -0
- /package/{build → docs}/assets/js/888.800281f1.js.LICENSE.txt +0 -0
- /package/{build → docs}/assets/js/ef3f9d02.841c2fab.js +0 -0
- /package/{build/assets/js/main.4125cc03.js.LICENSE.txt → docs/assets/js/main.59fb527f.js.LICENSE.txt} +0 -0
package/cjs/enum.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type EnumItem<K extends string, V extends string | number> = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: V;
|
|
4
|
+
key: K;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
type EnumType<T extends ReadonlyArray<EnumItem<string, string | number>>> = T & {
|
|
8
|
+
[K in T[number]['key']]: Extract<T[number], {
|
|
9
|
+
key: K;
|
|
10
|
+
}>['value'];
|
|
11
|
+
} & {
|
|
12
|
+
pick: (keyOrValue: string | number) => T[number] | undefined;
|
|
13
|
+
pickLabel: (keyOrValue: string | number) => T[number]['label'] | undefined;
|
|
14
|
+
pickValue: (keyOrValue: string | number) => T[number]['value'] | undefined;
|
|
15
|
+
pickKey: (keyOrValue: string | number) => T[number]['key'] | undefined;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 创建一个枚举,支持多种高级用法:
|
|
19
|
+
* const enums = createEnum([{ key: 'MAN', label: '男', value: 1 }])
|
|
20
|
+
* console.log(enums.MAN) // 1
|
|
21
|
+
* console.log(enums.pick('MAN')) // 对象
|
|
22
|
+
* console.log(enums.pick(1)) // 对象
|
|
23
|
+
* console.log(enums.pickLabel('MAN')) // 男
|
|
24
|
+
* console.log(enums.pickValue('MAN')) // 1
|
|
25
|
+
* console.log(enums) // 数组对象
|
|
26
|
+
* @param items
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
export declare function createEnum<T extends ReadonlyArray<EnumItem<string, string | number>>>(items: T): EnumType<T>;
|
|
30
|
+
export {};
|
package/cjs/enum.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "createEnum", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return createEnum;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _toConsumableArray = require("@swc/helpers/lib/_to_consumable_array.js").default;
|
|
12
|
+
function createEnum(items) {
|
|
13
|
+
var enumArray = _toConsumableArray(items);
|
|
14
|
+
// 添加枚举键值对
|
|
15
|
+
items.forEach(function(item) {
|
|
16
|
+
enumArray[item.key] = item.value;
|
|
17
|
+
});
|
|
18
|
+
// 实现pick方法
|
|
19
|
+
enumArray.pick = function(keyOrValue) {
|
|
20
|
+
return items.find(function(item) {
|
|
21
|
+
return item.key === keyOrValue || item.value === keyOrValue;
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
enumArray.pickLabel = function(keyOrValue) {
|
|
25
|
+
var _enumArray_pick;
|
|
26
|
+
return (_enumArray_pick = enumArray.pick(keyOrValue)) === null || _enumArray_pick === void 0 ? void 0 : _enumArray_pick.label;
|
|
27
|
+
};
|
|
28
|
+
enumArray.pickValue = function(keyOrValue) {
|
|
29
|
+
var _enumArray_pick;
|
|
30
|
+
return (_enumArray_pick = enumArray.pick(keyOrValue)) === null || _enumArray_pick === void 0 ? void 0 : _enumArray_pick.value;
|
|
31
|
+
};
|
|
32
|
+
enumArray.pickKey = function(keyOrValue) {
|
|
33
|
+
var _enumArray_pick;
|
|
34
|
+
return (_enumArray_pick = enumArray.pick(keyOrValue)) === null || _enumArray_pick === void 0 ? void 0 : _enumArray_pick.key;
|
|
35
|
+
};
|
|
36
|
+
return enumArray;
|
|
37
|
+
} // 使用示例
|
|
38
|
+
// const genders = createEnum([
|
|
39
|
+
// { label: '男', value: 1, key: 'MAN', a: 1 },
|
|
40
|
+
// { label: '女', value: '2', key: 'WOMAN' },
|
|
41
|
+
// ] as const);
|
|
42
|
+
// console.log(genders.MAN); // 鼠标悬停显示类型为 1
|
|
43
|
+
// console.log(genders.pick('MAN')); // 返回MAN的完整对象
|
|
44
|
+
// console.log(genders.pick(1)); // 返回MAN的完整对象
|
|
45
|
+
// console.log(genders.pickLabel(1)); // 返回 男
|
|
46
|
+
// console.log(genders.pickValue('MAN')); // 1
|
|
47
|
+
// console.log(genders.pickKey(1)); // MAN
|
|
48
|
+
// console.log(genders); // 输出完整数组
|
|
49
|
+
// console.log(genders.length); // 输出2
|
package/cjs/index.d.ts
CHANGED
|
@@ -1,32 +1,7 @@
|
|
|
1
|
+
export * from './enum';
|
|
1
2
|
export * from './loading';
|
|
3
|
+
export * from './message';
|
|
4
|
+
export * from './other';
|
|
2
5
|
export * from './param';
|
|
3
6
|
export * from './request';
|
|
4
7
|
export * from './time';
|
|
5
|
-
/**
|
|
6
|
-
* 基于JSON的简单深拷贝
|
|
7
|
-
* @param obj 要复制的对象,非对象格式会直接返回
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
export declare const deepCopy: (obj: any) => any;
|
|
11
|
-
/**
|
|
12
|
-
* HTML编码,例如将 【"】 变成 【"】
|
|
13
|
-
* @param {*} html 待编码的原始字符串,如果传入对象会遍历处理
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
export declare const encodeHtml: (html: string | any) => any;
|
|
17
|
-
/**
|
|
18
|
-
* HTML解码,例如将 【"】 变成 【"】
|
|
19
|
-
* @param {*} html 已经被HTML编码过的字符串,如果传入对象会遍历处理
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
export declare const decodeHtml: (html: string | any) => any;
|
|
23
|
-
/**
|
|
24
|
-
* 复制一段文本到剪贴板,如果失败会抛出异常,推荐使用姿势:
|
|
25
|
-
* await copyTextToClipboard('要复制的文本', message => alert(`复制到剪贴板失败:${message}`));
|
|
26
|
-
* alert('复制到剪贴板成功!');
|
|
27
|
-
* @param {*} text 要复制的文本
|
|
28
|
-
* @param {*} onFailure 失败回调,接受一个 message 参数
|
|
29
|
-
* @param {*} supportSilent 是否支持后台静默复制,如果是则优先采用 execCommand
|
|
30
|
-
* @returns
|
|
31
|
-
*/
|
|
32
|
-
export declare const copyToClipboard: (text: string, onFailure: (message: string) => void, supportSilent: boolean) => Promise<void>;
|
package/cjs/index.js
CHANGED
|
@@ -2,81 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
deepCopy: function() {
|
|
13
|
-
return deepCopy;
|
|
14
|
-
},
|
|
15
|
-
encodeHtml: function() {
|
|
16
|
-
return encodeHtml;
|
|
17
|
-
},
|
|
18
|
-
decodeHtml: function() {
|
|
19
|
-
return decodeHtml;
|
|
20
|
-
},
|
|
21
|
-
copyToClipboard: function() {
|
|
22
|
-
return copyToClipboard;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
5
|
var _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./enum"), exports);
|
|
26
7
|
_exportStar(require("./loading"), exports);
|
|
8
|
+
_exportStar(require("./message"), exports);
|
|
9
|
+
_exportStar(require("./other"), exports);
|
|
27
10
|
_exportStar(require("./param"), exports);
|
|
28
11
|
_exportStar(require("./request"), exports);
|
|
29
12
|
_exportStar(require("./time"), exports);
|
|
30
|
-
var deepCopy = function(obj) {
|
|
31
|
-
if (!obj || typeof obj !== "object") return obj;
|
|
32
|
-
return JSON.parse(JSON.stringify(obj));
|
|
33
|
-
};
|
|
34
|
-
var encodeHtml = function(html) {
|
|
35
|
-
if (typeof html === "string") {
|
|
36
|
-
var div = document.createElement("div");
|
|
37
|
-
div.innerText = html;
|
|
38
|
-
return div.innerHTML;
|
|
39
|
-
} else if (typeof html === "object" && html) for(var i in html)html[i] = encodeHtml(html[i]);
|
|
40
|
-
return html;
|
|
41
|
-
};
|
|
42
|
-
var decodeHtml = function(html) {
|
|
43
|
-
if (typeof html === "string") {
|
|
44
|
-
var div = document.createElement("div");
|
|
45
|
-
div.innerHTML = html;
|
|
46
|
-
return div.innerText;
|
|
47
|
-
} else if (typeof html === "object" && html) for(var i in html)html[i] = decodeHtml(html[i]);
|
|
48
|
-
return html;
|
|
49
|
-
};
|
|
50
|
-
var copyToClipboard = function(text, onFailure, supportSilent) {
|
|
51
|
-
if (!text) throw new Error("text can not be empty.");
|
|
52
|
-
onFailure = onFailure || function(msg) {
|
|
53
|
-
return console.error("复制到剪贴板失败:".concat(msg || ""));
|
|
54
|
-
};
|
|
55
|
-
// 优先采用现代化API
|
|
56
|
-
if (navigator.clipboard && !supportSilent) // 注意 writeText API 要求:文档被激活 & 页面已启用HTTPS
|
|
57
|
-
return navigator.clipboard.writeText(text).catch(function(e) {
|
|
58
|
-
onFailure(e.message);
|
|
59
|
-
throw e;
|
|
60
|
-
});
|
|
61
|
-
// execCommand 原本是一个同步API,这里为了和 writeText 保持一致统一包成proimse
|
|
62
|
-
return new Promise(function(resolve, reject) {
|
|
63
|
-
var input = document.createElement("input");
|
|
64
|
-
input.value = text;
|
|
65
|
-
input.style.cssText = "position:fixed;left:0;top:0;opacity:0;";
|
|
66
|
-
document.body.appendChild(input);
|
|
67
|
-
input.select();
|
|
68
|
-
try {
|
|
69
|
-
if (document.execCommand("copy")) resolve();
|
|
70
|
-
else {
|
|
71
|
-
var message = "Failed to execute 'document.execCommand'.";
|
|
72
|
-
onFailure(message);
|
|
73
|
-
reject(new Error(message));
|
|
74
|
-
}
|
|
75
|
-
} catch (e) {
|
|
76
|
-
onFailure(e.message);
|
|
77
|
-
reject(e);
|
|
78
|
-
} finally{
|
|
79
|
-
document.body.removeChild(input);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
};
|
package/cjs/loading.js
CHANGED
|
@@ -19,14 +19,14 @@ _export(exports, {
|
|
|
19
19
|
var showLoading = function() {
|
|
20
20
|
var text = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "请稍候", seconds = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10, config = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
21
21
|
var defaultConfig = {
|
|
22
|
-
hasMask:
|
|
23
|
-
maskColor: "
|
|
22
|
+
hasMask: false,
|
|
23
|
+
maskColor: "#00000070",
|
|
24
24
|
onCancel: null,
|
|
25
25
|
cancelInline: false,
|
|
26
26
|
id: "com_global_page_loading"
|
|
27
27
|
};
|
|
28
28
|
config = Object.assign({}, defaultConfig, config);
|
|
29
|
-
var id = config.id;
|
|
29
|
+
var id = config.id, hasMask = config.hasMask, maskColor = config.maskColor, onCancel = config.onCancel, cancelInline = config.cancelInline;
|
|
30
30
|
var timeoutKey = "_".concat(id, "_timeout");
|
|
31
31
|
if (window[timeoutKey]) clearTimeout(window[timeoutKey]);
|
|
32
32
|
var dom = document.getElementById(id);
|
|
@@ -40,18 +40,23 @@ var showLoading = function() {
|
|
|
40
40
|
if (!document.getElementById(styleId)) {
|
|
41
41
|
var style = document.createElement("style");
|
|
42
42
|
style.id = styleId;
|
|
43
|
-
style.innerHTML = "\n .".concat(id, " {\n position: fixed;\n top:
|
|
43
|
+
style.innerHTML = "\n .".concat(id, " {\n position: fixed;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n z-index: 10000;\n }\n .").concat(id, ".show-mask {\n pointer-events: unset;\n background: #00000070;\n }\n .").concat(id, " .mask-wrapper {\n position: fixed;\n }\n .").concat(id, " .loading-wrapper {\n width: 120px;\n height: 120px;\n z-index: 8000;\n background: rgba(0, 0, 0, 0.6);\n border-radius: 8px;\n text-align: center;\n color: white;\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n pointer-events: initial;\n line-height: 1.3;\n }\n .").concat(id, " .loading-wrapper img {\n width: 50px;\n height: 50px;\n margin-bottom: 10px;\n }\n .").concat(id, " .loading-wrapper a {\n color: #6ab2ff;\n }");
|
|
44
44
|
document.head.appendChild(style);
|
|
45
45
|
}
|
|
46
|
-
dom.innerHTML =
|
|
47
|
-
if (
|
|
46
|
+
dom.innerHTML = '\n <div class="loading-wrapper">\n <img src="https://img.alicdn.com/tfs/TB1bnUsQBLoK1RjSZFuXXXn0XXa-32-32.svg" alt="加载中">\n <div>\n <span>'.concat(text, "</span>\n ").concat(cancelInline ? "" : "<br />", "\n ").concat(onCancel ? '<a href="javascript:;" class="cancel">取消</a>' : "", "\n </div>\n </div>");
|
|
47
|
+
if (onCancel) {
|
|
48
48
|
var btn = dom.querySelector(".cancel");
|
|
49
49
|
btn && btn.addEventListener("click", function() {
|
|
50
50
|
hideLoading();
|
|
51
|
-
|
|
51
|
+
onCancel();
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
dom.
|
|
54
|
+
dom.addEventListener("click", function() {
|
|
55
|
+
hideLoading();
|
|
56
|
+
});
|
|
57
|
+
dom.style.display = "flex";
|
|
58
|
+
dom.style.background = hasMask ? maskColor : "transparent";
|
|
59
|
+
dom.className = "".concat(id, " ").concat(hasMask ? "show-mask" : "");
|
|
55
60
|
if (seconds > 0) window[timeoutKey] = setTimeout(function() {
|
|
56
61
|
hideLoading();
|
|
57
62
|
}, seconds * 1000);
|
package/cjs/message.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type onMessageListener = (eventName?: string, ...payload: any[]) => Promise<any> | any;
|
|
2
|
+
/**
|
|
3
|
+
* 初始化窗口通信
|
|
4
|
+
* @param {string} scene 场景,必传,互相通信的2个窗口必须保证 scene 相同
|
|
5
|
+
* @param {Window} targetWindow 目标窗口对象(父窗口或子窗口),互相通信时允许有一方不传,自动从 event.source 获取
|
|
6
|
+
* @returns {{postMessage: function, onMessage: function}} 返回postMessage和onMessage方法
|
|
7
|
+
*/
|
|
8
|
+
export declare function initWindowMessage(scene: string, targetWindow?: Window): {
|
|
9
|
+
postMessage: <T>(eventName: string, ...payload: any[]) => void | Promise<T>;
|
|
10
|
+
onMessage: (eventName: string, listener: onMessageListener) => void;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
package/cjs/message.js
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "initWindowMessage", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return initWindowMessage;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _asyncToGenerator = require("@swc/helpers/lib/_async_to_generator.js").default;
|
|
12
|
+
var _toConsumableArray = require("@swc/helpers/lib/_to_consumable_array.js").default;
|
|
13
|
+
var _tsGenerator = require("@swc/helpers/lib/_ts_generator.js").default;
|
|
14
|
+
function initWindowMessage(scene, targetWindow) {
|
|
15
|
+
var storageFunction = // 存储函数
|
|
16
|
+
function storageFunction(fn) {
|
|
17
|
+
var functionId = "".concat(fnPrefix).concat(getRandomId());
|
|
18
|
+
localFunctions[functionId] = fn;
|
|
19
|
+
return functionId;
|
|
20
|
+
};
|
|
21
|
+
var postMessage = /**
|
|
22
|
+
* 发送消息并等待响应
|
|
23
|
+
* @param {string} eventName 事件名称
|
|
24
|
+
* @param {*} [payload] 负载数据
|
|
25
|
+
* @returns {Promise} 返回一个Promise,resolve接收回调数据
|
|
26
|
+
*/ function postMessage(eventName) {
|
|
27
|
+
for(var _len = arguments.length, payload = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
28
|
+
payload[_key - 1] = arguments[_key];
|
|
29
|
+
}
|
|
30
|
+
if (!targetWindow) {
|
|
31
|
+
console.warn("TargetWindow is null.");
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
return new Promise(function(resolve, reject) {
|
|
35
|
+
var callbackId = getRandomId();
|
|
36
|
+
callbacks.set(callbackId, {
|
|
37
|
+
resolve: resolve,
|
|
38
|
+
reject: reject
|
|
39
|
+
});
|
|
40
|
+
targetWindow.postMessage({
|
|
41
|
+
scene: scene,
|
|
42
|
+
type: "event",
|
|
43
|
+
eventName: eventName,
|
|
44
|
+
payload: handleFunction(payload, function(item) {
|
|
45
|
+
return typeof item === "function" ? storageFunction(item) : item;
|
|
46
|
+
}),
|
|
47
|
+
callbackId: callbackId
|
|
48
|
+
}, "*");
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
var onMessage = /**
|
|
52
|
+
* 监听消息
|
|
53
|
+
* @param {string} eventName 事件名称
|
|
54
|
+
* @param {function} listener 监听函数(支持异步):(...params) => callbackValue
|
|
55
|
+
*/ function onMessage(eventName, listener) {
|
|
56
|
+
if (!eventListeners.has(eventName)) eventListeners.set(eventName, []);
|
|
57
|
+
eventListeners.get(eventName).push(listener);
|
|
58
|
+
};
|
|
59
|
+
// iframe模式下自动设置目标窗口
|
|
60
|
+
if (!targetWindow && window !== window.parent) targetWindow = window.parent;
|
|
61
|
+
// window.open模式下自动设置目标窗口
|
|
62
|
+
if (!targetWindow && window.opener) targetWindow = window.opener;
|
|
63
|
+
// 回调函数集合
|
|
64
|
+
var callbacks = new Map();
|
|
65
|
+
// 监听器集合
|
|
66
|
+
var eventListeners = new Map();
|
|
67
|
+
// 生成唯一ID
|
|
68
|
+
var getRandomId = function() {
|
|
69
|
+
return Math.random().toString(36).substring(2);
|
|
70
|
+
};
|
|
71
|
+
// postMessage不支持传递function,所以将其存储在本地,通过functionId做一层映射
|
|
72
|
+
var localFunctions = {};
|
|
73
|
+
var fnPrefix = "_local_function_";
|
|
74
|
+
// 简单循环处理function特殊参数,暂不考虑递归
|
|
75
|
+
var handleFunction = function(payload, handle) {
|
|
76
|
+
return (payload === null || payload === void 0 ? void 0 : payload.map(function(item) {
|
|
77
|
+
if (typeof item === "object") for(var key in item)item[key] = handle(item[key]);
|
|
78
|
+
return handle(item);
|
|
79
|
+
})) || [];
|
|
80
|
+
};
|
|
81
|
+
// 监听消息
|
|
82
|
+
window.addEventListener("message", function() {
|
|
83
|
+
var _ref = _asyncToGenerator(function(e) {
|
|
84
|
+
var _e_data, type, eventName, payload, callbackId, payloads, listeners, wildcardListeners, results, wildcardResults, result, error, callback;
|
|
85
|
+
return _tsGenerator(this, function(_state) {
|
|
86
|
+
switch(_state.label){
|
|
87
|
+
case 0:
|
|
88
|
+
// 过滤无效消息
|
|
89
|
+
if (!e.data || e.data.scene !== scene) return [
|
|
90
|
+
2
|
|
91
|
+
];
|
|
92
|
+
// console.log('收到来自这里的消息:', location.href, e.target.location.href, e.data);
|
|
93
|
+
// 始终根据 source 自动更新 targetWindow
|
|
94
|
+
// 父子iframe场景下,如果iframe经常动态销毁和重建,自动更新可以减少一些逻辑处理
|
|
95
|
+
targetWindow = e.source;
|
|
96
|
+
_e_data = e.data, type = _e_data.type, eventName = _e_data.eventName, payload = _e_data.payload, callbackId = _e_data.callbackId;
|
|
97
|
+
if (!(type === "event")) return [
|
|
98
|
+
3,
|
|
99
|
+
6
|
|
100
|
+
];
|
|
101
|
+
payloads = handleFunction(payload, function(item) {
|
|
102
|
+
if (typeof item === "string" && item.startsWith(fnPrefix)) {
|
|
103
|
+
// 由于我们是通过prefix来判断是否为本地函数,这里必须修改前缀避免再次被转换
|
|
104
|
+
var key = "getFn_".concat(item);
|
|
105
|
+
return function() {
|
|
106
|
+
for(var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++){
|
|
107
|
+
params[_key] = arguments[_key];
|
|
108
|
+
}
|
|
109
|
+
return postMessage.apply(void 0, [
|
|
110
|
+
"executeLocalFunction",
|
|
111
|
+
key
|
|
112
|
+
].concat(_toConsumableArray(params)));
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return item;
|
|
116
|
+
});
|
|
117
|
+
listeners = eventListeners.get(eventName) || [];
|
|
118
|
+
wildcardListeners = eventListeners.get("*") || [];
|
|
119
|
+
_state.label = 1;
|
|
120
|
+
case 1:
|
|
121
|
+
_state.trys.push([
|
|
122
|
+
1,
|
|
123
|
+
4,
|
|
124
|
+
,
|
|
125
|
+
5
|
|
126
|
+
]);
|
|
127
|
+
return [
|
|
128
|
+
4,
|
|
129
|
+
Promise.all(listeners.map(function(listener) {
|
|
130
|
+
return Promise.resolve(listener.apply(void 0, _toConsumableArray(payloads)));
|
|
131
|
+
}))
|
|
132
|
+
];
|
|
133
|
+
case 2:
|
|
134
|
+
results = _state.sent();
|
|
135
|
+
return [
|
|
136
|
+
4,
|
|
137
|
+
Promise.all(wildcardListeners.map(function(listener) {
|
|
138
|
+
return Promise.resolve(listener.apply(void 0, [
|
|
139
|
+
eventName
|
|
140
|
+
].concat(_toConsumableArray(payloads))));
|
|
141
|
+
}))
|
|
142
|
+
];
|
|
143
|
+
case 3:
|
|
144
|
+
wildcardResults = _state.sent();
|
|
145
|
+
// 如果有回调ID,将最后一个监听器的结果作为回调返回
|
|
146
|
+
if (callbackId) {
|
|
147
|
+
result = results[results.length - 1] || wildcardResults[wildcardResults.length - 1];
|
|
148
|
+
// 如果没有精确监听,且模糊匹配也没有返回值,不触发回调
|
|
149
|
+
// 精确监听和普通监听唯一的不同是,必须要有返回值才会触发回调
|
|
150
|
+
if (!listeners.length && !result) return [
|
|
151
|
+
2
|
|
152
|
+
];
|
|
153
|
+
targetWindow.postMessage({
|
|
154
|
+
scene: scene,
|
|
155
|
+
type: "callback",
|
|
156
|
+
callbackId: callbackId,
|
|
157
|
+
payload: result
|
|
158
|
+
}, "*");
|
|
159
|
+
}
|
|
160
|
+
return [
|
|
161
|
+
3,
|
|
162
|
+
5
|
|
163
|
+
];
|
|
164
|
+
case 4:
|
|
165
|
+
error = _state.sent();
|
|
166
|
+
console.error(error);
|
|
167
|
+
// 捕获错误并返回给调用方
|
|
168
|
+
if (callbackId) targetWindow.postMessage({
|
|
169
|
+
scene: scene,
|
|
170
|
+
type: "callback",
|
|
171
|
+
callbackId: callbackId,
|
|
172
|
+
error: error || "unknown error"
|
|
173
|
+
}, "*");
|
|
174
|
+
return [
|
|
175
|
+
3,
|
|
176
|
+
5
|
|
177
|
+
];
|
|
178
|
+
case 5:
|
|
179
|
+
return [
|
|
180
|
+
3,
|
|
181
|
+
7
|
|
182
|
+
];
|
|
183
|
+
case 6:
|
|
184
|
+
if (type === "callback" && callbackId) {
|
|
185
|
+
callback = callbacks.get(callbackId);
|
|
186
|
+
if (callback) {
|
|
187
|
+
if (e.data.error) callback.reject(e.data.error);
|
|
188
|
+
else callback.resolve(e.data.payload);
|
|
189
|
+
// 回调使用完删除
|
|
190
|
+
callbacks.delete(callbackId);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
_state.label = 7;
|
|
194
|
+
case 7:
|
|
195
|
+
return [
|
|
196
|
+
2
|
|
197
|
+
];
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
return function(e) {
|
|
202
|
+
return _ref.apply(this, arguments);
|
|
203
|
+
};
|
|
204
|
+
}());
|
|
205
|
+
onMessage("executeLocalFunction", function(functionId) {
|
|
206
|
+
for(var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
207
|
+
params[_key - 1] = arguments[_key];
|
|
208
|
+
}
|
|
209
|
+
var _localFunctions;
|
|
210
|
+
functionId = (functionId === null || functionId === void 0 ? void 0 : functionId.replace("getFn_", "")) || "";
|
|
211
|
+
if (!localFunctions[functionId]) throw new Error("未找到本地缓存方法:".concat(functionId));
|
|
212
|
+
return (_localFunctions = localFunctions)[functionId].apply(_localFunctions, _toConsumableArray(params));
|
|
213
|
+
});
|
|
214
|
+
// 如果2个窗口都没设置 targetWindow,自动连接探活
|
|
215
|
+
postMessage("auto-connect");
|
|
216
|
+
return {
|
|
217
|
+
postMessage: postMessage,
|
|
218
|
+
onMessage: onMessage
|
|
219
|
+
};
|
|
220
|
+
}
|
package/cjs/other.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 基于JSON的简单深拷贝
|
|
3
|
+
* @param obj 要复制的对象,非对象格式会直接返回
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
6
|
+
export declare const deepCopy: (obj: any) => any;
|
|
7
|
+
/**
|
|
8
|
+
* HTML编码,例如将 【"】 变成 【"】
|
|
9
|
+
* @param {*} html 待编码的原始字符串,如果传入对象会遍历处理
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const encodeHtml: (html: string | any) => any;
|
|
13
|
+
/**
|
|
14
|
+
* HTML解码,例如将 【"】 变成 【"】
|
|
15
|
+
* @param {*} html 已经被HTML编码过的字符串,如果传入对象会遍历处理
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare const decodeHtml: (html: string | any) => any;
|
|
19
|
+
/**
|
|
20
|
+
* 复制一段文本到剪贴板,如果失败会抛出异常,推荐使用姿势:
|
|
21
|
+
* await copyTextToClipboard('要复制的文本', message => alert(`复制到剪贴板失败:${message}`));
|
|
22
|
+
* alert('复制到剪贴板成功!');
|
|
23
|
+
* @param {*} text 要复制的文本
|
|
24
|
+
* @param {*} onFailure 失败回调,接受一个 message 参数
|
|
25
|
+
* @param {*} supportSilent 是否支持后台静默复制,如果是则优先采用 execCommand
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export declare const copyToClipboard: (text: string, onFailure: (message: string) => void, supportSilent: boolean) => Promise<void>;
|
package/cjs/other.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 基于JSON的简单深拷贝
|
|
3
|
+
* @param obj 要复制的对象,非对象格式会直接返回
|
|
4
|
+
* @returns
|
|
5
|
+
*/ "use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
function _export(target, all) {
|
|
10
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: all[name]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
_export(exports, {
|
|
16
|
+
deepCopy: function() {
|
|
17
|
+
return deepCopy;
|
|
18
|
+
},
|
|
19
|
+
encodeHtml: function() {
|
|
20
|
+
return encodeHtml;
|
|
21
|
+
},
|
|
22
|
+
decodeHtml: function() {
|
|
23
|
+
return decodeHtml;
|
|
24
|
+
},
|
|
25
|
+
copyToClipboard: function() {
|
|
26
|
+
return copyToClipboard;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
var deepCopy = function(obj) {
|
|
30
|
+
if (!obj || typeof obj !== "object") return obj;
|
|
31
|
+
return JSON.parse(JSON.stringify(obj));
|
|
32
|
+
};
|
|
33
|
+
var encodeHtml = function(html) {
|
|
34
|
+
if (typeof html === "string") {
|
|
35
|
+
var div = document.createElement("div");
|
|
36
|
+
div.innerText = html;
|
|
37
|
+
return div.innerHTML;
|
|
38
|
+
} else if (typeof html === "object" && html) for(var i in html)html[i] = encodeHtml(html[i]);
|
|
39
|
+
return html;
|
|
40
|
+
};
|
|
41
|
+
var decodeHtml = function(html) {
|
|
42
|
+
if (typeof html === "string") {
|
|
43
|
+
var div = document.createElement("div");
|
|
44
|
+
div.innerHTML = html;
|
|
45
|
+
return div.innerText;
|
|
46
|
+
} else if (typeof html === "object" && html) for(var i in html)html[i] = decodeHtml(html[i]);
|
|
47
|
+
return html;
|
|
48
|
+
};
|
|
49
|
+
var copyToClipboard = function(text, onFailure, supportSilent) {
|
|
50
|
+
if (!text) throw new Error("text can not be empty.");
|
|
51
|
+
onFailure = onFailure || function(msg) {
|
|
52
|
+
return console.error("复制到剪贴板失败:".concat(msg || ""));
|
|
53
|
+
};
|
|
54
|
+
// 优先采用现代化API
|
|
55
|
+
if (navigator.clipboard && !supportSilent) // 注意 writeText API 要求:文档被激活 & 页面已启用HTTPS
|
|
56
|
+
return navigator.clipboard.writeText(text).catch(function(e) {
|
|
57
|
+
onFailure(e.message);
|
|
58
|
+
throw e;
|
|
59
|
+
});
|
|
60
|
+
// execCommand 原本是一个同步API,这里为了和 writeText 保持一致统一包成proimse
|
|
61
|
+
return new Promise(function(resolve, reject) {
|
|
62
|
+
var input = document.createElement("input");
|
|
63
|
+
input.value = text;
|
|
64
|
+
input.style.cssText = "position:fixed;left:0;top:0;opacity:0;";
|
|
65
|
+
document.body.appendChild(input);
|
|
66
|
+
input.select();
|
|
67
|
+
try {
|
|
68
|
+
if (document.execCommand("copy")) resolve();
|
|
69
|
+
else {
|
|
70
|
+
var message = "Failed to execute 'document.execCommand'.";
|
|
71
|
+
onFailure(message);
|
|
72
|
+
reject(new Error(message));
|
|
73
|
+
}
|
|
74
|
+
} catch (e) {
|
|
75
|
+
onFailure(e.message);
|
|
76
|
+
reject(e);
|
|
77
|
+
} finally{
|
|
78
|
+
document.body.removeChild(input);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
};
|
package/cjs/time.js
CHANGED
|
@@ -29,7 +29,7 @@ var formatDate = function(date, fmt) {
|
|
|
29
29
|
var _loop = function(i) {
|
|
30
30
|
fmt = fmt.replace(new RegExp("".concat(i, "+"), "g"), function(m) {
|
|
31
31
|
var val = "".concat(obj[i]);
|
|
32
|
-
if (i === "w") return (m.length > 2 ? "星期" : "周")
|
|
32
|
+
if (i === "w") return "".concat(m.length > 2 ? "星期" : "周").concat(week[val]);
|
|
33
33
|
for(var j = 0, len = val.length; j < m.length - len; j++)val = "0".concat(val);
|
|
34
34
|
return m.length === 1 ? val : val.substring(val.length - m.length);
|
|
35
35
|
});
|
|
@@ -68,7 +68,6 @@ var formatDate = function(date, fmt) {
|
|
|
68
68
|
"五",
|
|
69
69
|
"六"
|
|
70
70
|
];
|
|
71
|
-
// eslint-disable-next-line guard-for-in
|
|
72
71
|
for(var i in obj)_loop(i);
|
|
73
72
|
return fmt;
|
|
74
73
|
};
|
|
@@ -86,7 +85,7 @@ var parseDate = function(str, fmt) {
|
|
|
86
85
|
};
|
|
87
86
|
fmt.replace(/([^yMdHmsS]*?)(([yMdHmsS])\3*)([^yMdHmsS]*?)/g, function(m, $1, $2, $3, $4) {
|
|
88
87
|
str = str.replace(new RegExp("".concat($1, "(\\d{").concat($2.length, "})").concat($4)), function(_m, _$1) {
|
|
89
|
-
obj[$3] = parseInt(_$1);
|
|
88
|
+
obj[$3] = parseInt(_$1, 10);
|
|
90
89
|
return "";
|
|
91
90
|
});
|
|
92
91
|
return "";
|
package/{build → docs}/404.html
RENAMED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="generator" content="Docusaurus v2.4.3">
|
|
6
|
-
<title data-rh="true">找不到页面 | youtil文档</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://your-docusaurus-test-site.com/404.html"><meta data-rh="true" name="docusaurus_locale" content="zh-Hans"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="zh-Hans"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="找不到页面 | youtil文档"><link data-rh="true" rel="icon" href="https://img.alicdn.com/imgextra/i2/O1CN01jUf9ZP1aKwVvEc58W_!!6000000003312-73-tps-160-160.ico"><link data-rh="true" rel="canonical" href="https://your-docusaurus-test-site.com/404.html"><link data-rh="true" rel="alternate" href="https://your-docusaurus-test-site.com/404.html" hreflang="zh-Hans"><link data-rh="true" rel="alternate" href="https://your-docusaurus-test-site.com/404.html" hreflang="x-default"><link rel="stylesheet" href="/assets/css/styles.
|
|
7
|
-
<link rel="preload" href="/assets/js/runtime~main.
|
|
8
|
-
<link rel="preload" href="/assets/js/main.
|
|
6
|
+
<title data-rh="true">找不到页面 | youtil文档</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://your-docusaurus-test-site.com/404.html"><meta data-rh="true" name="docusaurus_locale" content="zh-Hans"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="zh-Hans"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="找不到页面 | youtil文档"><link data-rh="true" rel="icon" href="https://img.alicdn.com/imgextra/i2/O1CN01jUf9ZP1aKwVvEc58W_!!6000000003312-73-tps-160-160.ico"><link data-rh="true" rel="canonical" href="https://your-docusaurus-test-site.com/404.html"><link data-rh="true" rel="alternate" href="https://your-docusaurus-test-site.com/404.html" hreflang="zh-Hans"><link data-rh="true" rel="alternate" href="https://your-docusaurus-test-site.com/404.html" hreflang="x-default"><link rel="stylesheet" href="/assets/css/styles.077146e6.css">
|
|
7
|
+
<link rel="preload" href="/assets/js/runtime~main.48288ccf.js" as="script">
|
|
8
|
+
<link rel="preload" href="/assets/js/main.59fb527f.js" as="script">
|
|
9
9
|
</head>
|
|
10
10
|
<body class="navigation-with-keyboard">
|
|
11
11
|
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
|
|
12
12
|
<div role="region" aria-label="跳到主要内容"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">跳到主要内容</a></div><nav aria-label="主导航" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/static/1.jpg" alt="" class="themedImage_ToTc themedImage--light_HNdA"><img src="/static/1.jpg" alt="" class="themedImage_ToTc themedImage--dark_i4oU"></div><b class="navbar__title text--truncate">youtil (油梯)</b></a></div><div class="navbar__items navbar__items--right"><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="切换浅色/暗黑模式(当前为浅色模式)" aria-label="切换浅色/暗黑模式(当前为浅色模式)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="searchBox_ZlJk"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><main class="container margin-vert--xl"><div class="row"><div class="col col--6 col--offset-3"><h1 class="hero__title">找不到页面</h1><p>我们找不到您要找的页面。</p><p>请联系原始链接来源网站的所有者,并告知他们链接已损坏。</p></div></div></main></div></div>
|
|
13
|
-
<script src="/assets/js/runtime~main.
|
|
14
|
-
<script src="/assets/js/main.
|
|
13
|
+
<script src="/assets/js/runtime~main.48288ccf.js"></script>
|
|
14
|
+
<script src="/assets/js/main.59fb527f.js"></script>
|
|
15
15
|
</body>
|
|
16
16
|
</html>
|