my-openlayer 2.4.1 → 2.4.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/core/VueTemplatePoint.js +7 -4
- package/package.json +1 -1
package/core/VueTemplatePoint.js
CHANGED
|
@@ -37,10 +37,13 @@ function detectVueSync() {
|
|
|
37
37
|
// 如果在Node.js环境中,尝试require
|
|
38
38
|
if (typeof window === 'undefined') {
|
|
39
39
|
try {
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
// 尝试获取 require 函数,避免使用 eval
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
const requireFunc = typeof __non_webpack_require__ === 'function' ? __non_webpack_require__ : (typeof module !== 'undefined' && module.require ? module.require : undefined);
|
|
43
|
+
if (requireFunc) {
|
|
44
|
+
Vue = requireFunc('vue');
|
|
45
|
+
isVue3 = !!(Vue.version?.startsWith('3') || Vue.createApp);
|
|
46
|
+
}
|
|
44
47
|
}
|
|
45
48
|
catch (e) {
|
|
46
49
|
ErrorHandler.getInstance().warn('Vue not found. Please ensure Vue is installed in your project.');
|