[英]Polymer 1.0 Dom-if check with attribute
I want to show template according to the attribute passed in the element. 我想根据元素中传递的属性显示模板。
Say 说
<template>
<template is="dom-if" if="[[!multiLine]]">
..
</template>
<template is="dom-if" if="[[multiLine]]">
..
</template>
</template>
in properties I pass 在我通过的属性中
properties:{
multiLine: {
type: Boolean,
value: false
}
}
and in the html I can only pass multi-line as attribute. 在html中,我只能通过多行作为属性。 How can I achieve this?
我该如何实现? Its always going in the first one.
它总是在第一个中进行。
如果您在dom-bind
模板之外的元素中添加multi-line
属性,则无论传递的值如何, multi-line
属性始终为true
,尽管您可以通过完全不在元素上添加属性来将其设置为false
。或在js中将其设置为伪造的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.