v-model and non-null assertions #9079
Unanswered
brandonburkett
asked this question in
Help/Questions
Replies: 1 comment
-
The syntax: function liveDangerously(x?: number | null) {
// No error
console.log(x!.toFixed());
} is a TypeScript syntax, so the tips say "v-model value must be a valid JavaScript member expression". To verify this is a JavaScript syntax or not, i use astexplorer.net to transform it, but it throw a error, so i think the syntax is not a JavaScript syntax. 967c0d45-d538-487d-8dc7-e7f99bb5b8bb.webm |
Beta Was this translation helpful? Give feedback.
0 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.
-
For typescript in templates, is the non-null assertion not supported when it is the last character of a v-model? Example:
v-model="user.firstName!"
gives the errorv-model value must be a valid JavaScript member expression
?Note that
!.
seems to work fine if used likemaybeNullObj!.someProperty
, I only see the error when!
comes as the last character, specifically withv-model
.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions