如何使用 ES6 语法导入 jquery? [英] How to import jquery using ES6 syntax?
本文介绍了如何使用 ES6 语法导入 jquery?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 (JavaScript) ES6
语法通过 babel
转译器和 preset-es2015
插件以及semantic-ui
用于样式.
index.js
import * as stylesheet from '../assets/styles/app.scss';import * as jquery2 from '../dist/scripts/jquery.min';import * as jquery3 from '../node_modules/jquery/dist/jquery.min';console.log($('my-app'));
index.html
<html lang="fr"><头><身体><script src="dist/app.js"></script>