Compare commits

...

4 Commits

2 changed files with 48 additions and 2 deletions

View File

@@ -12,6 +12,12 @@
}"
@tap.stop="inputClick"
>
<view
v-if="showLeftIcon"
class="tn-input__left-icon__item tn-input__left-icon__clear"
>
<tn-button shape="icon" :scene="scene" :block-time="blockTime" @click="leftIconClick"><view class="icon" :class="[`tn-icon-${leftIcon}`]"></view></tn-button>
</view>
<textarea
v-if="type === 'textarea'"
class="tn-input__input tn-input__textarea"
@@ -240,6 +246,16 @@
type: String,
default: ''
},
// 是否在输入框内最左边显示图标
showLeftIcon: {
type: Boolean,
default: false
},
// 最左边图标的名称
leftIcon: {
type: String,
default: ''
},
//场景debounce :防抖模式 throttle节流模式
scene:{
type: String,
@@ -309,6 +325,9 @@
this.$on("on-form-item-error", this.onFormItemError)
},
methods: {
leftIconClick(){
this.$emit('leftClick', this.defaultValue)
},
rightIconClick(){
this.$emit('rightClick', this.defaultValue)
},
@@ -428,7 +447,8 @@
&--error {
border-color: $tn-color-red !important;
}
&__right-icon {
line-height: 1;
.icon {
@@ -457,5 +477,32 @@
}
}
}
&__left-icon {
line-height: 1;
&__item {
margin-left: 0rpx;
margin-top: 4rpx;
}
&__clear {
.icon {
font-size: 32rpx;
color: $tn-font-sub-color;
}
}
&__select {
transition: transform .4s;
.icon {
font-size: 26rpx;
}
&--reverse {
transform: rotate(-180deg);
}
}
}
}
</style>

View File

@@ -20,7 +20,6 @@ export function throttleFun(func, delay=500) {
timer = setTimeout(() => {
//执行前清空
timer = null;
console.log("执行了")
func.apply(this, args);
}, delay);
}