Vetur: Vetur could not parse the decorator in methods block.

Created on 16 Oct 2019  路  3Comments  路  Source: vuejs/vetur

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ

Info

  • Platform: Mac 10.14.6
    铻㈠箷蹇収 2019-10-16 涓婂崍10 53 06

  • Vetur version: 0.22.4
    铻㈠箷蹇収 2019-10-16 涓婂崍10 54 19

  • VS Code version: 1.38.1

Problem

The methods with decorator on the head line in Vue component will displays parsing errors.
But it is still running fine on the browser.

铻㈠箷蹇収 2019-10-16 涓婂崍11 08 26

铻㈠箷蹇収 2019-10-16 涓婂崍11 08 50

Reproducible Case

https://bitbucket.org/oster_huang/useful-annotation/src/master/

All 3 comments

You can't use decorator on object method.
You only can use decorator on clase method.

The Vue file use Typescript parser to parse script.
This error also exists in javascript file in Typescript parser.

Was this page helpful?
0 / 5 - 0 ratings