我正在尝试在this example之后为纸张输入元素添加前缀。
<paper-input label="total">
<div prefix>$</div>
<paper-icon-button suffix icon="clear"></paper-icon-button>
</paper-input>
我主要担心的是,当我在Example.ui.xml
文件中编写该段代码时,eclipse编辑器会指出存在以下错误:
"Attribute 'prefix' has no value"
此外,如果我尝试执行代码,则会收到以下错误:
Compiling module com.dirigendo.test.Test
Computing all possible rebind results for 'com.dirigendo.test.client.Simulator.SimulatorUiBinder'
Rebinding com.dirigendo.test.client.Simulator.SimulatorUiBinder
Invoking generator com.google.gwt.uibinder.rebind.UiBinderGenerator
[ERROR] Attribute name "prefix" associated with an element type "div" must be followed by the ' = ' character.
[ERROR] Error parsing XML (line 22): Attribute name "prefix" associated with an element type "div" must be followed by the ' = ' character.
[ERROR] Errors in 'com/dirigendo/test/client/Simulator.java'
[ERROR] Line 12: Failed to resolve 'com.dirigendo.test.client.Simulator.SimulatorUiBinder' via deferred binding
[WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
[WARN] com.dirigendo.test.client.Simulator_SimulatorUiBinderImpl
Unification traversed 13255 fields and methods and 1072 types. 1049 are considered part of the current module and 1049 had all of their fields and methods traversed.
[ERROR] Compiler returned false
[WARN] recompile failed
[WARN] continuing to serve previous version
您能否解释一下如何停用此验证?我知道我可以使用一些环形交叉口,但我真的想要一个不涉及更改示例代码的解决方案。
答案 0 :(得分:0)
改为使用
<style type="text/css">
.dial1{
width:200px;
height: 100px;
display: block;
position: absolute;
background: #000;
color:#fff;
padding: 10px;
right: 0;
z-index: 9999;
}
.dial2{
width:200px;
height: 100px;
display: block;
position: absolute;
background: #000;
color:#fff;
padding: 10px;
right: 210px;
}
.hidediv{
-webkit-animation: hide 2s forwards;
-webkit-animation-iteration-count: 1;
-webkit-animation-delay: 5s;
animation: hide 2s forwards;
animation-iteration-count: 1;
animation-delay: 5s;
}
@-webkit-keyframes hide {
0% {
opacity: 1;
}
100% {
opacity: 0;
visibility:hidden;
display: none;
}
}
@keyframes hide {
0% {
opacity: 1;
}
100% {
opacity: 0;
visibility:hidden;
display: none;
}
}
.cssAnimation{
width:600px;
height: 300px;
position: absolute;
/* display: none; */
z-index: 9999;
}
@-webkit-keyframes slideInLeft {
0% {
opacity: 0;
-webkit-transform: translateX(-2000px);
transform: translateX(-2000px);
}
100% {
-webkit-transform: translateX(0);
transform: translateX(0);
}
}
@keyframes slideInLeft {
0% {
opacity: 0;
-webkit-transform: translateX(-2000px);
-ms-transform: translateX(-2000px);
transform: translateX(-2000px);
}
100% {
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
}
.slideInLeft {
-webkit-animation-name: slideInLeft;
animation-name: slideInLeft;
}
</style>
或
<div prefix="prefix">$</div>
Polymer只需要属性,对于有效的XML,它需要有一个值。聚合物只是忽略了这个值。