瀏覽代碼

improve the name space

tags/2.16.0
Caven Chen 3 年之前
父節點
當前提交
cac1789634
共有 2 個文件被更改,包括 15 次插入5 次删除
  1. 11
    1
      modules/global-api/lib-util.js
  2. 4
    4
      modules/namespace/index.js

+ 11
- 1
modules/global-api/lib-util.js 查看文件

@@ -5,10 +5,20 @@

const cache = {}

/**
* register lib
* @param name
* @param lib
*/
export function registerLib(name, lib) {
cache[name] = lib
}

export function getlib(name) {
/**
* get lib
* @param name
* @return {*}
*/
export function getLib(name) {
return cache[name]
}

+ 4
- 4
modules/namespace/index.js 查看文件

@@ -3,10 +3,10 @@
* @Date: 2021-03-15 18:36:48
*/

import { getlib } from '@dc-modules/global-api'
import { getLib } from '@dc-modules/global-api'

export const Cesium = getlib('Cesium')
export const Cesium = getLib('Cesium')

export const turf = getlib('turf')
export const turf = getLib('turf')

export const mapv = getlib('mapv')
export const mapv = getLib('mapv')

Loading…
取消
儲存