Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

111
Visualizações
VueRouter instance is not responding

I am learning vue. I installed vue-router by npm install vue-router. I registered VueRouter and define my url path in the VueRouter instances in main.js file. Created About components and in the app.vue file component used. But the route is not working in http://localhost:8080/about/#/ url or http://localhost:8080/#/about . I also tried to remove the # tag from the url. Here is the source code:

Main.js

import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import About from './components/About';
Vue.use(VueRouter);
const route = [
  {path:'/about',component: About}
];
const router = new VueRouter({
  route
});
Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router: router,
}).$mount('#app')
 

App.vue

<template>
  <div id="app">
    
    <router-view/>
  </div>
</template>

<script>

export default {
  name: 'App',
  components: {
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

About.vue

<template>
    <div id="about">
        <h3>About Page</h3>
    </div>
</template>

<script>

export default{
    name: 'About'
}
</script>

Package.json

"dependencies": { "core-js": "^3.6.5", "vue": "^2.6.11", "vue-router": "^3.5.2" },

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

VueRouter is expecting routes but you gave him a route property.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda