0

我想为不同的数据设置不同的maxlength,我尝试通过在maxlength中编写一个方法但它没有用,所以还有其他可能吗

<paper-input label="{{data.name}}" id="input" char-counter maxlength="getMaxLength()"></paper-input>
4

1 回答 1

2

使用属性并将最大长度设置为属性:

   <paper-input label="{{data.name}}" id="input" char-counter maxlength="[[maxValue]]"></paper-input>

使用方法并从方法返回值:

   <paper-input label="{{data.name}}" id="input" char-counter maxlength="[[getMaxLength()]]"></paper-input>
于 2017-11-15T09:34:49.977 回答