vscode:Module ‘“xxx/node_modules/vue/dist/vue“‘ has no exported member ‘ref‘
Module '"xxx/node_modules/vue/dist/vue"' has no exported member 'ref'
·
背景
在使用 vue3 + ts 的时候
import { ref, onMounted } from "vue";
vscode 报错:
Module '"xxx/node_modules/vue/dist/vue"' has no exported member 'ref'
Module '"xxx/node_modules/vue/dist/vue"' has no exported member 'onMounted'
虽然不影响运行,但是上面有红色波浪线就很难受
解决
注意几点:
1、禁用 vetur,安装 volar(这里我之前安装了 vetur-wepy 也需要禁用)
2、更新 vscode
3、重启 vscode,更新 volar 到最新版本
更多推荐
已为社区贡献7条内容
所有评论(0)