這篇文章主要介紹使用Laravel5.4 進(jìn)行vuejs組件化測(cè)試可能遇到的問(wèn)題,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!

在使用Laravel5.4 進(jìn)行vuejs組件化測(cè)試時(shí),出現(xiàn)了這樣的錯(cuò)誤:
vagrant@homestead:~/Code/zhihu-app$ gulp
[00:35:03] Using gulpfile ~/Code/zhihu-app/gulpfile.js
[00:35:03] Starting 'all'...
[00:35:03] Starting 'sass'...
[00:35:09] Finished 'sass' after 5.74 s
[00:35:09] Starting 'webpack'...
{ [Error: ./resources/assets/js/components/Example.vue
Module parse failed: /home/vagrant/Code/zhihu-app/resources/assets/js/components/Example.vue Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| <template>
| <div class="container">
| <div class="row">
@ ./resources/assets/js/app.js 17:26-61]
message: './resources/assets/js/components/Example.vue\nModule parse failed: /home/vagrant/Code/zhihu-app/resources/assets/js/components/Example.vue Unexpected token (1:0)\nYou may need an appropriate loader to handle this file type.\n| <template>\n| <div class="container">\n| <div class="row">\n @ ./resources/assets/js/app.js 17:26-61',
showStack: false,
showProperties: true,
plugin: 'webpack-stream',
__safety: { toString: [Function: bound ] } }從拋出的錯(cuò)誤我們可以看到,是未引入 'laravel-elixir-vue-2',
所以,我們需要下載相應(yīng)的包,然后引入到gulpfile.js文件中。
var elixir = require('laravel-elixir');
require('laravel-elixir-vue-2');// recommended for vue 2
elixir(function(mix) {
mix.sass('app.scss')
.webpack('app.js');
mix.version(['js/app.js', 'css/app.css'])
});如果出現(xiàn)Error: Cannot find module 'laravel-elixir-vue-2'錯(cuò)誤,則需要下載laravel-elixir-vue-2:
npm install laravel-elixir-vue-2 --save-dev
有關(guān)詳情,請(qǐng)看GitHub laravel-elixir-vue-2(https://github.com/vuejs/laravel-elixir-vue-2)包用法
以上是“使用Laravel5.4 進(jìn)行vuejs組件化測(cè)試可能遇到的問(wèn)題”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
網(wǎng)站標(biāo)題:使用Laravel5.4進(jìn)行vuejs組件化測(cè)試可能遇到的問(wèn)題-創(chuàng)新互聯(lián)
標(biāo)題URL:http://www.js-pz168.com/article8/jjdip.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站內(nèi)鏈、企業(yè)建站、網(wǎng)站設(shè)計(jì)、關(guān)鍵詞優(yōu)化、網(wǎng)站營(yíng)銷(xiāo)、網(wǎng)站排名
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容