forked from p96170835/amis
优化 tpl 引入方式
This commit is contained in:
parent
4d81135021
commit
342f3cd793
|
@ -35,7 +35,7 @@ function lodashCompile(str: string, data: object) {
|
|||
defaultValue: filters.defaut,
|
||||
...imports
|
||||
};
|
||||
delete imports.default; // default 是个关键字,不能 imports 到 lodash 里面去。
|
||||
delete finnalImports.default; // default 是个关键字,不能 imports 到 lodash 里面去。
|
||||
const fn = template(str, {
|
||||
imports: finnalImports,
|
||||
variable: 'data'
|
||||
|
|
|
@ -15,6 +15,8 @@ export function reigsterTplEnginer(name: string, enginer: Enginer) {
|
|||
enginers[name] = enginer;
|
||||
}
|
||||
|
||||
[registerBulitin, registerLodash].forEach(fn => fn());
|
||||
|
||||
export function filter(
|
||||
tpl?: string,
|
||||
data: object = {},
|
||||
|
@ -75,5 +77,3 @@ export function evalJS(js: string, data: object): any {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[registerBulitin, registerLodash].forEach(fn => fn());
|
||||
|
|
Loading…
Reference in New Issue