Bläddra i källkod

improve the name space

tags/2.16.0
Caven Chen 3 år sedan
förälder
incheckning
cac1789634
2 ändrade filer med 15 tillägg och 5 borttagningar
  1. 11
    1
      modules/global-api/lib-util.js
  2. 4
    4
      modules/namespace/index.js

+ 11
- 1
modules/global-api/lib-util.js Visa fil



const cache = {} const cache = {}


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


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

+ 4
- 4
modules/namespace/index.js Visa fil

* @Date: 2021-03-15 18:36:48 * @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')

Laddar…
Avbryt
Spara