my-openlayer 1.0.6 → 1.0.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/core/VueTemplatePoint.js +6 -15
- package/package.json +1 -1
package/core/VueTemplatePoint.js
CHANGED
|
@@ -24,31 +24,22 @@ async function detectAndImportVue() {
|
|
|
24
24
|
Vue = null;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
//
|
|
27
|
+
// 浏览器环境的Vue检测
|
|
28
28
|
function detectVueSync() {
|
|
29
29
|
try {
|
|
30
|
-
//
|
|
30
|
+
// 从全局对象获取Vue(仅浏览器环境)
|
|
31
31
|
if (typeof window !== 'undefined' && window.Vue) {
|
|
32
32
|
Vue = window.Vue;
|
|
33
33
|
isVue3 = !!(Vue.version?.startsWith('3') || Vue.createApp);
|
|
34
|
-
return;
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// 使用eval来避免TypeScript编译时的require检查
|
|
40
|
-
const requireFunc = eval('require');
|
|
41
|
-
Vue = requireFunc('vue');
|
|
42
|
-
isVue3 = !!(Vue.version?.startsWith('3') || Vue.createApp);
|
|
43
|
-
}
|
|
44
|
-
catch (e) {
|
|
45
|
-
console.warn('Vue not found. Please ensure Vue is installed in your project.');
|
|
46
|
-
Vue = null;
|
|
47
|
-
}
|
|
35
|
+
else {
|
|
36
|
+
console.warn('Vue not found in global scope. Please ensure Vue is loaded before this library.');
|
|
37
|
+
Vue = null;
|
|
48
38
|
}
|
|
49
39
|
}
|
|
50
40
|
catch (e) {
|
|
51
41
|
console.warn('Failed to detect Vue:', e);
|
|
42
|
+
Vue = null;
|
|
52
43
|
}
|
|
53
44
|
}
|
|
54
45
|
// 初始化Vue导入
|