我正在使用Polymer 1.0进行项目。我有<paper-input>
,我想设置占位符值。
我尝试设置value
:
<paper-input value="default value"></paper-input>
但它并没有改变占位符。我也试过label
:
<paper-input label="default value"></paper-input>
但这也不会改变占位符。如何设置占位符?
答案 0 :(得分:1)
像这样使用<paper-input>.placeholder
:
<paper-input placeholder="Enter a number"></paper-input>
<head>
<base href="https://polygit.org/polymer+1.7.1/components/">
<script src="webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="polymer/polymer.html">
<link rel="import" href="paper-input/paper-input.html">
</head>
<body>
<paper-input placeholder="Enter a number"></paper-input>
</body>
&#13;