要使用AMP的binding feature,必须使用特殊属性,这些特殊属性用方括号将元素的属性包装并将其链接到表达式。这是AMP的示例:
<p [text]="'Hello ' + foo">Hello World</p>
<button on="tap:AMP.setState({foo: 'amp-bind'})">
问题是,当前没有@ types / amp,Typescript在我的JSX的第一个[
处抛出错误,提示[ts] identifier expected
。我也遇到了[ts] Left side of comma operator is unused and has no side effects.
最有可能通过正确的Typescript类型声明解决。有什么建议?
根据amp-bind component文档: