[英]Using custom data-* attributes inside HTML5 <template> tag
I'm building a menu with a dom-repeat template like this: 我正在建立一个带有dom-repeat模板的菜单,如下所示:
<template is="dom-repeat" items="{{appletsMenu}}">
<a data-route="{{item.dataRoute}}" href="{{item.href}}">
<iron-icon icon="{{item.icon}}" src="{{item.iconSrc}}" ></iron-icon>
<span>{{item.name}}</span>
</a>
</template>
The data-route
attribute is not filled though in the generated DOM: 虽然在生成的DOM中未填充
data-route
属性:
<a href="...">...</a>
<a href="...">...</a>
It seems that the template only renders "normal" attributes like href
. 似乎该模板仅呈现“普通”属性,例如
href
。 Am I'm missing something? 我在想什么吗? Thanks.
谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.