Vscode写vue为什么出现了很多红色波浪线,说名称找不到

用Vscode写vue为什么出现了很多红色波浪线,说名称找不到。勾掉了很多配置文件,但还是不可以,有没有人遇到过同样的问题吖,该如何解决呢?
img

试下在
vetur的settings.json里的这个改为false
"vetur.experimental.templateInterpolationService": false,

变量或者方法名没有定义

$store.state不能直接这样用吧



```javascript
//App.vue
<template>
  <div id="app">
  <home></home>
  <h2>{{$store.state.counter}}</h2>
  <button @click="increment">+1</button>
  <button @click="decrement">-1</button>
  </div>
</template>

<script>
import Home from './pages/Home.vue'
export default {
  name: 'App',
  components: {
    Home
  },
  data() {
    return {

    }
  },
  methods: {
    increment(){
      this.$store.commit('increment')
    },
    decrement(){
      this.$store.commit('decrement')
    }
  },
}
</script>

<style>

</style>
//store/index.js
import { createStore } from 'vuex'

const store = createStore({
  // state现在要求写的是一个函数 返回一个对象
  state() {
    return {
      counter: 0,
      name: 'why',
      age: 18,
      height: 1.88
    }
  },
  mutations: {
    increment(state) {
      state.counter++
    },
    decrement(state) {
      state.counter--
    }
  }
});

export default store;



```

img


看下这个右下角的语言是选的vue吗😉

这个应该是Vetur插件的问题。在打开项目的时候,不要在Vscode里面导入多个,只导入这一个就不会有错了

你好 最后解决了吗 ?

我也遇到完全一样的问题了,我的是vue3+Volar。虽然运行结果没问题,但是vscode里一堆红色大波浪,难受求子