简体   繁体   English

为什么使用 jquery-ui 时出现 jQuery.easing 错误

[英]Why jQuery.easing error occurs while using jquery-ui

I want to use add to cart effect in our project so I installed dependencies:(when I check package.json):我想在我们的项目中使用添加到购物车效果,所以我安装了依赖项:(当我检查 package.json 时):

"jquery": "^3.4.1",
"jquery-ui": "^1.12.1",

And I import these in the component which I want:我将这些导入到我想要的组件中:

import $ from 'jquery';
import 'jquery-ui'

But when I test it, It wont work:但是当我测试它时,它不会工作:

TypeError: jQuery.easing[this.easing] is not a function类型错误:jQuery.easing[this.easing] 不是 function

So how can I fix this?那么我该如何解决这个问题呢?

Finally, my problem was solved by declaring this snipped instead of jquery-ui:最后,我的问题通过声明这个片段而不是 jquery-ui 来解决:

import "jquery-ui/ui/effects/effect-shake"

Best regards此致

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM