amis icon indicating copy to clipboard operation
amis copied to clipboard

报错:Unexpected template string expression no-template-curly-in-string

Open tanmengfei opened this issue 6 years ago • 4 comments

"tabsLabelTpl":"接口 ${index|plus}", 此行报错,网上查询应该为接口 ${index|plus} 但是这样写又不符合规范

tanmengfei avatar May 08 '20 15:05 tanmengfei

这个报错可能跟自己定义 filter 有关,自定义的 filter 的名字不要用中划线

2betop avatar May 09 '20 01:05 2betop

我自己没有定义filter 网上查询的是 ES6的新语法,在获取数据的时候比如${index|plus},小撇号使用 tab 键上面的引号 ``, 非 enter键旁边的引号''

tanmengfei avatar May 09 '20 06:05 tanmengfei

再多说点使用细节?报错内容?还有

ES6的新语法,在获取数据的时候比如${index|plus},小撇号使用 tab 键上面的引号 ``, 非 enter键旁边的引号''

这是要表达啥意思

RickCole21 avatar May 11 '20 09:05 RickCole21

仔细看了以下,我觉得这个问题可以忽略了,不是amis的问题,amis 的tpl 取变量语法确实跟 es6 里面的

`${xxx}`

中的变量取法很像。但是不要弄混了,是两个东西

2betop avatar May 11 '20 10:05 2betop