Giter Site home page Giter Site logo

引入第三方js 的问题 about react-luo HOT 9 CLOSED

javaluo avatar javaluo commented on May 27, 2024
引入第三方js 的问题

from react-luo.

Comments (9)

javaLuo avatar javaLuo commented on May 27, 2024

可以直接在src/index.html中写<script src="..."></script>
一般常见的第3方JS库都有NPM包,可以搜索一下,然后npm install到项目里,这样比较正规。

from react-luo.

zhans1993 avatar zhans1993 commented on May 27, 2024

我是使用 MD5 遇到一个问题,之前使用hex_md5(password) ,我在react 里面 import 进来发现对应不到方法,没找到对应的npm 包

from react-luo.

javaLuo avatar javaLuo commented on May 27, 2024

额,有个md5-hex包,不知道行不行
我也没用过

from react-luo.

zhans1993 avatar zhans1993 commented on May 27, 2024

刚用笨办法一个一个试过了,第一个 md5 就可以,还是谢谢指点

from react-luo.

zhans1993 avatar zhans1993 commented on May 27, 2024

还有就是我直接在<script src="..."></script>这样引入的时候,一直报路径找不到的错误,路劲有什么要求吗
Uncaught SyntaxError: Unexpected token <

from react-luo.

javaLuo avatar javaLuo commented on May 27, 2024

@zhans1993
只能用绝对路径,第3方库引入的话可以用国内的CDN:http://www.bootcdn.cn/

from react-luo.

zhans1993 avatar zhans1993 commented on May 27, 2024

哦哦,明白了,谢谢。

from react-luo.

zhans1993 avatar zhans1993 commented on May 27, 2024

还是路径问题,我在src/assets/html2canvas.js 有js
例如src/index.html中写<script src="/src/assets/html2canvas,js"></script> 还是没有找到。。
主要还有类似的图片的引入问题,html2canvas我已经解决了,引入了npm 包,真是麻烦了

from react-luo.

javaLuo avatar javaLuo commented on May 27, 2024

@zhans1993
可以直接使用这个CDN地址:
https://cdn.bootcss.com/html2canvas/0.5.0-beta4/html2canvas.min.js
或者 npm install html2canvas
html2canvas库有对应的npm包

from react-luo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.