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

Object property shorthand within template expressions throws error #12566

Closed
solvedDev opened this issue Jun 20, 2022 · 1 comment
Closed

Object property shorthand within template expressions throws error #12566

solvedDev opened this issue Jun 20, 2022 · 1 comment

Comments

@solvedDev
Copy link

Version

2.7.0-beta.3

Reproduction link

stackblitz.com

Steps to reproduce

  1. Create a Vue 2.7 project that uses the object property shorthand syntax within the template:
<p :style="{ color }">Test</p>
  1. See error within console: "Uncaught SyntaxError: Unexpected token '.'"

What is expected?

Template expressions support the object property shorthand syntax just like on Vue v2.6

What is actually happening?

The object property shorthand is not supported


The template compiler inserts code that looks like this { _vm.color } where it should probably be compiled to something like { color: _vm.color } instead

@yyx990803
Copy link
Member

Fix is out in beta.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants