-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import and export may only appear at the top level #4
Comments
不支持 import 语法,你应该尝试把这个组件挂到全局的变量上(通过作为 umd 组件),然后在你的文档代码里使用。 你可以参考这个文档的做法: https://github.com/sodalife/soui-react/blob/master/docs/index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我希望使用react展现自己封装的组件的示例,于是在
md
文件中这样写:页面上提示:
Uncaught SyntaxError: unknown: 'import' and 'export' may only appear at the top level
原因是import被一个匿名函数包起来了:
(function() { import Counter from ... })
请问这个问题怎么解决?难道不能用import吗?谢谢🙏
The text was updated successfully, but these errors were encountered: