我第一次在我的laravel应用程序中使用vue.js。每次出现的消息都显示laravel mix构建成功但我的vie.js注释更改未显示。
require('./bootstrap');
Vue.component('example', require('./components/Example.vue'));
Vue.component('my-vuetable', require('./components/MyVuetable.vue'));
const app = new Vue({
el: '#app'
});
我忘了运行任何重要的命令?
视图:
<div class="content">
<div class="title m-b-md">
Laravel
</div>
<div id="app">
<example></example>
</div>
</div>
组件
<template>
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">
<h1>Example Component</h1>
</div>
<div class="panel-body"> I'm an example component 5 </div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
mounted() {
console.log('Component mounted.')
}
}
</script>
答案 0 :(得分:1)
查找'X-CSRF-TOKEN':window.Laravel.csrfToken,并将其注释掉