mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix: update judgment
This commit is contained in:
@@ -379,7 +379,8 @@ const handleInput = async (event: Event) => {
|
||||
|
||||
if (props.countGraphemes && isFunction(props.countGraphemes)) {
|
||||
const graphemes = props.countGraphemes(value)
|
||||
if (graphemes > Number(maxlength.value) && saveValue.value) {
|
||||
const saveGraphemes = props.countGraphemes(saveValue.value)
|
||||
if (graphemes > Number(maxlength.value) && graphemes > saveGraphemes) {
|
||||
value = saveValue.value
|
||||
}
|
||||
}
|
||||
@@ -490,6 +491,14 @@ watch(
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => nativeInputValue.value,
|
||||
(val) => {
|
||||
saveValue.value = val
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
// native input value is set explicitly
|
||||
// do not use v-model / :value in template
|
||||
// see: https://github.com/ElemeFE/element/issues/14521
|
||||
|
||||
Reference in New Issue
Block a user