提交 47293ae3 编写于 作者: D DCloud_LXH

feat: input、textarea support confirm-hold

上级 4a7b3909
......@@ -185,9 +185,13 @@ export default {
},
methods: {
_onKeyup ($event) {
const input = $event.target
this.$trigger('confirm', $event, {
value: $event.target.value
value: input.value
})
if (!this.confirmHold) {
input.blur()
}
},
_onInput ($event, force) {
let outOfMaxlength = false
......
......@@ -187,7 +187,7 @@ export default {
_onKeyUpEnter: function ($event) {
if (this.isDone) {
this._confirm($event)
this.$refs.textarea.blur()
!this.confirmHold && this.$refs.textarea.blur()
}
},
_onCompositionstart ($event) {
......
......@@ -62,6 +62,10 @@ export default {
selectionEnd: {
type: [Number, String],
default: -1
},
confirmHold: {
type: Boolean,
default: false
}
},
data () {
......
......@@ -70,7 +70,7 @@ export function getLocation ({
errorCallback(e)
}, {
geocode: geocode,
enableHighAccuracy: isHighAccuracy || altitude,
enableHighAccuracy: isHighAccuracy || altitude,
timeout: highAccuracyExpireTime
}
)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册