最近,我从Themeforest(Keen)购买了主题,并试图在Vue.js应用程序中包含该主题的脚本,但是这些脚本会引发错误。
我在App.vue模板使用“导入”试图进口这些脚本,尝试包括通过脚本标签的脚本public.html,尝试包括通过main.js脚本使用document.createElement(“脚本”) 。jQuery出现问题,但我通过npm安装并包含在main.js中来解决该问题,因此Bootstrap的脚本实际上可以正常工作。
有错误,哪些脚本抛出了我:
app.bundle.js:4 Uncaught ReferenceError: KTUtil is not defined
at app.bundle.js:4
at app.bundle.js:66
jquery.js?1157:3850 Uncaught TypeError: Cannot read property 'initMediumChart' of undefined
at mediumCharts (dashboard.js:11)
at Object.init (dashboard.js:952)
at HTMLDocument.<anonymous> (dashboard.js:972)
at mightThrow (jquery.js?1157:3557)
at process (jquery.js?1157:3625)
fullcalendar.bundle.js:1327 Uncaught TypeError: Cannot read property 'fn' of undefined
at Object.<anonymous> (fullcalendar.bundle.js:1327)
at __webpack_require__ (fullcalendar.bundle.js:35)
at Object.<anonymous> (fullcalendar.bundle.js:4820)
at __webpack_require__ (fullcalendar.bundle.js:35)
at Object.<anonymous> (fullcalendar.bundle.js:2045)
at __webpack_require__ (fullcalendar.bundle.js:35)
at Object.<anonymous> (fullcalendar.bundle.js:14373)
at __webpack_require__ (fullcalendar.bundle.js:35)
at fullcalendar.bundle.js:78
at fullcalendar.bundle.js:81
Uncaught ReferenceError: PerfectScrollbar is not defined
at init (scripts.bundle.js:1448)
at Object.scrollInit (scripts.bundle.js:1462)
at HTMLDivElement.<anonymous> (scripts.bundle.js:1600)
at Function.each (jquery.js?1157:367)
at jQuery.fn.init.each (jquery.js?1157:202)
at initScroll (scripts.bundle.js:1598)
at Object.initComponents (scripts.bundle.js:1659)
at Object.init (scripts.bundle.js:1655)
at HTMLDocument.<anonymous> (scripts.bundle.js:1820)
at mightThrow (jquery.js?1157:3557)
我希望所有脚本都能正常工作,并且看起来像这个演示:https : //keenthemes.com/keen/preview/demo4/index.html
但是实际上只有jQuery和Bootstrap起作用。在我看来,它是可以修复的,但是我不知道如何。
相关分类