8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
I think it'd be nice to have a feature like this from Angular: https://angular.io/guide/template-syntax#the-safe-navigation-operator----and-null-property-paths
It'd prevent errors like: Cannot read property 'toUpperCase' of null"
Cannot read property 'toUpperCase' of null"
When doing something like: {{ myObj.myNameStartsBeingNull.toUpperCase() }}
{{ myObj.myNameStartsBeingNull.toUpperCase() }}
{{ myObj.myNameStartsBeingNull?.toUpperCase() }}
If myNameStartsBeingNull is null, then stops to interpret the expression
myNameStartsBeingNull
null
The text was updated successfully, but these errors were encountered:
#4638
Also, did you try babel's plugin? -> https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-chaining
Sorry, something went wrong.
We do not intend to introduce non-standard JS syntax in Vue template expressions.
No branches or pull requests
What problem does this feature solve?
I think it'd be nice to have a feature like this from Angular: https://angular.io/guide/template-syntax#the-safe-navigation-operator----and-null-property-paths
It'd prevent errors like:
Cannot read property 'toUpperCase' of null"
When doing something like:
{{ myObj.myNameStartsBeingNull.toUpperCase() }}
What does the proposed API look like?
{{ myObj.myNameStartsBeingNull?.toUpperCase() }}
If
myNameStartsBeingNull
isnull
, then stops to interpret the expressionThe text was updated successfully, but these errors were encountered: