我在将我的uikit.js导入我的react js组件时遇到了困难。
这是我的导入示例,uikit.css可以工作,但是uikit.js提供了这种错误:
import './uikit/css/uikit.css';
import './uikit/js/uikit.js';
Line 5: 'define' is not defined no-undef
Line 5: 'define' is not defined no-undef
Line 573: 'DocumentTouch' is not defined no-undef
Line 1107: 'MSGesture' is not defined no-undef
Line 5039: Unexpected use of 'location' no-restricted-globals
Line 5043: Unexpected use of 'location' no-restricted-globals
Line 6679: Unexpected use of 'location' no-restricted-globals
这应该不是问题。首先用以下命令安装uikit
npm i uikit --save
然后将其导入到您的应用程序中,就像处理其他任何软件包一样。
如果您使用create-react-app
,并且正在src
目录中调用它,则只需执行
import '../node_modules/uikit/css/uikit.css'
否则确定深度并相应地调整相对路径
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句