📜  如何在 html 代码示例中使用 npm 包

📅  最后修改于: 2022-03-11 14:53:23.982000             🧑  作者: Mango

代码示例1
npm install the packages in the node_modules folder, the front end
cannot use it directly, you need ES6 syntax and import them by
using the following code:

import html2cavas from "html2cavas"

then you need to use Babel to transpile your ES6 code to normal JS code
Here is the explanation:
https://hackernoon.com/use-es6-javascript-syntax-require-import-etc-in-your-front-end-project-5eefcef745c2

After that you can use the