标签: popperjs

使用 Parcel-Bundler 构建 Web 应用程序时遇到问题(编译后未加载 Java)

美好的一天,伙计们!\n我在网上寻找解决方案,但找不到,所以我向你寻求帮助。请耐心听我完整描述情况。

\n

我是一名初学者,在开发引导 Web 项目时遇到了 Parcel 问题。\nFirst, it throws an error for using index.js which doesn\'t make any sense. As per the bootstrap, doc. folder structure suppose to be

\n
project-name/\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 build/\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 node_modules/\n\xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 bootstrap/\n\xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 popper.js/\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 scss/\n\xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 custom.scss\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 src/\n\xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 index.html\n\xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 index.js\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 package.json\n
Run Code Online (Sandbox Code Playgroud)\n

我正在严格遵循引导文档。链接: https: //getbootstrap.com/docs/5.0/getting-started/parcel/

\n

项目使用的包

\n
    \n
  • 包裹捆绑器,

    \n
  • \n
  • 波普尔和

    \n
  • \n
  • 引导程序

    \n
  • \n
\n

使用简单的 HTML 重新创建问题

\n

索引.html

\n
<!DOCTYPE html>\n<html lang="en">\n<head>\n  <meta charset="UTF-8">\n  <meta http-equiv="X-UA-Compatible" content="IE=edge">\n …
Run Code Online (Sandbox Code Playgroud)

html javascript parceljs popperjs bootstrap-5

9
推荐指数
3
解决办法
6912
查看次数

Rails 7 导入映射引导程序

因此,我通过执行以下操作来设置我的 Rails 7 应用程序。

rails new .
Run Code Online (Sandbox Code Playgroud)

为了添加引导程序,我使用 importmap (无 webpacker)实现了它,如下所示

./bin/importmap pin bootstrap
Run Code Online (Sandbox Code Playgroud)

加载了这些行(我添加了预加载:true)

pin 'bootstrap', to: https://ga.jspm.io/npm:bootstrap@5.1.3/dist/js/bootstrap.esm.js', preload: true
pin '@popperjs/core', to: 'https://ga.jspm.io/npm:@popperjs/core@2.11.2/lib/index.js', preload: true
Run Code Online (Sandbox Code Playgroud)

然后在我的 application.js 上,我添加了

import "bootstrap"
import "@popperjs/core"
Run Code Online (Sandbox Code Playgroud)

我可以通过执行以下操作来使用 toast 元素

 # toast_controller.js
import { Controller } from "@hotwired/stimulus"
import * as bootstrap from 'bootstrap'

// Connects to data-controller="toast"
export default class extends Controller {
  connect() {
    const toast = new bootstrap.Toast(this.element, {
      delay: 5000,
      animation: true,
      autohide: true
    })
    toast.show()
  }
}
Run Code Online (Sandbox Code Playgroud)

它运行良好,但是当我尝试使用菜单上的工具提示时,我开始遇到引导问题 …

ruby-on-rails twitter-bootstrap popperjs import-maps

8
推荐指数
1
解决办法
5422
查看次数

npm 中的“popper”和“popper.js”是两个不同的包吗?

我正在学习使用此命令安装 popper: 的教程 npm install popper --save。但是当我尝试它时收到此错误消息:致命错误 - 检测到 cygheap base mismatch - 0x13A1410/0x13D1410

所以我搜索找到这个库的github页面并找到了这个页面:https : //github.com/FezVrasta/popper.js但我看到它建议使用这个命令来安装它:npm install popper.js --save它与我的教程不同。现在我想知道这些对图书馆有什么不同吗?如果它们不同,那么poppenot的 github 页面popper.js是什么?

我还必须提到,我没有说 python popper 库。我想要 .js 使用的 javascript 版本bootstrap4

npm bootstrap-4 popper.js react-popper popperjs

4
推荐指数
1
解决办法
899
查看次数

由于popper js打字稿错误,React应用程序构建失败

我有使用 bootstrap 4.3.1 作为节点模块的 React 应用程序。当我构建应用程序时,它给出了以下错误TypeScript error in /codebuild/output/src478180495/src/app-name/node_modules/@popperjs/core/lib/createPopper.d.ts(1,13): '=' expected. TS1005 > 1 | import type { OptionsGeneric, Modifier, Instance, VirtualElement } from "./types";之前没问题。今天出现错误。

typescript reactjs popperjs

4
推荐指数
1
解决办法
2688
查看次数