mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-05 09:47:20 +00:00
docs: ✏️ 补充对 transformThis2Context 的说明
This commit is contained in:
parent
facfa2afd6
commit
206a04eae8
@ -274,6 +274,7 @@ function isLiteralAtomicExpr(expr: string): boolean {
|
|||||||
* @param expr
|
* @param expr
|
||||||
*/
|
*/
|
||||||
function transformThis2Context(expr: string | Expression, customHandlers: CustomHandlerSet): string {
|
function transformThis2Context(expr: string | Expression, customHandlers: CustomHandlerSet): string {
|
||||||
|
// 下面这种字符串替换的方式虽然简单直接,但是对于复杂场景会误匹配,故后期改成了解析 AST 然后修改 AST 最后再重新生成代码的方式
|
||||||
// return expr
|
// return expr
|
||||||
// .replace(/\bthis\.item\./g, () => 'item.')
|
// .replace(/\bthis\.item\./g, () => 'item.')
|
||||||
// .replace(/\bthis\.index\./g, () => 'index.')
|
// .replace(/\bthis\.index\./g, () => 'index.')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user