mirror of
https://gitee.com/TSpecific/tuniao-ui.git
synced 2026-06-07 03:53:57 +08:00
[add] input右边图标点击事件回传,可以设置防抖节流功能。
This commit is contained in:
@@ -81,7 +81,7 @@
|
|||||||
v-else-if="type === 'text' && !focused && showRightIcon && rightIcon !== ''"
|
v-else-if="type === 'text' && !focused && showRightIcon && rightIcon !== ''"
|
||||||
class="tn-input__right-icon__item tn-input__right-icon__clear"
|
class="tn-input__right-icon__item tn-input__right-icon__clear"
|
||||||
>
|
>
|
||||||
<view class="icon" :class="[`tn-icon-${rightIcon}`]"></view>
|
<tn-button shape="icon" :scene="scene" :block-time="blockTime" @click="rightIconClick"><view class="icon" :class="[`tn-icon-${rightIcon}`]"></view></tn-button>
|
||||||
</view>
|
</view>
|
||||||
<!-- 显示密码按钮 -->
|
<!-- 显示密码按钮 -->
|
||||||
<view
|
<view
|
||||||
@@ -239,6 +239,16 @@
|
|||||||
rightIcon: {
|
rightIcon: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
},
|
||||||
|
//场景:debounce :防抖模式 throttle:节流模式
|
||||||
|
scene:{
|
||||||
|
type: String,
|
||||||
|
default: 'debounce'
|
||||||
|
},
|
||||||
|
// 防抖节流间隔时间(毫秒)
|
||||||
|
blockTime:{
|
||||||
|
type: Number,
|
||||||
|
default: 500
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -299,6 +309,9 @@
|
|||||||
this.$on("on-form-item-error", this.onFormItemError)
|
this.$on("on-form-item-error", this.onFormItemError)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
rightIconClick(){
|
||||||
|
this.$emit('rightClick', this.defaultValue)
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* input事件
|
* input事件
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user