4

我有两个相同的纸质按钮,除了 ids:

<paper-button raisedButton
  id='rendered'
  label='patient'
  on-click='{{clickHandler}}'></paper-button>

<paper-button raisedButton
  id='no-render'
  label='patient'
  on-click='{{clickHandler}}'>
</paper-button>

第一个按钮使用其文本标签呈现,第二个按钮不使用文本标签呈现。唯一的区别是结束标签。我希望第二个按钮应该像第一个按钮一样呈现,但事实并非如此。这是一个错误吗?

另一个观察结果是按钮的标签始终默认为大写。这可以改变吗?

我正在使用聚合物 v 0.12.0-dev 和 Dart Editor 版本 1.6.0.dev_03_00 (DEV) Dart SDK 版本 1.6.0-dev.3.0。

4

1 回答 1

1

For the second button is rendered differently (without the caption) and I get the error message

Using textContent to label the button is deprecated. Use the "label" property instead 

Obviously the <paper-button> is designed to recognize if someone adds childnodes, which seems not to be supported.
The line break between opening and closing tag creates a TextNode children which changes the behavior of the button.

I guess there was a good intention in the way the button is designed but the result might cause more confustion than help.

I created a bug report https://github.com/Polymer/paper-button/issues/12

于 2014-07-13T09:33:26.833 回答