Skip to content

Commit 36b9b88

Browse files
authored
feat:发布版本0.5.8 (#360)
tabs动态更新属性 解决water-flow组件bug
2 parents f697d00 + b5fa345 commit 36b9b88

File tree

15 files changed

+234
-133
lines changed

15 files changed

+234
-133
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<div align="center">
1818

1919
![](https://img.shields.io/badge/build-passing-00d508.svg)
20-
![](https://img.shields.io/badge/version-0.5.7-3963bc.svg)
20+
![](https://img.shields.io/badge/version-0.5.8-3963bc.svg)
2121
![](https://img.shields.io/badge/license-MIT-3963bc.svg)
2222

2323
</div>
@@ -39,7 +39,7 @@ Lin UI 是基于 **微信小程序原生语法** 实现的组件库。遵循简
3939

4040
## 最新版本
4141

42-
核心库:0.5.7
42+
核心库:0.5.8
4343

4444
示例工程:0.0.1-alpha.2
4545

dist/tabpanel/index.js

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,63 @@
11
// components/tab/index.js
22
Component({
3-
externalClasses: ['v-tab-active', 'tab-default'],
3+
externalClasses: ["v-tab-active", "tab-default"],
44
relations: {
5-
'../tabs/index': {
6-
type: 'parent'
5+
"../tabs/index": {
6+
type: "parent",
7+
linked: function(target) {
8+
!this.data.parent && this.setData({
9+
parent: target
10+
});
11+
// 每次被插入到custom-ul时执行,target是custom-ul节点实例对象,触发在attached生命周期之后
12+
}
713
},
8-
'../combined-tabs/index': {
9-
type: 'parent'
14+
"../combined-tabs/index": {
15+
type: "parent",
16+
linked: function(target) {
17+
!this.data.parent && this.setData({
18+
parent: target
19+
});
20+
// 每次被插入到custom-ul时执行,target是custom-ul节点实例对象,触发在attached生命周期之后
21+
}
1022
}
1123
},
1224
/**
1325
* 组件的属性列表
1426
*/
1527
properties: {
1628
tab: String,
17-
subTab:String,
18-
subKey:String,
29+
subTab: String,
30+
subKey: String,
1931
key: String,
20-
icon:String,
21-
iconStyle:String,
22-
image:Object,
23-
picPlacement:{
24-
type:String,
25-
value:'top'
26-
},
32+
icon: String,
33+
iconStyle: String,
34+
image: Object,
35+
picPlacement: {
36+
type: String,
37+
value: "top"
38+
}
39+
},
40+
41+
observers: {
42+
"**": function(filed) {
43+
this.updateData(filed);
44+
}
2745
},
28-
2946

3047
/**
3148
* 组件的初始数据
3249
*/
3350
data: {
3451
isCurrent: false,
35-
index:0,
52+
index: 0,
53+
parent: null
3654
},
3755

38-
methods:{
39-
56+
methods: {
57+
updateData(filed) {
58+
let parent = this.data.parent;
59+
if (!parent) return;
60+
parent.initTabs()
61+
}
4062
}
41-
})
63+
});
File renamed without changes.

components/water-flow/index.json renamed to dist/water-flow/index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"component": true,
33
"usingComponents": {},
44
"componentGenerics": {
5-
"l-water-flow-item": true
5+
"l-water-flow-item": "true"
66
}
77
}
File renamed without changes.
File renamed without changes.

examples/dist/tabpanel/index.js

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,63 @@
11
// components/tab/index.js
22
Component({
3-
externalClasses: ['v-tab-active', 'tab-default'],
3+
externalClasses: ["v-tab-active", "tab-default"],
44
relations: {
5-
'../tabs/index': {
6-
type: 'parent'
5+
"../tabs/index": {
6+
type: "parent",
7+
linked: function(target) {
8+
!this.data.parent && this.setData({
9+
parent: target
10+
});
11+
// 每次被插入到custom-ul时执行,target是custom-ul节点实例对象,触发在attached生命周期之后
12+
}
713
},
8-
'../combined-tabs/index': {
9-
type: 'parent'
14+
"../combined-tabs/index": {
15+
type: "parent",
16+
linked: function(target) {
17+
!this.data.parent && this.setData({
18+
parent: target
19+
});
20+
// 每次被插入到custom-ul时执行,target是custom-ul节点实例对象,触发在attached生命周期之后
21+
}
1022
}
1123
},
1224
/**
1325
* 组件的属性列表
1426
*/
1527
properties: {
1628
tab: String,
17-
subTab:String,
18-
subKey:String,
29+
subTab: String,
30+
subKey: String,
1931
key: String,
20-
icon:String,
21-
iconStyle:String,
22-
image:Object,
23-
picPlacement:{
24-
type:String,
25-
value:'top'
26-
},
32+
icon: String,
33+
iconStyle: String,
34+
image: Object,
35+
picPlacement: {
36+
type: String,
37+
value: "top"
38+
}
39+
},
40+
41+
observers: {
42+
"**": function(filed) {
43+
this.updateData(filed);
44+
}
2745
},
28-
2946

3047
/**
3148
* 组件的初始数据
3249
*/
3350
data: {
3451
isCurrent: false,
35-
index:0,
52+
index: 0,
53+
parent: null
3654
},
3755

38-
methods:{
39-
56+
methods: {
57+
updateData(filed) {
58+
let parent = this.data.parent;
59+
if (!parent) return;
60+
parent.initTabs()
61+
}
4062
}
41-
})
63+
});
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"component": true,
3-
"componentGenerics": {
4-
"l-water-flow-item": true
5-
}
6-
}
2+
"component": true,
3+
"usingComponents": {},
4+
"componentGenerics": {
5+
"l-water-flow-item": "true"
6+
}
7+
}

examples/pages/components/nav/pages/combined-tabs/index.js

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -7,72 +7,6 @@ Page({
77
data: {
88
placement: 'left',
99
placementArr: ['top', 'left', 'right', 'bottom'],
10-
scrollAbleTabs: [{
11-
tab: '精选',
12-
key: 'treasure'
13-
}, {
14-
tab: '居家生活',
15-
key: 'life'
16-
}, {
17-
tab: '美食厨房',
18-
key: 'food'
19-
}, {
20-
tab: '服饰珠宝',
21-
key: 'cloth'
22-
}, {
23-
tab: '美妆洗护',
24-
key: 'cosmetics'
25-
}],
26-
iconTabs: [{
27-
tab: '购物车',
28-
key: 'cart',
29-
icon: 'cart'
30-
}, {
31-
tab: '历史记录',
32-
key: 'history',
33-
icon: 'history'
34-
}, {
35-
tab: '我的',
36-
key: 'mine',
37-
icon: 'user'
38-
}],
39-
imagesTabs: [{
40-
tab: '客厅',
41-
key: 'dining',
42-
image: {
43-
activeImage: '/pages/nav/images/tab-icon/dining-active.png',
44-
defaultImage: '/pages/nav/images/tab-icon/dining.png',
45-
placement: 'top',
46-
}
47-
},
48-
{
49-
tab: '卧室',
50-
key: 'badroom',
51-
image: {
52-
activeImage: '/pages/nav/images/tab-icon/badroom-active.png',
53-
defaultImage: '/pages/nav/images/tab-icon/badroom.png',
54-
placement: 'top',
55-
}
56-
}, {
57-
tab: '厨房',
58-
key: 'kichten',
59-
image: {
60-
activeImage: '/pages/nav/images/tab-icon/kichten-active.png',
61-
defaultImage: '/pages/nav/images/tab-icon/kichten.png',
62-
placement: 'top',
63-
}
64-
},
65-
{
66-
tab: '浴室',
67-
key: 'bathroom',
68-
image: {
69-
activeImage: '/pages/nav/images/tab-icon/bathroom-active.png',
70-
defaultImage: '/pages/nav/images/tab-icon/bathroom.png',
71-
placement: 'top',
72-
style: 'width:44rpx;height:44rpx;'
73-
}
74-
}
75-
],
7610
dubbleTabs: [{
7711
tab: '女装',
7812
key: 'women',
@@ -145,7 +79,6 @@ Page({
14579
* 生命周期函数--监听页面加载
14680
*/
14781
onLoad: function (options) {
148-
14982
},
15083

15184
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lin-ui",
3-
"version": "0.5.7",
3+
"version": "0.5.8",
44
"description": "A high quality UI components library with MiniProgram",
55
"main": "app.js",
66
"directories": {

0 commit comments

Comments
 (0)