我正在使用React,并且想要使用一个只能通过URL检索的软件包。在HTML中,可以使用script标签轻松导入,但是如何导入到JavaScript文件中呢?
我想做的是将此内容转换为:
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
将其转化为类似以下的内容:
变成这样
import 'https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true'
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- Liam