最近,我從Themeforest(Keen)購買了主題,并試圖在Vue.js應(yīng)用程序中包含該主題的腳本,但是這些腳本會引發(fā)錯誤。我在App.vue模板使用“導(dǎo)入”試圖進(jìn)口這些腳本,嘗試包括通過腳本標(biāo)簽的腳本public.html,嘗試包括通過main.js腳本使用document.createElement(“腳本”) 。jQuery出現(xiàn)問題,但我通過npm安裝并包含在main.js中來解決該問題,因此Bootstrap的腳本實際上可以正常工作。有錯誤,哪些腳本拋出了我:app.bundle.js:4 Uncaught ReferenceError: KTUtil is not defined at app.bundle.js:4 at app.bundle.js:66jquery.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:81Uncaught 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起作用。在我看來,它是可以修復(fù)的,但是我不知道如何。
如何在Vue.js中正確包含購買的主題中的腳本
森林海
2021-04-09 13:11:33