-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Closed
Labels
✨ feature requestNew feature or requestNew feature or request
Description
What problem does this feature solve?
Currently there's no way to pass the built-in modifiers to a native input. So wrapping a native input now would need to duplicate code that the vModelText
directive already seems to include - or eject to a render function.
<my-input v-model.lazy="foo" />
...
MyInput.vue
<template>
<input v-bind="$attrs" v-model="model">
</template>
<script>
import { computed } from 'vue'
export default {
setup: (props, { emit }) => ({
model: computed({
get: () => props.modelValue,
set: v => emit('update:modelValue', v)
})
})
}
</script>
What does the proposed API look like?
I don't have any strong opinions here - the native input could simply look for modelModifiers
so that v-bind="$attrs"
"just works"?
IlyaSemenov
Metadata
Metadata
Assignees
Labels
✨ feature requestNew feature or requestNew feature or request