Vue2 使用Volar 报错:<template v-for> key should be placed on the <template> tag
问题Vue2 项目开发,在 VS Code 上使用插件 Volar 来进行语法提示、语法检查。对没有放在<template v-for>元素上的:key,会提示<template v-for> key should be placed on the <template> tag.解决办法把template替换为div:...
·
问题
Vue2 项目开发,在 VS Code 上使用插件 Volar 来进行语法提示、语法检查。
对没有放在<template v-for>元素上的:key,会提示<template v-for> key should be placed on the <template> tag.

解决办法1
为vue2项目创建一个工作区使用vue2相关的一些插件;为vue3项目创建另外一个工作区。

解决办法2
把template替换为div:

示例2:

更多推荐


所有评论(0)