mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:19:01 +08:00
优化 tpl 引入方式
This commit is contained in:
parent
e173c92e98
commit
6f62ad8b44
@ -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
Block a user