vue3运行项目一堆警告
想着学习一下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
然后打开网页之后报的错:
请教一下哪里写错了?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论