Home Web Front-end JS Tutorial Solve the problem that vue2.0 routing does not display router-view

Solve the problem that vue2.0 routing does not display router-view

Mar 28, 2018 pm 05:11 PM
ie

This time I will bring you a solution to the problem of vue2.0routingnot displaying router-view, and a solution to the problem of vue2.0 routing not displaying router-viewWhat are the precautions? The following is a practical case, let’s take a look.

Today I learned the router-view of vue2.0, and there were countless errors. I don’t know which master wrote router-view. The configured parameters were not routers, but routes =_=||

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');
Copy after login

Here /* eslint-disable */ is the eslint code check. If you don’t add this, an error will be reported that 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:

Routing permission management of Vue

##How to compress and merge JS files in node

The above is the detailed content of Solve the problem that vue2.0 routing does not display router-view. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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

Hot Article

Hot tools Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Internet Explorer opens Edge: How to stop MS Edge redirection Internet Explorer opens Edge: How to stop MS Edge redirection Apr 14, 2023 pm 06:13 PM

Internet Explorer opens Edge: How to stop MS Edge redirection

What should I do if win11 cannot use ie11 browser? (win11 cannot use IE browser) What should I do if win11 cannot use ie11 browser? (win11 cannot use IE browser) Feb 10, 2024 am 10:30 AM

What should I do if win11 cannot use ie11 browser? (win11 cannot use IE browser)

How to cancel the automatic jump to Edge when opening IE in Win10_Solution to the automatic jump of IE browser page How to cancel the automatic jump to Edge when opening IE in Win10_Solution to the automatic jump of IE browser page Mar 20, 2024 pm 09:21 PM

How to cancel the automatic jump to Edge when opening IE in Win10_Solution to the automatic jump of IE browser page

The end of an era: Internet Explorer 11 is retired, here's what you need to know The end of an era: Internet Explorer 11 is retired, here's what you need to know Apr 20, 2023 pm 06:52 PM

The end of an era: Internet Explorer 11 is retired, here's what you need to know

How to solve the problem that IE shortcut cannot be deleted How to solve the problem that IE shortcut cannot be deleted Jan 29, 2024 pm 04:48 PM

How to solve the problem that IE shortcut cannot be deleted

How to enable IE acceleration function How to enable IE acceleration function Jan 30, 2024 am 08:48 AM

How to enable IE acceleration function

Win10 Home Edition IE browser suddenly cannot be opened Win10 Home Edition IE browser suddenly cannot be opened Jan 18, 2024 pm 02:57 PM

Win10 Home Edition IE browser suddenly cannot be opened

How to deal with the locked homepage of Windows 10 system IE How to deal with the locked homepage of Windows 10 system IE Mar 28, 2024 pm 01:10 PM

How to deal with the locked homepage of Windows 10 system IE

See all articles