mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-01 13:40:41 +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-editor-skeleton": "^1.0.9-6",
|
||||||
"@ali/lowcode-plugin-designer": "^1.0.9-6",
|
"@ali/lowcode-plugin-designer": "^1.0.9-6",
|
||||||
"@ali/lowcode-plugin-outline-pane": "^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-i18n-util": "^2.0.0",
|
||||||
"@ali/ve-icons": "^4.1.9",
|
"@ali/ve-icons": "^4.1.9",
|
||||||
"@ali/ve-less-variables": "2.0.3",
|
"@ali/ve-less-variables": "2.0.3",
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import {
|
|||||||
upgradePropConfig,
|
upgradePropConfig,
|
||||||
upgradeConfigure,
|
upgradeConfigure,
|
||||||
} from './upgrade-metadata';
|
} from './upgrade-metadata';
|
||||||
|
import { accessLibrary } from '@ali/lowcode-utils';
|
||||||
|
|
||||||
import { designer } from '../editor';
|
import { designer } from '../editor';
|
||||||
|
|
||||||
@ -166,15 +167,6 @@ export interface OldGlobalPropConfig extends OldPropConfig {
|
|||||||
|
|
||||||
const packageMaps: any = {};
|
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 }>) {
|
export function setPackages(packages: Array<{ package: string; library: object | string }>) {
|
||||||
packages.forEach((item) => {
|
packages.forEach((item) => {
|
||||||
let lib: any;
|
let lib: any;
|
||||||
|
|||||||
@ -9,7 +9,7 @@ interface LibraryMap {
|
|||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
function accessLibrary(library: string | Record<string, unknown>) {
|
export function accessLibrary(library: string | Record<string, unknown>) {
|
||||||
if (typeof library !== 'string') {
|
if (typeof library !== 'string') {
|
||||||
return library;
|
return library;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user