我可以将jQuery UI 1.12.1与jQuery 3.x一起使用吗? [英] Can I use jQuery UI 1.12.1 with jQuery 3.x?

查看:37
本文介绍了我可以将jQuery UI 1.12.1与jQuery 3.x一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将jQuery 1.7.2 更改为 3.1.1 ,并将jQuery UI从版本 1.8.16 更改为版本1.12.1 .

I changed my jQuery 1.7.2 to 3.1.1 and changed my jQuery UI from version 1.8.16 to version 1.12.1.

我现有的JS东西很多都坏了,例如按钮的样式,并且 dialog 以意外的方式工作,即模式对话框的一半被神秘的< div类覆盖了="ui-widget-overlay ui-front"></div>

Quite a few of my existing JS stuff broke, like styling of buttons, and dialog behaves in unexpected manner, i.e. half of modal dialog is covered up by the mysterious <div class="ui-widget-overlay ui-front"></div>

由于上述原因,我怀疑jQuery UI有问题.我去了jQuery UI网站,发现该稳定版本适用于 jQuery 1.7 + .

I suspected jQuery UI to be at fault due to the covering above. I went to jQuery UI site and I see that stable version is for jQuery 1.7+.

这是否意味着我应该在jQuery UI上使用jQuery 1.x,还是可以在jQuery 3.x上使用ok(加上...尝试弄清楚为什么我的样式和功能坏了)?

Does that mean that I should be using jQuery 1.x with jQuery UI, or can I use jQuery 3.x okay (plus ... try to figure out why my styling and functionality broke)?

推荐答案

jQueryUI支持以下jQuery版本范围:

jQueryUI supports the following jQuery version range:

"dependencies": {
    "jquery": ">=1.7.0 <4.0.0"
},

我想你很好.

来源: https://github.com/jquery/jquery-ui/blob/master/package.json#L53

您可能会看到很多损坏的组件,因为您没有导入其CSS或覆盖了它们的CSS.

It might be that you're seeing a lot of broken components because either you're not importing their CSS or you're overriding their CSS.

这篇关于我可以将jQuery UI 1.12.1与jQuery 3.x一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆