Skip to content

Commit 73e3af2

Browse files
committed
fix: 修复 uni-swipe-action 按钮点击执行两次的bug #287
1 parent bc82e50 commit 73e3af2

File tree

9 files changed

+86
-70
lines changed

9 files changed

+86
-70
lines changed

docs/.vuepress/theme/components/Page.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default {
8181
border-radius 20px
8282
background-color #333
8383
box-shadow 0px 0px 10px 2px rgba(0, 0, 0, 0.2)
84-
transform scale(0.8)
84+
transform scale(0.85)
8585
box-sizing border-box
8686
.simulator-top
8787
display flex

docs/.vuepress/theme/global-components/Log.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<span>{{title}}</span>
66
<Badge :text="date" type="warning" />
77
</div>
8-
<slot><div class="children">嗯哈嗯哈</div></slot>
8+
<slot><div class="children"></div></slot>
99
</div>
1010
</template>
1111

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<template>
2+
<div>下载</div>
3+
</template>
4+
5+
<script>
6+
export default {
7+
name:'downloadButton'
8+
}
9+
</script>
10+
11+
<style>
12+
</style>

docs/components/easyinput.md

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -120,79 +120,78 @@ easyinput 组件是对原生input组件的增强 ,是专门为配合表单组
120120

121121
### Easyinput Props
122122

123-
|属性名 | 类型 | 可选值 | 默认值 | 说明|
124-
|:-: | :-: |:-: | :-: | :-: |
125-
|value |String/ Number | - | - |输入内容|
126-
|type |String | 见 type Options |text| 输入框的类型(默认text) |
127-
|clearable |Boolean | - |true| 是否显示右侧清空内容的图标控件(输入框有内容,且获得焦点时才显示),点击可清空输入框内容|
128-
|autoHeight |Boolean | - |false| 是否自动增高输入区域,type为textarea时有效|
129-
|placeholder |String | - | - | 输入框的提示文字|
130-
|placeholderStyle |String | - | - | placeholder的样式(内联样式,字符串),如"color: #ddd"|
131-
|focus |Boolean | - |false| 是否自动获得焦点|
132-
|disabled |Boolean | - |false| 是否不可输入|
133-
|maxlength |Number | - |140| 最大输入长度,设置为 -1 的时候不限制最大长度|
134-
|confirmType |String | - |done| 设置键盘右下角按钮的文字,仅在type="text"时生效|
135-
|clearSize |Number | - |15| 清除图标的大小,单位px|
136-
|prefixIcon |String | - | - |输入框头部图标 |
137-
|suffixIcon |String | - | - |输入框尾部图标|
138-
|trim |Boolean/String | 见 trim Options | false | 是否自动去除空格,传入类型为 Boolean 时,自动去除前后空格|
139-
|inputBorder |Boolean | - |true| 是否显示input输入框的边框|
140-
|styles |Object | - | - | 样式自定义|
123+
|属性名| 类型| 可选值|默认值|说明|
124+
|:-:|:-:|:-:|:-:|:-:|
125+
|value|String/ Number|-|-|输入内容|
126+
|type|String|见 type Options|text|输入框的类型(默认text)|
127+
|clearable|Boolean|-|true| 是否显示右侧清空内容的图标控件(输入框有内容,且获得焦点时才显示),点击可清空输入框内容|
128+
|autoHeight|Boolean|-|false| 是否自动增高输入区域,type为textarea时有效|
129+
|placeholder|String |-| - | 输入框的提示文字|
130+
|placeholderStyle|String| - | - | placeholder的样式(内联样式,字符串),如"color: #ddd"|
131+
|focus|Boolean|-|false|是否自动获得焦点|
132+
|disabled|Boolean|-|false|是否不可输入|
133+
|maxlength|Number|-|140|最大输入长度,设置为 -1 的时候不限制最大长度|
134+
|confirmType|String|-|done|设置键盘右下角按钮的文字,仅在type="text"时生效|
135+
|clearSize|Number|-|15|清除图标的大小,单位px|
136+
|prefixIcon|String|-|-|输入框头部图标 |
137+
|suffixIcon|String|-|-|输入框尾部图标|
138+
|trim|Boolean/String|见 trim Options | false | 是否自动去除空格,传入类型为 Boolean 时,自动去除前后空格|
139+
|inputBorder|Boolean|-|true|是否显示input输入框的边框|
140+
|styles|Object|-|-| 样式自定义|
141+
|passwrodIcon|Boolean|-| true | type=password 时,是否显示小眼睛图标|
141142

142143

143144
#### Type Options
144145

145-
|属性名 | 说明 |
146-
|:-: | :-: |
147-
|text |文本输入键盘 |
148-
|textarea |多行文本输入键盘 |
149-
|password |密码输入键盘 |
150-
|number |数字输入键盘,注意iOS上app-vue弹出的数字键盘并非9宫格方式 |
151-
|idcard |身份证输入键盘,仅支持微信、支付宝、百度、QQ小程序 |
152-
|digit |带小数点的数字键盘,仅支持微信、支付宝、百度、头条、QQ小程序 |
146+
|属性名| 说明|
147+
|:-:| :-:|
148+
|text|文本输入键盘|
149+
|textarea |多行文本输入键盘|
150+
|password |密码输入键盘|
151+
|number|数字输入键盘,注意iOS上app-vue弹出的数字键盘并非9宫格方式 |
152+
|idcard|身份证输入键盘,仅支持微信、支付宝、百度、QQ小程序|
153+
|digit|带小数点的数字键盘,仅支持微信、支付宝、百度、头条、QQ小程序 |
153154

154155
#### ConfirmType Options
155156

156157
平台差异与 [input](https://uniapp.dcloud.io/component/input) 相同
157158

158-
|属性名 | 说明 |
159-
|:-: | :-: |
160-
|send |右下角按钮为“发送” |
159+
|属性名 | 说明|
160+
|:-:| :-:|
161+
|send|右下角按钮为“发送” |
161162
|search |右下角按钮为“搜索” |
162-
|next |右下角按钮为“下一个”|
163-
|go |右下角按钮为“前往” |
164-
|done |右下角按钮为“完成” |
163+
|next|右下角按钮为“下一个”|
164+
|go|右下角按钮为“前往” |
165+
|done|右下角按钮为“完成” |
165166

166167

167168
#### Styles Options
168169

169-
|属性名 | 默认值 |说明 |
170-
|:-: | :-: | :-: |
171-
|color | #333 | 输入文字颜色 |
172-
|disableColor |#eee | 输入框禁用背景色 |
173-
|borderColor |#e5e5e5 | 边框颜色 |
170+
|属性名| 默认值 |说明|
171+
|:-:| :-:| :-:|
172+
|color| #333| 输入文字颜色|
173+
|disableColor |#eee| 输入框禁用背景色|
174+
|borderColor |#e5e5e5 | 边框颜色|
174175

175176
#### Trim Options
176177

177178
传入类型为 `Boolean` 时,自动去除前后空格,传入类型为 `String` 时,可以单独控制,下面是可选值
178179

179-
|属性名 |说明 |
180-
|:-: | :-: |
181-
|both | 去除两端空格 |
182-
|left | 去除左侧空格 |
183-
|right | 去除右侧空格 |
184-
|all | 去除所有空格 |
185-
|none | 不去除空格 |
180+
|属性名|说明|
181+
|:-:| :-:|
182+
|both|去除两端空格|
183+
|left|去除左侧空格|
184+
|right|去除右侧空格|
185+
|all|去除所有空格|
186+
|none|不去除空格|
186187

187188

188189
### Easyinput Events
189190

190-
|事件称名 | 说明 |返回值 |
191-
|:-: | :-: |:-: |
192-
|@input |输入框内容发生变化时触发 | - |
193-
|@focus |输入框获得焦点时触发 | - |
194-
|@blur |输入框失去焦点时触发 | - |
195-
|@confirm |点击完成按钮时触发 | - |
196-
|@iconClick |点击图标时触发 | prefix/suffix |
197-
198-
191+
|事件称名| 说明|返回值|
192+
|:-:| :-:|:-:|
193+
|@input|输入框内容发生变化时触发| -|
194+
|@focus|输入框获得焦点时触发| -|
195+
|@blur|输入框失去焦点时触发| -|
196+
|@confirm|点击完成按钮时触发| -|
197+
|@iconClick |点击图标时触发| prefix/suffix |

uni_modules/uni-easyinput/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 0.0.14
2+
- 新增 passwordIcon 属性,当type=password时是否显示小眼睛图标
13
## 0.0.13(2021-06-04)
24
- 修复 disabled 状态可清出内容的 bug
35
## 0.0.12(2021-05-12)

uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
:name="name" :value="val" :password="!showPassword && type === 'password'" :placeholder="placeholder"
1515
:placeholderStyle="placeholderStyle" :disabled="disabled" :maxlength="inputMaxlength" :focus="focused" @focus="onFocus"
1616
@blur="onBlur" @input="onInput" @confirm="onConfirm" />
17-
<template v-if="type === 'password'">
17+
<template v-if="type === 'password' && passwrodIcon" >
1818
<uni-icons v-if="val != '' " class="content-clear-icon" :class="{'is-textarea-icon':type==='textarea'}" :type="showPassword?'eye-slash-filled':'eye-filled'"
1919
:size="18" color="#c0c4cc" @click="onEyes"></uni-icons>
2020
</template>
@@ -47,12 +47,12 @@
4747
* @value number 数字输入键盘,注意iOS上app-vue弹出的数字键盘并非9宫格方式
4848
* @value idcard 身份证输入键盘,信、支付宝、百度、QQ小程序
4949
* @value digit 带小数点的数字键盘 ,App的nvue页面、微信、支付宝、百度、头条、QQ小程序支持
50-
* @property {Boolean} clearable 是否显示右侧清空内容的图标控件(输入框有内容,且获得焦点时才显示),点击可清空输入框内容(默认true)
50+
* @property {Boolean} clearable 是否显示右侧清空内容的图标控件,点击可清空输入框内容(默认true)
5151
* @property {Boolean} autoHeight 是否自动增高输入区域,type为textarea时有效(默认true)
5252
* @property {String } placeholder 输入框的提示文字
5353
* @property {String } placeholderStyle placeholder的样式(内联样式,字符串),如"color: #ddd"
5454
* @property {Boolean} focus 是否自动获得焦点(默认false)
55-
* @property {Boolean} disabled 是否不可输入(默认false)
55+
* @property {Boolean} disabled 是否禁用(默认false)
5656
* @property {Number } maxlength 最大输入长度,设置为 -1 的时候不限制最大长度(默认140)
5757
* @property {String } confirmType 设置键盘右下角按钮的文字,仅在type="text"时生效(默认done)
5858
* @property {Number } clearSize 清除图标的大小,单位px(默认15)
@@ -67,6 +67,7 @@
6767
* @value all 去除全部空格
6868
* @value none 不去除空格
6969
* @property {Boolean} inputBorder 是否显示input输入框的边框(默认true)
70+
* @property {Boolean} passwrodIcon type=password时是否显示小眼睛图标
7071
* @property {Object} styles 自定义颜色
7172
* @event {Function} input 输入框内容发生变化时触发
7273
* @event {Function} focus 输入框获得焦点时触发
@@ -111,12 +112,10 @@
111112
type: String,
112113
default: 'done'
113114
},
114-
// 清除按钮的大小
115115
clearSize: {
116116
type: [Number, String],
117117
default: 15
118118
},
119-
// 是否显示 input 边框
120119
inputBorder: {
121120
type: Boolean,
122121
default: true
@@ -129,12 +128,14 @@
129128
type: String,
130129
default: ''
131130
},
132-
// 是否自动去除两端的空格
133131
trim: {
134132
type: [Boolean, String],
135133
default: true
136134
},
137-
// 自定义样式
135+
passwrodIcon:{
136+
type: Boolean,
137+
default: true
138+
},
138139
styles: {
139140
type: Object,
140141
default () {

uni_modules/uni-swipe-action/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 1.1.10(2021-06-17)
2+
- 修复 按钮点击执行两次的bug
13
## 1.1.9(2021-05-12)
24
- 新增 项目示例地址
35
## 1.1.8(2021-03-26)

uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpwxs.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ export default {
103103
},
104104
onClickForPC(index, item, position) {
105105
// #ifdef H5
106-
if(!isPC()) return
107-
// #endif
108-
this.$emit('click', {
109-
content: item,
110-
index,
111-
position
112-
})
106+
if(!isPC()) return
107+
this.$emit('click', {
108+
content: item,
109+
index,
110+
position
111+
})
112+
// #endif
113113
},
114114
getButtonSize() {
115115
const views = uni.createSelectorQuery().in(this)

uni_modules/uni-swipe-action/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "uni-swipe-action",
33
"displayName": "uni-swipe-action 滑动操作",
4-
"version": "1.1.9",
4+
"version": "1.1.10",
55
"description": "SwipeAction 滑动操作操作组件",
66
"keywords": [
77
"",

0 commit comments

Comments
 (0)