Router not working properly. It looks like working
App running at:
- Local: http://localhost:8080/
But it seems router can't see the component ((
My Router
import Vue from 'vue'
import VueRouter from 'vue-router'
import Web from '@/views/Web.vue'
Vue.use(VueRouter)
const routes = [
{
path: '/web',
name: 'Web',
component: Web
},
{
path: '/about',
name: 'About',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: function () {
return import(/* webpackChunkName: "about" */ '../views/About.vue')
}
}
]
const router = new VueRouter({
routes
})
export default router
My Component:
<template>
<h1>Hello</h1>
</template>
<script>
export default {
name: 'Web'
}
</script>
My Error:
App running at:
- Local: http://localhost:8080/
But there are nothing happens (
What it can it be ?
May be I need some dependencies in my package.json ?
{
"name": "osprey",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve ",
"build": "vue-cli-service build"
},
"dependencies": {
"autoprefixer": "^9.8.6",
"live-server": "^1.2.1",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-router": "~4.4.0",
"@vue/cli-plugin-vuex": "~4.4.0",
"@vue/cli-service": "~4.4.0",
"node-sass": "^4.9.0",
"sass-loader": "^7.0.1",
"vue-template-compiler": "^2.5.17"
}
}
or something in my vue.config.json ?
module.exports = {
css: {
loaderOptions: {
sass: {
data: `@import "@/styles/_variables.scss";`
}
}
}
};