File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "component" : true
3+ }
Original file line number Diff line number Diff line change 1+ <view class="zan-badge">
2+ <view
3+ class="zan-badge__text"
4+ style="color: {{ color }}; background-color: {{ backgroundColor }};font-size: {{ fontSize * 2 }}px; box-shadow: {{ boxShadow }};"
5+ >
6+ <slot></slot>
7+ </view>
8+ </view>
Original file line number Diff line number Diff line change 1+ .zan-badge{position:relative}.zan-badge__text{position:absolute;top:-.8em;right:0;height:1.6em;min-width:1.6em;line-height:1.6;padding:0 .4em;font-size:20px;border-radius:.8em;background:#f44;color:#fff;text-align:center;white-space:nowrap;-webkit-transform:translateX(50%) scale(.5);transform:translateX(50%) scale(.5);-webkit-transform-origin:center;transform-origin:center;z-index:10;box-shadow:0 0 0 2px #fff;box-sizing:border-box}
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ Component ( {
4+ relations : {
5+ '../btn/index' : {
6+ type : 'child' ,
7+ linked : function linked ( ) {
8+ updateBtnChild . call ( this ) ;
9+ } ,
10+ linkChange : function linkChange ( ) {
11+ updateBtnChild . call ( this ) ;
12+ } ,
13+ unlinked : function unlinked ( ) {
14+ updateBtnChild . call ( this ) ;
15+ }
16+ }
17+ }
18+ } ) ;
19+
20+ function updateBtnChild ( ) {
21+ var btns = this . getRelationNodes ( '../btn/index' ) ;
22+
23+ if ( btns . length > 0 ) {
24+ var lastIndex = btns . length - 1 ;
25+
26+ btns . forEach ( function ( btn , index ) {
27+ btn . switchLastButtonStatus ( index === lastIndex ) ;
28+ } ) ;
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments