Skip to content

Object property shorthand within template expressions throws error #12566

@solvedDev

Description

@solvedDev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions