2017-07-04 24 views
0

代碼正在使用需要的數據表插件是上通過節點初始化數據表中的錯誤需要

window.$ = window.jQuery = require('jquery'); 

dt = require('datatables.net')(window, $); 
dt_bs = require('datatables.net-bs')(window, $); 
buttons = require('datatables.net-buttons')(window, $); 
buttons_bs = require('datatables.net-buttons-bs')(window, $); 
responsive = require('datatables.net-responsive')(window, $); 
responsive_bs = require('datatables.net-responsive-bs')(window, $); 
colreorder = require('datatables.net-colreorder')(window, $); 
fixedheader = require('datatables.net-fixedheader')(window, $); 
scroller = require('datatables.net-scroller')(window, $); 

但是當我編譯資產和運行錯誤我得到的是

TypeError: this is undefined 

我不不知道什麼是做錯了,是的我已經測試了錯誤來自本節,因爲如果我註釋掉該部分沒有錯誤,所以任何幫助將不勝感激,它已經讓我瘋了。提前致謝。

P.S.This是我自己參考

+0

在瀏覽器中運行該代碼? – evolutionxbox

+0

在瀏覽器中運行之前吞噬js文件 – lulliezy

+0

錯誤來自哪裏? – evolutionxbox

回答

0

我有我的代碼更改爲這和錯誤消失

window.$ = window.jQuery = require('jquery'); 

dt = require('datatables.net'); 
dt_bs = require('datatables.net-bs'); 
buttons = require('datatables.net-buttons'); 
buttons_bs = require('datatables.net-buttons-bs'); 
responsive = require('datatables.net-responsive'); 
responsive_bs = require('datatables.net-responsive-bs'); 
colreorder = require('datatables.net-colreorder'); 
fixedheader = require('datatables.net-fixedheader'); 
scroller = require('datatables.net-scroller');