在搭建了一个Vue 3项目后,我注意到我的App.vue中出现了一个错误。
A functional component that renders the matched component for the given path. Components rendered in can also contain its own , which will render components for nested paths.
API Reference
[vue/no-multiple-template-root]
The template root requires exactly one element.eslint-plugin-vue
我试着把
"vue/no-multiple-template-root": 0
在我的.eslintrc.js中
但是错误仍然存在。我怎样才能摆脱这个错误呢?因为在Vue 3中,一个模板中不需要只有一个元素。
module.exports = {
root: true,
env: {
node: true
},
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/typescript/recommended",
"@vue/prettier",
"@vue/prettier/@typescript-eslint"
],
parserOptions: {
ecmaVersion: 2020
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"vue/no-multiple-template-root": 0
}
};
发布于 2021-01-06 17:58:16
检查
vscode-> plugins-> close Vetur
重新启动vscode,然后打开Vetur。
有关更多信息,请查看下面的链接:https://github.com/vuejs/eslint-plugin-vue/issues/1297#issuecomment-755202013
https://stackoverflow.com/questions/64867504
复制相似问题