@neatui/nuxt 1.5.0 → 1.5.2
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/package.json
CHANGED
|
@@ -19,11 +19,16 @@
|
|
|
19
19
|
import { onBeforeUnmount, reactive, watch } from 'vue';
|
|
20
20
|
import { isFunction } from '@fekit/utils';
|
|
21
21
|
|
|
22
|
-
// 弹层队列
|
|
23
|
-
|
|
24
|
-
(window
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
// 弹层队列 - 兼容服务端渲染
|
|
23
|
+
const _tasks: any = (() => {
|
|
24
|
+
if (typeof window === 'undefined') {
|
|
25
|
+
return {}; // 服务端渲染时返回空对象
|
|
26
|
+
}
|
|
27
|
+
if (!(window as any)._FEKIT_LAYER_TASKS) {
|
|
28
|
+
(window as any)._FEKIT_LAYER_TASKS = {};
|
|
29
|
+
}
|
|
30
|
+
return (window as any)._FEKIT_LAYER_TASKS;
|
|
31
|
+
})();
|
|
27
32
|
|
|
28
33
|
// 获取活跃的弹层
|
|
29
34
|
const getActiveLayer = () => {
|
|
@@ -73,6 +78,7 @@
|
|
|
73
78
|
});
|
|
74
79
|
|
|
75
80
|
function disableScroll() {
|
|
81
|
+
if (typeof window === 'undefined') return;
|
|
76
82
|
state.top = document.documentElement.scrollTop;
|
|
77
83
|
const sw = window.innerWidth - document.documentElement.clientWidth;
|
|
78
84
|
state.sw = sw;
|
|
@@ -84,6 +90,7 @@
|
|
|
84
90
|
}
|
|
85
91
|
|
|
86
92
|
function enableScroll() {
|
|
93
|
+
if (typeof window === 'undefined') return;
|
|
87
94
|
document.body.style.removeProperty('overflow');
|
|
88
95
|
document.body.style.removeProperty('position');
|
|
89
96
|
document.body.style.removeProperty('top');
|