Why does the type of the state change when changing the state through a component? #1889
Unanswered
realconvis
asked this question in
Help and Questions
Replies: 1 comment 3 replies
-
v-text-field needs to be a number field? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a store and the state is defined as:
const books= ref([] as Book[]);
And the Type Book is defined as:
export default interface Book { id?: number; name: string; pages: number; }
I use the state to display a list of books:
If i change the input inside of the input fields the state is updated.
But if i type a number for the number of pages, the number is converted to string inside of the store.
Why this happens?
By definition inside of the interface, pages should be a number, not a string.
Beta Was this translation helpful? Give feedback.
All reactions