[@vuecompiler-sfc] defineProps is a compiler macro and no longer needs to be imported

Vue Vite项目启动后,控制台报错: [@vue/compiler-sfc] defineProps is a compiler macro and no longer needs to be imported.

具体报错提示如:

终端使用 npm run dev 启动项目

$ npm run dev            

> [email protected] dev
> vite
Pre-bundling dependencies:
  vue
(this will be run only when your dependencies or config have changed)
  vite v2.5.0 dev server running at:
  > Local: http://localhost:3000/
  > Network: use `--host` to expose
  ready in 1140ms.

[@vue/compiler-sfc] `defineProps` is a compiler macro and no longer needs to be imported.

这是使用 vite 初始化生成的项目,什么都还也没改呢,怎么就报错。

提示说: ‘defineProps’ 是一个编译宏,不再需要导入。

看看哪里引入defineProps了呢

搜索项目,在HelloWorld.vue中里发现了它:

即文件: vite-project/src/components/HelloWorld.vue


你可能感兴趣的:(前端,html,vue.js,javascript,前端)