Skip to content

unable to use new-line in v-for attribute #7792

Closed
@FranckFreiburger

Description

@FranckFreiburger

Version

2.5.15

Reproduction link

https://jsfiddle.net/50wL7mdz/177321/

Steps to reproduce

run and look at the error in the console

What is expected?

new-line (\n) support in v-for

What is actually happening?

vue.js [Vue warn]: Error compiling template:

<div id="app">
  <p v-for="
    i in (2
     2)
  ">{{ message }}</p>
</div>

- invalid expression: Unexpected token } in

    (2

  Raw expression: v-for="
    i in (2
     2)
  "


My real case is much more complex and would need new-line for readability, especially since /* */ comment are accepted.

 <p v-for="
    i in (2 /* foo */
     2)     /* bar */
  ">{{ message }}</p>

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