0

我想根据元素中传递的属性显示模板。

 <template>
    <template is="dom-if" if="[[!multiLine]]">
        ..
    </template>
    <template is="dom-if" if="[[multiLine]]">
        ..
    </template>
</template>

在我通过的属性中

properties:{
   multiLine: {
        type: Boolean,
        value: false
    }
}

在 html 中我只能将多行作为属性传递。我怎样才能做到这一点?它总是在第一个。

4

1 回答 1

1

如果您在模板multi-line外部的元素中添加属性,则无论您传递的值如何,它总是会评估为在js中。dom-bindtruefalse

于 2015-06-02T18:58:27.717 回答