vue3运行项目一堆警告

发布于 2022-09-12 22:35:31 字数 2539 浏览 16 评论 0

想着学习一下vue3,谁知道刚运行就一堆警告了,求教:

 WARNING  Compiled with 16 warnings
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'computed' was not found in 'vue'
 warning  in ./src/main.js
"export 'createApp' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'defineComponent' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'getCurrentInstance' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'h' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'inject' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'nextTick' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'onActivated' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'onDeactivated' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'onUnmounted' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'provide' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'reactive' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'ref' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'shallowRef' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'unref' was not found in 'vue'
 warning  in ./node_modules/vue-router/dist/vue-router.esm-bundler.js
"export 'watch' was not found in 'vue'

项目的main.js写法:

import {createApp} from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

//引入element-ui框架
import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';

createApp(App).
use(router).
use(store).
use(ElementPlus).
mount('#app')

router路由index.js写法:

import { createRouter, createWebHashHistory} from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
    }
 ],
})

export default router

然后打开网页之后报的错:
image.png

请教一下哪里写错了?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文