Parsing error: invalid-first-character-of-tag-name.eslint-plugin-vue

created at 09-03-2021 views: 39

Problem Description:

The interpolation syntax and ternary expressions are used in the vue page, and the above error occurs, but it can run normally;

Error code such as:

<p>{{num<0?"你好":"hello"}}</>

error message:

[vue/no-parsing-error] 
Parsing error: invalid-first-character-of-tag-name.eslint-plugin-vue 
Parsing error: invalid-first-character-of-tag-name.eslint(vue/no-parsing-error)

Solve Eslint error

Method 1: We can use Html's escape character \<to replace the \

<p>{{ (num &lt; 1) ? "你好":"hello" }}</p>

Method 2: Use the v-text command

<p v-text="(num < 1) ? '你好':'hello'"></p>
created at:09-03-2021
edited at: 09-03-2021: