我是非常新的反应,并且在使用本机反应方面没有足够的知识,所以我使用create-react-app
。reactjs:导入时出错uikit.min.js
我试图使用UIKit作为框架,但我无法让它工作。由于UIKit的NPM模块仅支持其2.x版本,因此我试图使用它的3.x(来自http://www.getuikit.com/)。我在我的一个组件中导入JS文件(uikit.min.js
),但编译失败。
我包括在该文件中import * as uikit from 'uikit.min.js';
这编译时会弹出:
./src/assets/js/uikit.min.js
Line 3: 'define' is not defined no-undef
Line 3: 'define' is not defined no-undef
Line 4: Unexpected use of 'location' no-restricted-globals
Line 4: Unexpected use of 'location' no-restricted-globals
Line 5: Unexpected use of 'location' no-restricted-globals
Line 5: 'DocumentTouch' is not defined no-undef
Line 5: 'MSGesture' is not defined no-undef
Search for the keywords to learn more about each error.
也许我做错了,但我怎么能导入此我使用的UIKit V3?
你或许可以将其包含在你的HTML文件作为脚本依赖 –
@ShubhamKhatri试过,但我需要使用UIKit中的功能,如'UIkit.modal(“...”)。切换()'。 –