Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

299
Views
¿Cómo usar el enrutamiento en vue js?

Estoy trabajando en un proyecto vue js, para usar el enrutador, lo instalé a través del comando -> npm install vue-router y creé un archivo router.js, pero cuando lo intento, npm ejecuta el servicio, recibo advertencias de compilación y la aplicación no no funciona según lo previsto.

Error

advertencia en ./src/router.js

la exportación 'predeterminada' (importada como 'Router') no se encontró en 'vue-router' (exportaciones posibles: NavigationFailureType, RouterLink ....)

Estructura de directorios

 vuejsproj > node_modules > public > src > assets > components App.vue main.js router.js ...

enrutador.js

 import Vue from "vue"; import Router from "vue-router"; Vue.use(Router); export default new Router({ mode: "history", routes: [ { path: "/", alias: "/list", name: "list", component: () => import("./components/somecomponent") } ] });

principal.js

 import Vue from 'vue' import App from './App.vue' import vuetify from './plugins/vuetify' import router from './router' Vue.config.productionTip = false new Vue({ router, vuetify, render: h => h(App) }).$mount('#app')

paquete.json

 { "name": "app", "version": "0.1.0", "private": true, "scripts":{ "serve": "vue-cli-service serve", "build": "vue-cli-service build", "lint": "vue-cli-service lint" }, "dependencies": { "axios": "^0.27.2", "core-js": "^3.8.3", "vue": "^2.6.14", "vue-axios": "^3.4.1", "vue-router": "^4.015", "vuetify": "^2.6.0" }, }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!