我在Phoenix框架上将jQuery连接到我的项目时遇到问题。我已经通过npm install
安装了jQuery。npm i jquery
我将导入添加到app.js。
import $ from 'jquery'
我对package.json的依赖
"jquery": "^3.4.1","phoenix": "file:../deps/phoenix","phoenix_html": "file:../deps/phoenix_html"
但是在控制台中我有错误
未捕获的ReferenceError:未定义$
我的js
<script>
$("#login-btn").click(function(){
console.log("Sign in button pressed");
});
</script>
请帮帮我。