Home >Web Front-end >JS Tutorial >How to deal with vue2.0 routing not showing router-view

How to deal with vue2.0 routing not showing router-view

php中世界最好的语言
php中世界最好的语言Original
2018-04-11 16:40:163484browse

This time I will bring you vue2.0 RoutingHow to deal with router-view not showing, how to deal with vue2.0 routing not showing router-viewNotesYes Which ones, the following are practical cases, let’s take a look.

This is the main.js that I spent all morning working on, and there are also reminders from colleagues on the Internet:

import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './App';
import goods from './components/goods/goods';
Vue.config.productionTip = false;
Vue.use(VueRouter);
const routes = [
 {path: '/goods', component: goods}
];
const router = new VueRouter({
 routes
});
/* eslint-disable */
const app = new Vue({
 router,
 render: h => h(App)
}).$mount('#app');
//默认跳转到 '/goods'
router.push('/goods');

Here /* eslint-disable */ is the eslint code check. If you don't add this, an error will be reported and the app is not used.

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

How to deal with the white screen on the homepage after vue build is packaged

How Native uses fetch to implement the image upload function

The above is the detailed content of How to deal with vue2.0 routing not showing router-view. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn