amis icon indicating copy to clipboard operation
amis copied to clipboard

tpl js模版引擎会自动转义

Open snowing-x opened this issue 1 year ago • 0 comments

描述问题:

使用tpl js模版引擎时,如果聚焦在当前组件上,编辑js模版引擎内容后,< >会自动转义,导致不能正常渲染;如果聚焦在上层组件,直接编辑schema,是正常的。

如何复现(请务必完整填写下面内容):

  1. amis 版本是什么? 6.0.0

  2. 粘贴有问题的完整 amis schema 代码:

{
      "type": "tpl",
      "id": "u:eaaf2ea9ee1",
      "tpl": "<div><% if(data.a) {console.log(123, data.a)} %>aa</div>"
},
  1. 操作步骤 复制粘贴tpl schema,选中tpl组件,编辑js模版引擎内容

snowing-x avatar Apr 29 '24 06:04 snowing-x