Преглед изворни кода

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…
Откажи
Сачувај