fix(Input): valid none value (#136)
This commit is contained in:
@@ -66,15 +66,14 @@ const inputValue = computed({
|
|||||||
})
|
})
|
||||||
const trigger = computed(() => props.updateTrigger ?? 'change')
|
const trigger = computed(() => props.updateTrigger ?? 'change')
|
||||||
const updateContent = () => {
|
const updateContent = () => {
|
||||||
let value = innerValue.value
|
let value = inputValue.value
|
||||||
|
|
||||||
if (modifiers.trim) {
|
if (modifiers.trim) {
|
||||||
value = innerValue.value?.trim()
|
value = value?.trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modifiers.valid) {
|
if (modifiers.valid) {
|
||||||
const isValid = props.validate?.(value) ?? true
|
const isValid = props.validate?.(value) ?? true
|
||||||
console.log({ isValid, value })
|
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
innerValue.value = content.value
|
innerValue.value = content.value
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user