如何使用导入地图在铁轨中添加引导和jQuery?
我是设置Rails 7应用程序。而且我不想使用导入地图添加Bootstrap和jQuery。我会尝试但不起作用。如果我犯了任何错误,请遵循此步骤,请纠正。
- Rails新的演示
- 捆绑安装安装
- 使用索引创建演示控制器,并添加一些自举代码。
- 然后,我运行此命令bin/importmap pin bootstrap
so。在导入地图中添加了这两行 PIN“ Bootstrap”,to:“ https://ga.jspm.io/npm:< a href =” //cdn-cgi/l/lim/email-protection“ class” class =“ __ cf_email__” data-cfemail =“电子邮件&nbsp;受保护] /dist/js/bootstrap.esm.js” pin“@popperjs/core”,to:“ https://ga.jspm.io/npm:@popperjs/< a href =”/cdn-cgi/l/l/email-protection class =“ __ cf_email__” data-cfemail =“ D7B4B8A5B297E5F9E6E6F9E2”> [email&nbsp; procepted] /lib/index.js“
如果我已经在importmap.rb文件中pin bootstrap。为什么它不起作用,或者我错过了一些饱受的才能。
感谢您的重播。
I'm setup rails 7 app. And i wan't to add bootstrap and jquery using import map. I'll try but didn't work. I follow this step if i made any mistake please correct.
- rails new demo
- bundle install
- create demo controller with index and add some bootstrap code.
- Then i run this command bin/importmap pin bootstrap
So. in Import map added this two line
pin "bootstrap", to: "https://ga.jspm.io/npm:[email protected]/dist/js/bootstrap.esm.js"
pin "@popperjs/core", to: "https://ga.jspm.io/npm:@popperjs/[email protected]/lib/index.js"
If i already pin bootstrap in importmap.rb file. Why it's not working or i missing some configration.
Thanks for replay.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请检查您的以下文件具有相应的内容:
并使用
bin/dev
命令运行服务器,以安装
jQuery
运行bin/importMap pin jquery
command并将其导入application.js
文件Please check that you have following files with corresponding content:
And run server with
bin/dev
commandTo install
JQuery
runbin/importmap pin jquery
command and import it inapplication.js
file