Answer the question
In order to leave comments, you need to log in
Unknown custom element Vue.js how to solve?
Hi all. Googling a lot about this, but nothing helped.
there is spa.blade.php:
<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>LK NN</title>
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
</head>
<body>
<div id="app">
<main-app></main-app>
</div>
<script src="{{ asset('js/app.js') }}"></script>
</body>
</html>
import Vue from 'vue';
import VueRouter from 'vue-router';
import Vuex from 'vuex';
import {routes} from './routes';
import MainApp from './components/MainApp.vue';
Vue.use(VueRouter);
Vue.use(Vuex);
const router = new VueRouter({
router,
mode: 'history'
});
const app = new Vue({
el: '#app',
router,
components: {
MainApp,
}
});
<template>
<div class="container-fluid">
<header>
...
</header>
<main>
...
</main>
<footer>
...
</footer>
</div>
</template>
<script>
export default {
name: 'main-app'
}
</script>
Answer the question
In order to leave comments, you need to log in
import Vue from 'vue';
import VueRouter from 'vue-router';
import Vuex from 'vuex';
import {routes} from './routes';
import MainApp from './components/MainApp.vue';
Vue.use(VueRouter);
Vue.use(Vuex);
Vue.component('main-app', MainApp);
const router = new VueRouter({
router,
mode: 'history'
});
const app = new Vue({
el: '#app',
router
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question