I have been trying to run my vue.js app with laravel, without
php artisan serve
But been seriously failing, here is my code:
package.json:
"axios": "^0.17",
"bootstrap-sass": "^3.3.7",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^1.0",
"lodash": "^4.17.4",
"vue": "^2.5.7",
"vue-router": "^3.0.1"
app.js:
import './bootstrap'
import router from './routes'
const app = new Vue({
el: '#root',
router
});
routes.js:
import VueRouter from 'vue-router'
let routes = [
{
path: '/',
component: require('./components/site/layouts/main-page'),
children: [
{
path: '/',
component: require('./components/site/views/home')
}
]
}
];
export default new VueRouter({
mode: 'history',
linkActiveClass: 'active',
routes
});
main-page.vue:
<template>
<div>
<header></header>
<router-view></router-view>
<footer></footer>
</div>
</template>
home.vue:
<template>
<div>
<h1>Hello World!</h1>
</div>
</template>
welcome.blade.php:
<div id="root">
<router-view></router-view>
</div>
I shall be much obliged if anyone can assist me by correcting my wrong.