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

feat: input、textarea support confirm-hold

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