如何在流星项目中引导之前调用jquery-ui以防止冲突

How to call jquery-ui before bootstrap in a meteor project in order to prevent conflicts

本文关键字:jquery-ui 调用 冲突 流星 项目      更新时间:2023-09-26

我有一个流星项目(我运行它mrt --release 0.6.5.1)。在这个项目中,我使用bootstrap2.3jquery-ui 1.9.2,但由于它们是冲突的,它们不能很好地工作。所以我可以在这里推荐:

你应该在bootstrap之前调用jquery-ui,否则你会看到有很多问题,比如工具提示等等。

现在,我已经使用 在我的流星中添加了bootstrap包
meteor add bootstrap
   mrt add bootstrap

和我已经添加了jquery-ui.js(从这里下载)到client/lib,现在看来他们是冲突的。我该怎么做才能在引导之前加载jquery-ui ?

我已经找到了我的引导版本使用chrome->developer->sources->packages

这是我的projectFolder/smart.json文件在流星项目。

{
  "packages": {
    "router": {},
    "datatables": {},
    "select2": {},
    "accounts-ui-bootstrap-dropdown": {},
    "font-awesome": {},
    "verbalExpressions": {},
    "jquery-scrollTo": {},
    "bootboxjs": {},
    "event-hooks": {},
    "moment": {}
  }
}
最后,这是我的。meteor/packages file:
# Meteor packages used by this project, one per line.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.
standard-app-packages
autopublish
insecure
preserve-inputs
accounts-base
accounts-password
router
event-hooks
bootstrap
accounts-ui-bootstrap-dropdown
moment
datatables
select2
jquery-scrollTo
verbalExpressions
http

尝试使用meteor add将bootstrap-3和jquery-ui作为包安装,而不是尝试手动将jquery-ui js文件放入client/或lib/

引导:

$ meteor add twbs:bootstrap

Bootstrap-3 (代替 Bootstrap,不添加):

$ meteor add ian:accounts-ui-bootstrap-3

jquery ui:

$ meteor add mizzao:jquery-ui

几乎所有你需要的包都可以在atmospherejs上找到