mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-28 12:50:38 +00:00
refactor: accessLibrary 使用 utils 版本
This commit is contained in:
parent
58b8200fb2
commit
094c6b8dce
@ -20,6 +20,7 @@
|
||||
"@ali/lowcode-editor-skeleton": "^1.0.9-6",
|
||||
"@ali/lowcode-plugin-designer": "^1.0.9-6",
|
||||
"@ali/lowcode-plugin-outline-pane": "^1.0.9-6",
|
||||
"@ali/lowcode-utils": "^1.0.9-7",
|
||||
"@ali/ve-i18n-util": "^2.0.0",
|
||||
"@ali/ve-icons": "^4.1.9",
|
||||
"@ali/ve-less-variables": "2.0.3",
|
||||
|
||||
@ -16,6 +16,7 @@ import {
|
||||
upgradePropConfig,
|
||||
upgradeConfigure,
|
||||
} from './upgrade-metadata';
|
||||
import { accessLibrary } from '@ali/lowcode-utils';
|
||||
|
||||
import { designer } from '../editor';
|
||||
|
||||
@ -166,15 +167,6 @@ export interface OldGlobalPropConfig extends OldPropConfig {
|
||||
|
||||
const packageMaps: any = {};
|
||||
|
||||
function accessLibrary(library: string | object) {
|
||||
if (typeof library !== 'string') {
|
||||
return library;
|
||||
}
|
||||
|
||||
// TODO: enhance logic
|
||||
return (window as any)[library];
|
||||
}
|
||||
|
||||
export function setPackages(packages: Array<{ package: string; library: object | string }>) {
|
||||
packages.forEach((item) => {
|
||||
let lib: any;
|
||||
|
||||
@ -9,7 +9,7 @@ interface LibraryMap {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
function accessLibrary(library: string | Record<string, unknown>) {
|
||||
export function accessLibrary(library: string | Record<string, unknown>) {
|
||||
if (typeof library !== 'string') {
|
||||
return library;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user