【问题标题】:laravel mix build successfully but vue.js new component not working or any changes not appearinglaravel mix 构建成功,但 vue.js 新组件不起作用或没有出现任何更改
【发布时间】:2017-07-28 23:16:04
【问题描述】:

我第一次在我的 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>

【问题讨论】:

  • 你能展示你的尝试吗? app.js 或任何组件?
  • @VaibhavrajRoham 我只是尝试更改默认的 example.vue 文件
  • 在您的问题中添加上述代码和更多解释
  • 你在哪里打电话&lt;my-vuetable&gt;
  • @VaibhavrajRoham 现在我没有使用它,因为 vue.js 根本没有加载。我对 进行了验证,之后我只是尝试编辑默认的 example.vue 不起作用:(

标签: laravel vue.js laravel-mix


【解决方案1】:

在 bootstrap.js 中查找“X-CSRF-TOKEN”:window.Laravel.csrfToken,并将其注释掉

【讨论】:

  • 非常感谢老兄.. 效果很好。对了,你能告诉我关于这个 TOKEN 的事吗?
猜你喜欢
  • 2019-03-06
  • 1970-01-01
  • 2016-06-10
  • 1970-01-01
  • 2019-10-10
  • 2017-12-18
  • 1970-01-01
  • 2016-10-20
  • 2011-04-26
相关资源
最近更新 更多