If you haven't changed anything and correctly installed and installed JavaScript, the problem may be the default implementation of Laravel.
, , , , , (vue ) , .
, Vue
( , - JavaScript). , Vue, , - :
< > /App.vue
<template>
<div>
I'm a base component
<router-view></router-view>
</div>
</template>
app.js
import App from './components/App.vue'
new Vue({
render: h => h(App)
}).$mount("#app");
app.blade.php
<html>
<head>
</head>
<body>
<div id="app"></div>
<script src="app.js"></script>
</body>
</html>
, app.blade.php
, App.vue
, , ( vue-router). , app.js
webpack, , , . , , routes/web.php
. , , SPA.
Laravel , Vue , :
app.js
Vue.component('my-component', require('./components/My-component.vue'));
const app = new Vue({
el: '#app'
});
index.blade.php
<html>
<head>
</head>
<body>
<div id="app">
<my-component></my-component>
</div>
<script src="app.js"></script>
</body>
</html>
, app
div . , vue +, Laravel Mix , runtime + compiler
Vue ( , ).
, Laravel Mix
, , , , " Laravel Mix Vue + compiler
", , .
webpack , , Vue webpack simple config .
webpack, webpack, runtime + compiler
build:
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
}
, . , Webpack Mix Vue + compiler
, , . , , , , .