perf(input): 新增 input 组件 input 事件

This commit is contained in:
就眠仪式
2021-10-13 13:44:22 +08:00
parent 05c9518405
commit d823e9a9b8
6 changed files with 85 additions and 4 deletions

View File

@@ -19,9 +19,11 @@ const props = defineProps<{
placeholder?: string
}>()
const emit = defineEmits(['update:modelValue'])
const emit = defineEmits(['update:modelValue','input'])
const updateValue = function (event: InputEvent) {
emit('update:modelValue', (event.target as HTMLInputElement).value)
const inputElement = event.target as HTMLInputElement
emit('update:modelValue', inputElement.value)
emit('input', inputElement.value)
}
</script>