Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useVModel hold internal state #3931

Open
4 tasks done
ftcopilot017 opened this issue Apr 19, 2024 · 0 comments
Open
4 tasks done

useVModel hold internal state #3931

ftcopilot017 opened this issue Apr 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ftcopilot017
Copy link

ftcopilot017 commented Apr 19, 2024

Clear and concise description of the problem

#622

Currently getValue in useVModel will always return undefined when props[key] and defaultValue is undefined

const getValue = () => isDef(props[key!])
? cloneFn(props[key!])
: defaultValue

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

@ftcopilot017 ftcopilot017 added the enhancement New feature or request label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant