Weex削除線付きtextをカスタマイズ
9999 ワード
style="flex: 1;align-items: center">
style="color:{{textColor}}; font-size:{{textSize}};">
{{textContent}}
class="line" style="background-color: {{lineColor}};
height: {{lineHeight}}; top: {{lineTop}};transform: rotate({{lineDeg}});">
</span><span style="color:rgb(232,191,106);">
</span><span style="color:rgb(232,191,106);"> </span>module.<span style="color:rgb(255,198,109);">exports </span>= {
<span style="color:rgb(152,118,170);">data</span>: {
<span style="color:rgb(152,118,170);">textContent</span>:<span style="color:rgb(106,135,89);">' '</span><span style="color:rgb(204,120,50);">,
</span><span style="color:rgb(204,120,50);"> </span><span style="color:rgb(152,118,170);">textSize</span>:<span style="color:rgb(106,135,89);">'60'</span><span style="color:rgb(204,120,50);">,
</span><span style="color:rgb(204,120,50);"> </span><span style="color:rgb(152,118,170);">textColor</span>: <span style="color:rgb(106,135,89);">'black'</span><span style="color:rgb(204,120,50);">,
</span><span style="color:rgb(204,120,50);"> </span><span style="color:rgb(152,118,170);">lineHeight</span>: <span style="color:rgb(106,135,89);">'2'</span><span style="color:rgb(204,120,50);">,
</span><span style="color:rgb(204,120,50);"> </span><span style="color:rgb(152,118,170);">lineColor</span>: <span style="color:rgb(106,135,89);">'red'</span><span style="color:rgb(204,120,50);">,
</span><span style="color:rgb(204,120,50);">
</span><span style="color:rgb(128,128,128);">//
</span><span style="color:rgb(128,128,128);"> </span><span style="color:rgb(152,118,170);">lineDeg</span>:<span style="color:rgb(106,135,89);">'0deg'</span><span style="color:rgb(204,120,50);">,
</span><span style="color:rgb(204,120,50);"> </span><span style="color:rgb(152,118,170);">lineTop</span>:<span style="color:rgb(106,135,89);">''</span><span style="color:rgb(204,120,50);">,
</span><span style="color:rgb(128,128,128);">// lineWidth:0,
</span><span style="color:rgb(128,128,128);"> </span>}<span style="color:rgb(204,120,50);">,
</span><span style="color:rgb(204,120,50);"> </span><span style="color:rgb(255,198,109);">ready</span>:<span style="color:rgb(204,120,50);"><strong>function</strong></span>(){
<span style="color:rgb(204,120,50);"><strong>this</strong></span>.<span style="color:rgb(152,118,170);">lineWidth </span>= <span style="color:rgb(204,120,50);"><strong>this</strong></span>.textContent.<span style="color:rgb(255,198,109);">length </span>* <span style="color:rgb(204,120,50);"><strong>this</strong></span>.textSize<span style="color:rgb(204,120,50);">;
</span><span style="color:rgb(204,120,50);"> </span>console.<span style="color:rgb(255,198,109);">log</span>(<span style="color:rgb(106,135,89);">'dlg==========='</span>+<span style="color:rgb(204,120,50);"><strong>this</strong></span>.<span style="color:rgb(152,118,170);">lineWidth</span>)<span style="color:rgb(204,120,50);">;
</span><span style="color:rgb(204,120,50);"> </span><span style="color:rgb(204,120,50);"><strong>this</strong></span>.<span style="color:rgb(152,118,170);">lineTop </span>= <span style="color:rgb(204,120,50);"><strong>this</strong></span>.textSize / <span style="color:rgb(104,151,187);">2</span><span style="color:rgb(204,120,50);">;
</span><span style="color:rgb(128,128,128);">// console.log('length===' + this.textContent.length+'textSize='+this.textSize+'this.lineTop'+this.lineTop);
</span><span style="color:rgb(128,128,128);"> </span><span style="color:rgb(204,120,50);"><strong>var </strong></span>hd = Math.<span style="color:rgb(255,198,109);">atan2</span>(<span style="color:rgb(204,120,50);"><strong>this</strong></span>.textSize<span style="color:rgb(204,120,50);">,</span><span style="color:rgb(204,120,50);"><strong>this</strong></span>.textContent.<span style="color:rgb(255,198,109);">length</span>*<span style="color:rgb(204,120,50);"><strong>this</strong></span>.textSize)<span style="color:rgb(204,120,50);">;
</span><span style="color:rgb(204,120,50);"> </span><span style="color:rgb(204,120,50);"><strong>var </strong></span>jd = <span style="color:rgb(104,151,187);">180 </span>*hd /Math.<span style="color:rgb(152,118,170);">PI</span><span style="color:rgb(204,120,50);">;
</span><span style="color:rgb(204,120,50);"> </span>jd -= <span style="color:rgb(104,151,187);">3</span><span style="color:rgb(204,120,50);">;</span><span style="color:rgb(128,128,128);">//
</span><span style="color:rgb(128,128,128);"> </span><span style="color:rgb(204,120,50);"><strong>this</strong></span>.<span style="color:rgb(152,118,170);">lineDeg </span>= <span style="color:rgb(106,135,89);">'-'</span>+jd+<span style="color:rgb(106,135,89);">'deg'</span><span style="color:rgb(204,120,50);">;
</span><span style="color:rgb(204,120,50);"> </span>}
}
<span style="color:rgb(232,191,106);">