tdt-map-vue2 0.1.1 → 0.1.3

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/CHANGELOG.md CHANGED
@@ -7,3 +7,13 @@
7
7
  ## 0.1.1(2026-01-13)
8
8
 
9
9
  - gcoord插件移动到运行时依赖
10
+
11
+
12
+ ## 0.1.2(2026-01-14)
13
+
14
+ - 导出installMap方法,支持在vue项目中引入加载天地图
15
+
16
+ ## 0.1.3(2026-01-15)
17
+
18
+ - 将传入的tk存储到windows中,方便全局使用
19
+
package/index.js CHANGED
@@ -1,11 +1,13 @@
1
1
  import EnnTMap from './lib/BaseMap.vue'
2
2
  import { setTk } from './lib/utils/config'
3
+ import installMap from './lib/utils/installMap'
3
4
 
4
5
  const installTMap = {
5
6
  install(app,option) {
6
7
  const {tk} = option
7
- setTk(tk)
8
+ const config = setTk(tk)
9
+ console.log('installTMap中的tk', config)
8
10
  app.component('EnnTMap', EnnTMap)
9
11
  }
10
12
  }
11
- export { installTMap as default, EnnTMap }
13
+ export { installTMap as default, EnnTMap, installMap }
package/lib/BaseMap.vue CHANGED
@@ -102,6 +102,7 @@ export default {
102
102
 
103
103
  mounted() {
104
104
  console.log("----------initMap----------");
105
+ // 使用 props.tk,如果为空则使用全局配置的 tk
105
106
  installTMap(this.initMap, this.tk);
106
107
  },
107
108
 
@@ -2,8 +2,9 @@ export const config ={
2
2
  tk:''
3
3
  }
4
4
  export const getTk = () => {
5
- return config.tk
5
+ return config.tk || window._tk
6
6
  }
7
7
  export const setTk = (tk) => {
8
8
  config.tk = tk
9
+ window._tk = tk
9
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tdt-map-vue2",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "基于天地图封装的组件",
5
5
  "main": "index.js",
6
6
  "scripts": {