useVModel hold internal state
ftcopilot017 opened this issue · comments
Clear and concise description of the problem
Currently getValue
in useVModel
will always return undefined when props[key] and defaultValue is undefined
vueuse/packages/core/useVModel/index.ts
Lines 113 to 116 in 1558cd2
Maybe it's not a common practice in real world? Just like antd Input component https://next.antdv.com/components/input, if you don't pass value(v-model), the Input component will hold it's internal value. This means you can type any value without manually set v-model:value. But if using useVModel
, you can't typing anything unless set v-model:value="xxx".
Suggested solution
If this feature is reasonable. Maybe we could add interanl
option in useVModel
options for compatibility.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.