Skip to content

Commit 2d9982e

Browse files
committed
更新ZanUI最新组件
1 parent 7a9fa5c commit 2d9982e

4 files changed

Lines changed: 42 additions & 0 deletions

File tree

vendor/dist/badge/index.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"component": true
3+
}

vendor/dist/badge/index.wxml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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>

vendor/dist/badge/index.wxss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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}

vendor/dist/btn-group/index.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
}

0 commit comments

Comments
 (0)