vue使用了setup语法糖然后,eslint检查说你啥没使用啊,啥定义了不用啊 之类的
1:首先检查你的 slint-plugin-vue 的版本
2:如果你的版本在8.0以下就在 .eslintrc.js 文件:
globals: {
defineProps: "readonly",
defineEmits: "readonly",
defineExpose: "readonly",
withDefaults: "readonly",
},
3: 如果在8.0之上就在 .eslintrc.js 文件:
env: {
node: true,
// The Follow config only works with eslint-plugin-vue v8.0.0+
"vue/setup-compiler-macros": true,
},
4:如果你的版本低 其实你可以升级到8.0在看 如果报错你就在降级回去嘛 反正多试试,又不要你钱 对不对???