[英]How to create id in element in template when I have passed parameter?
How to create id in element in template when I have passed parameter ? 传递参数后,如何在模板中的元素中创建ID? I have tried something like
我已经尝试过类似的东西
<button id="p_"+{{key}} >TEST</button>
but in rendered HTML id is just p_ . 但在呈现的HTML中,id仅为p_ 。 Can someone tell me how to achieve this ?
有人可以告诉我如何实现吗?
<button id="p_{{key}}">TEST</button>
you need the key to be Inside the quotes 您需要将密钥放在引号内
I'm assuming you were using +
to concat strings. 我假设您使用
+
连接字符串。 I don't believe html supports any operations like that. 我不相信html支持任何这样的操作。
<button id="p_{{key}}">TEST</button>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.