【问题标题】:Laravel Jetstream install Bootstrap and JqueryLaravel Jetstream 安装 Bootstrap 和 Jquery
【发布时间】:2021-05-02 08:30:30
【问题描述】:

我已经在我的 Laravel 8 项目中安装了 Jetstream 和 Livewire。但我不知道如何将 JQuery 和 Bootstrap 包含到我的项目中。我该怎么做?

编辑:Bootstrap 部分已理解,但仍无法安装 Jquery。

JQUERY 部分

正如@codedge 所说,我尝试在我的项目文件夹和其他地方运行npm require jquery 命令,它给了我这个输出:

Usage: npm <command>

where <command> is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    clean-install, clean-install-test, completion, config,
    create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
    edit, explore, fund, get, help, help-search, hook, i, init,
    install, install-ci-test, install-test, it, link, list, ln,
    login, logout, ls, org, outdated, owner, pack, ping, prefix,
    profile, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, team, test, token, tst, un,
    uninstall, unpublish, unstar, up, update, v, version, view,
    whoami

npm <command> -h  quick help on <command>
npm -l            display full usage info
npm help <term>   search for help on <term>
npm help npm      involved overview

Specify configs in the ini-formatted file:
    C:\Users\YARKIN\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@6.14.10 D:\nodejs\node_modules\npm

Did you mean this?
    rebuild

EDIT-2:我无法将 Jquery 添加到我的 public\js\app.js 中,尽管我已经安装并需要它 resources\js\app.js。

【问题讨论】:

标签: php laravel twitter-bootstrap jetstream


【解决方案1】:

Jetstream 不支持 Bootstrap 和 jQuery - 这是有意为之,如 Github issue 中所述。

有一个包为 Jetstream 带来了对 Bootstrap 的支持:https://github.com/nascent-africa/jetstrap

jQuery 可以通过npm install jqueryrequired 在你的app.js 中安装。

【讨论】:

  • 我得到了 Bootstrap 部分。但是无法使用上面的命令安装 jquery,它建议我重建命令。
  • 您能分享您执行的步骤以及显示的错误消息吗?请更新您的原始帖子。
  • 我已经对其进行了编辑,希望它能提供您需要的信息。
  • 对不起,是npm install ... :(
  • 这是@codedge的东西,我已经下载并添加了require('jquery'),但jquery仍然不起作用。
猜你喜欢
  • 2021-04-04
  • 2021-01-01
  • 2021-08-13
  • 2021-07-12
  • 1970-01-01
  • 2021-07-14
  • 2021-04-12
  • 2021-01-21
  • 2021-02-08
相关资源
最近更新 更多