提交 58909825 编写于 作者: D DCloud_LXH

chore: textarea confirmType default 'return'

上级 a121dc67
...@@ -72,6 +72,7 @@ import { ...@@ -72,6 +72,7 @@ import {
field field
} from 'uni-mixins' } from 'uni-mixins'
const DARK_TEST_STRING = '(prefers-color-scheme: dark)' const DARK_TEST_STRING = '(prefers-color-scheme: dark)'
const ConfirmTypes = ['done', 'go', 'next', 'search', 'send'] // 'return'
export default { export default {
name: 'Textarea', name: 'Textarea',
mixins: [field], mixins: [field],
...@@ -106,7 +107,10 @@ export default { ...@@ -106,7 +107,10 @@ export default {
}, },
confirmType: { confirmType: {
type: String, type: String,
default: '' default: 'return',
validator (val) {
return ConfirmTypes.concat('return').includes(val)
}
} }
}, },
data () { data () {
...@@ -127,7 +131,7 @@ export default { ...@@ -127,7 +131,7 @@ export default {
return (this.composing ? this.valueComposition : this.valueSync).split('\n') return (this.composing ? this.valueComposition : this.valueSync).split('\n')
}, },
isDone () { isDone () {
return ['done', 'go', 'next', 'search', 'send'].includes(this.confirmType) return ConfirmTypes.includes(this.confirmType)
} }
}, },
watch: { watch: {
...@@ -208,7 +212,6 @@ export default { ...@@ -208,7 +212,6 @@ export default {
!this.ignoreCompositionEvent && !this.ignoreCompositionEvent &&
this.$trigger($event.type, $event, { data: $event.data }) this.$trigger($event.type, $event, { data: $event.data })
}, },
// 暂无完成按钮,此功能未实现
_confirm ($event) { _confirm ($event) {
this.$trigger('confirm', $event, { this.$trigger('confirm', $event, {
value: this.valueSync value: this.valueSync
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册