Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 使用webpack和rails导入Bootstrap 4标记输入_Ruby On Rails_Webpack_Bootstrap 4_Yarnpkg - Fatal编程技术网

Ruby on rails 使用webpack和rails导入Bootstrap 4标记输入

Ruby on rails 使用webpack和rails导入Bootstrap 4标记输入,ruby-on-rails,webpack,bootstrap-4,yarnpkg,Ruby On Rails,Webpack,Bootstrap 4,Yarnpkg,我正在关注文档,并尝试使用webpack获取rails应用程序中的标记输入功能 我添加了以下行 import'tagsinput.js' 在我的application.js文件中导入此库,但执行warn安装似乎无法识别该库 我猜我导入它的方式不对,或者没有在webpack配置中初始化它。正在寻找有关使用Thread和webpack导入和使用此库的正确方法的帮助。我可以通过以下方式在Rails应用程序中使用webpack: A)通过纱线添加bootstrap4标记输入模块 yarn add boo

我正在关注文档,并尝试使用webpack获取rails应用程序中的标记输入功能

我添加了以下行
import'tagsinput.js'
在我的
application.js
文件中导入此库,但执行
warn安装
似乎无法识别该库

我猜我导入它的方式不对,或者没有在webpack配置中初始化它。正在寻找有关使用Thread和webpack导入和使用此库的正确方法的帮助。

我可以通过以下方式在Rails应用程序中使用
webpack

A)通过
纱线添加
bootstrap4标记输入
模块

yarn add bootstrap4-tagsinput
B)
bootstrap4标记导入我的
application.js

import 'bootstrap4-tagsinput/tagsinput.js'
C)将样式表导入我的主
scss
文件

@import "~bootstrap4-tagsinput/tagsinput";
以下是我的应用程序中的外观:


哈伦普。只有在我刷新表单时,才会显示标签。这似乎太早了