需要学习资源,请点击开挂教学楼
需要学习资源,请点击开挂教学楼
I recently updated from vue 2.1 to vue 2.5.
I have used vue-cli to create the project and then moved the previous 2.1 project's components to src folder.
After that I started receiving an error:
Uncaught TypeError: Cannot read property 'components' of undefined
at checkComponents (vue.esm.js?e1b2:1321)
at mergeOptions (vue.esm.js?e1b2:1442)
at mergeOptions (vue.esm.js?e1b2:1458)
at Vue$3.Vue._init (vue.esm.js?e1b2:4528)
at new Vue$3 (vue.esm.js?e1b2:4646)
at eval (main.js?3479:41)
at Object../src/main.js (app.js:5655)
at __webpack_require__ (app.js:679)
at fn (app.js:89)
at Object.0 (app.js:5928)
My main.js in as below:
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import { store } from './store'
import mixins from './mixins'
import VueRouter from 'vue-router'
import routes from './routes'
const router = new VueRouter({
routes: routes.routes
// mode: 'history'
})
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
render: h => h(App),
store: store,
mixins: [mixins]
})
Here is the App.vue file as requested:
<template>
<div id="app">
<el-container>
<navbar v-if="loggedIn"></navbar>
<el-aside style="width:auto; z-index:9999; ">
<sidebar v-if="loggedIn"></sidebar>
</el-aside>
<el-main style="width:auto;">
<router-view></router-view>
</el-main>
</el-container>
</div>
</template>
<script>
import Sidebar from './page_components/Sidebar'
import Navbar from './page_components/Navbar'
export default {
components: {
Sidebar,
Navbar
}
}
I am getting the error in following line in vue.esm.js: