-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: vue: v-model.number modifier is not properly typed #25575
Comments
Thanks for the issue. Can you make your repo public? |
@liamdebeasi Too funny! I created that repo with your handy online app creator and it made it private by default! 😂 It's public now, thanks for taking a look, this is breaking some of my build pipelines. |
And sorry for taking so long to reply, for some reason I had turned off notifications from this repo. 🙄 |
@aparajita thanks for reporting this issue. I am able to reproduce and have been able to narrow it to our output targets interface: https://github.com/ionic-team/stencil-ds-output-targets/blob/bc8878f5ccd1890ec378a57f8e69a44b15213102/packages/vue-output-target/vue-component-lib/utils.ts#L3-L5 Updating the interface locally to: export interface InputProps {
modelValue?: string | boolean | number;
} resolves the issue. Input is one of our few components that accepts a We may want to consider making the type a generic in the future, so that the Stencil build step can pass the type of the component, as the required signature for the export interface InputProps<T> {
modelValue?: T; // optionally we can assign a default type for T if one is not set
} |
Hello @aparajita can you test with this dev-build and let me know if the problem persists?
I've confirmed against your reproduction app + reproduction steps. |
Yup, that fixed it, thank you! 🙏 You can close this issue. |
Thanks for the follow-up! Still a little more work on my end. We will get the output targets PR reviewed, and then open a PR in Ionic framework to update the version of that package. This issue will auto-close once that PR lands. |
Hey @sean-perkins, any idea when this will land? Didn't make it into 6.1.15. |
@aparajita tentatively in the next patch release (we aim for weekly releases). |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
Current Behavior
Given this:
If you run
vue-tsc
, you get this error:Note that Vue has no problem compiling the code and it runs correctly.
Expected Behavior
There should not be any errors. If you change
IonicInput
toinput
,vue-tsc
does not report any errors.Steps to Reproduce
This minimal app was created using your Getting Started Wizard. I have no idea if it will build or run, it is there just to demonstrate the typing bug.
npm i -g pnpm git clone https://github.com/aparajita/v-model-bug cd v-model-bug pnpm i node_modules/.bin/vue-tsc --noEmit
Code Reproduction URL
https://github.com/aparajita/v-model-bug
Ionic Info
Additional Information
@liamdebeasi I think this is one for you.
The text was updated successfully, but these errors were encountered: