Skip to content

Commit f57cb9d

Browse files
aQingYun7insummer
authored andcommitted
feat:更新版本v0.5.3=>v0.5.4 (#322)
1 parent 565e94e commit f57cb9d

File tree

13 files changed

+170
-77
lines changed

13 files changed

+170
-77
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.3-3963bc.svg)
20+
![](https://img.shields.io/badge/version-0.5.4-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.3
42+
核心库:0.5.4
4343

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

dist/search-bar/index.js

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Component({
1010
'l-input-class',
1111
'l-cancel-class'
1212
],
13+
options: {
14+
multipleSlots: true // 在组件定义时的选项中启用多slot支持
15+
},
1316
properties: {
1417
confirmType: {
1518
type: String,
@@ -24,7 +27,7 @@ Component({
2427
type: String,
2528
value: '取消'
2629
},
27-
address:String,
30+
address: String,
2831
iconColor: {
2932
type: String,
3033
value: '#333'
@@ -33,23 +36,23 @@ Component({
3336
type: String,
3437
value: '28'
3538
},
36-
bgColor:{
37-
type:String,
38-
value:'#f3f3f3'
39+
bgColor: {
40+
type: String,
41+
value: '#f3f3f3'
3942
},
4043
showCancel: {
4144
type: Boolean,
4245
value: true
4346
},
44-
shape:{
45-
type:String,
46-
value:'primary'
47+
shape: {
48+
type: String,
49+
value: 'primary'
4750
},
48-
TextAlign:{
49-
type:String,
50-
value:'left'
51+
TextAlign: {
52+
type: String,
53+
value: 'left'
5154
},
52-
adress:String,
55+
adress: String,
5356
// 获取焦点
5457
focus: {
5558
type: Boolean,
@@ -88,8 +91,8 @@ Component({
8891
* 组件的方法列表
8992
*/
9093
methods: {
91-
onCancel(){
92-
this.triggerEvent('onCancel')
94+
onCancel() {
95+
this.triggerEvent('lincancel')
9396
},
9497
// input属性列表
9598
handleInputChange(event) {
@@ -104,15 +107,15 @@ Component({
104107
value
105108
});
106109

107-
this.triggerEvent('linchange', event);
110+
this.triggerEvent('linchange', detail);
108111
},
109112

110113
handleInputFocus(event) {
111-
this.triggerEvent('linfocus', event);
114+
this.triggerEvent('linfocus', event.detail);
112115
},
113116

114117
handleInputBlur(event) {
115-
this.triggerEvent('linblur', event);
118+
this.triggerEvent('linblur', event.detail);
116119
},
117120

118121
handleInputConfirm(event) {
@@ -127,14 +130,14 @@ Component({
127130
value
128131
});
129132

130-
this.triggerEvent('linconfirm', event);
133+
this.triggerEvent('linconfirm', detail);
131134
},
132135

133136
onClearTap(event) {
134137
this.setData({
135138
value: ''
136139
});
137-
this.triggerEvent('linclear', event);
140+
this.triggerEvent('linclear', event.detail);
138141
}
139142
}
140143
});

dist/search-bar/index.wxml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<view class="search-bar l-class">
2-
<slot />
2+
<slot name="before"/>
33
<view wx:if="{{address}}" class="icon-container">
44
<text class="city">{{address}}</text>
55
<l-icon name="down" color="#333" size="22" />
@@ -33,4 +33,5 @@
3333
bindtap="onCancel">
3434
{{cancelText}}
3535
</view>
36+
<slot name="after"/>
3637
</view>

dist/search-bar/index.wxss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.search-bar{display:flex;flex-direction:row;align-items:center;padding:20rpx;box-sizing:border-box;width:750rpx}.search-input{height:60rpx;background-color:#f3f3f3;display:flex;flex:1;flex-direction:row;align-items:center;padding-left:30rpx;box-sizing:border-box}.search-input-primary{border-radius:8rpx}.search-input-circle{border-radius:30rpx}.cancle{font-size:28rpx;color:#666;margin-left:15rpx}.input{height:40rpx;line-height:40rpx;flex:1;margin-left:15rpx;font-size:28rpx;color:#666}.input-center{text-align:center}.input-left{text-align:left}.close-wrap{padding:10rpx}.close{height:30rpx;width:30rpx;background:#ddd;display:flex;align-items:center;justify-content:center;border-radius:50%}.pls-class{color:#9a9a9a;font-size:28rpx}.icon-container{display:flex;flex-direction:row;align-items:center;margin-right:15rpx}.city{font-size:28rpx;color:#333;margin-right:10rpx}
1+
.search-bar{display:flex;flex-direction:row;align-items:center;padding:20rpx;box-sizing:border-box;width:750rpx}.search-input{height:60rpx;background-color:#f3f3f3;display:flex;flex:1;flex-direction:row;align-items:center;padding-left:30rpx;box-sizing:border-box}.search-input-primary{border-radius:8rpx}.search-input-circle{border-radius:30rpx}.cancle{font-size:28rpx;color:#666;margin-left:15rpx}.input{height:40rpx;line-height:40rpx;flex:1;margin-left:15rpx;font-size:28rpx;color:#666}.input-center{text-align:center}.input-left{text-align:left}.close-wrap{padding:10rpx}.close{height:30rpx;width:30rpx;background:#ddd;display:flex;align-items:center;justify-content:center;border-radius:50%;padding-top:3rpx;padding-left:3rpx;box-sizing:border-box;margin-right:15rpx}.pls-class{color:#9a9a9a;font-size:28rpx}.icon-container{display:flex;flex-direction:row;align-items:center;margin-right:15rpx}.city{font-size:28rpx;color:#333;margin-right:10rpx}

examples/dist/search-bar/index.js

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Component({
1010
'l-input-class',
1111
'l-cancel-class'
1212
],
13+
options: {
14+
multipleSlots: true // 在组件定义时的选项中启用多slot支持
15+
},
1316
properties: {
1417
confirmType: {
1518
type: String,
@@ -24,7 +27,7 @@ Component({
2427
type: String,
2528
value: '取消'
2629
},
27-
address:String,
30+
address: String,
2831
iconColor: {
2932
type: String,
3033
value: '#333'
@@ -33,23 +36,23 @@ Component({
3336
type: String,
3437
value: '28'
3538
},
36-
bgColor:{
37-
type:String,
38-
value:'#f3f3f3'
39+
bgColor: {
40+
type: String,
41+
value: '#f3f3f3'
3942
},
4043
showCancel: {
4144
type: Boolean,
4245
value: true
4346
},
44-
shape:{
45-
type:String,
46-
value:'primary'
47+
shape: {
48+
type: String,
49+
value: 'primary'
4750
},
48-
TextAlign:{
49-
type:String,
50-
value:'left'
51+
TextAlign: {
52+
type: String,
53+
value: 'left'
5154
},
52-
adress:String,
55+
adress: String,
5356
// 获取焦点
5457
focus: {
5558
type: Boolean,
@@ -88,8 +91,8 @@ Component({
8891
* 组件的方法列表
8992
*/
9093
methods: {
91-
onCancel(){
92-
this.triggerEvent('onCancel')
94+
onCancel() {
95+
this.triggerEvent('lincancel')
9396
},
9497
// input属性列表
9598
handleInputChange(event) {
@@ -104,15 +107,15 @@ Component({
104107
value
105108
});
106109

107-
this.triggerEvent('linchange', event);
110+
this.triggerEvent('linchange', detail);
108111
},
109112

110113
handleInputFocus(event) {
111-
this.triggerEvent('linfocus', event);
114+
this.triggerEvent('linfocus', event.detail);
112115
},
113116

114117
handleInputBlur(event) {
115-
this.triggerEvent('linblur', event);
118+
this.triggerEvent('linblur', event.detail);
116119
},
117120

118121
handleInputConfirm(event) {
@@ -127,14 +130,14 @@ Component({
127130
value
128131
});
129132

130-
this.triggerEvent('linconfirm', event);
133+
this.triggerEvent('linconfirm', detail);
131134
},
132135

133136
onClearTap(event) {
134137
this.setData({
135138
value: ''
136139
});
137-
this.triggerEvent('linclear', event);
140+
this.triggerEvent('linclear', event.detail);
138141
}
139142
}
140143
});

examples/dist/search-bar/index.wxml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<view class="search-bar l-class">
2-
<slot />
2+
<slot name="before"/>
33
<view wx:if="{{address}}" class="icon-container">
44
<text class="city">{{address}}</text>
55
<l-icon name="down" color="#333" size="22" />
@@ -33,4 +33,5 @@
3333
bindtap="onCancel">
3434
{{cancelText}}
3535
</view>
36+
<slot name="after"/>
3637
</view>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.search-bar{display:flex;flex-direction:row;align-items:center;padding:20rpx;box-sizing:border-box;width:750rpx}.search-input{height:60rpx;background-color:#f3f3f3;display:flex;flex:1;flex-direction:row;align-items:center;padding-left:30rpx;box-sizing:border-box}.search-input-primary{border-radius:8rpx}.search-input-circle{border-radius:30rpx}.cancle{font-size:28rpx;color:#666;margin-left:15rpx}.input{height:40rpx;line-height:40rpx;flex:1;margin-left:15rpx;font-size:28rpx;color:#666}.input-center{text-align:center}.input-left{text-align:left}.close-wrap{padding:10rpx}.close{height:30rpx;width:30rpx;background:#ddd;display:flex;align-items:center;justify-content:center;border-radius:50%}.pls-class{color:#9a9a9a;font-size:28rpx}.icon-container{display:flex;flex-direction:row;align-items:center;margin-right:15rpx}.city{font-size:28rpx;color:#333;margin-right:10rpx}
1+
.search-bar{display:flex;flex-direction:row;align-items:center;padding:20rpx;box-sizing:border-box;width:750rpx}.search-input{height:60rpx;background-color:#f3f3f3;display:flex;flex:1;flex-direction:row;align-items:center;padding-left:30rpx;box-sizing:border-box}.search-input-primary{border-radius:8rpx}.search-input-circle{border-radius:30rpx}.cancle{font-size:28rpx;color:#666;margin-left:15rpx}.input{height:40rpx;line-height:40rpx;flex:1;margin-left:15rpx;font-size:28rpx;color:#666}.input-center{text-align:center}.input-left{text-align:left}.close-wrap{padding:10rpx}.close{height:30rpx;width:30rpx;background:#ddd;display:flex;align-items:center;justify-content:center;border-radius:50%;padding-top:3rpx;padding-left:3rpx;box-sizing:border-box;margin-right:15rpx}.pls-class{color:#9a9a9a;font-size:28rpx}.icon-container{display:flex;flex-direction:row;align-items:center;margin-right:15rpx}.city{font-size:28rpx;color:#333;margin-right:10rpx}

examples/pages/components/shopping/pages/search-bar/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ Page({
1515

1616
},
1717

18+
onCancel(){
19+
wx.showToast({
20+
title: '已取消'
21+
})
22+
},
23+
1824
/**
1925
* 生命周期函数--监听页面初次渲染完成
2026
*/

examples/pages/components/shopping/pages/search-bar/index.wxml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<view class="content-name">基本用法</view>
55
</view>
66

7-
<l-search-bar placeholder="搜索" />
7+
<l-search-bar placeholder="搜索" bind:lincancel="onCancel" />
88

99
<view class="card-top">
1010
<view class="card-dot"></view>
@@ -19,17 +19,17 @@
1919
</view>
2020

2121

22-
<l-search-bar shape="circle" placeholder="搜索">
22+
<l-search-bar shape="circle" placeholder="搜索" bind:lincancel="onCancel">
2323
</l-search-bar>
2424

25-
<l-search-bar bg-color="#bbb" placeholder="搜索" />
25+
<l-search-bar bg-color="#bbb" placeholder="搜索" bind:lincancel="onCancel"/>
2626

2727
<view class="card-top">
2828
<view class="card-dot"></view>
2929
<view class="content-name">设置搜索框前的地址</view>
3030
</view>
3131

32-
<l-search-bar placeholder="搜索" address="北京">
32+
<l-search-bar placeholder="搜索" address="北京" bind:lincancel="onCancel">
3333
</l-search-bar>
3434

3535

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.3",
3+
"version": "0.5.4",
44
"description": "A high quality UI components library with MiniProgram",
55
"main": "app.js",
66
"directories": {

0 commit comments

Comments
 (0)