Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
342 views
in Technique[技术] by (71.8m points)

javascript - 是否有必要在Ember CLI 1.13中导入jquery(Is it necessary to import jquery in Ember CLI 1.13)

I am working on an old project which uses Ember CLI 1.13.12 where every file (including app.js/controllers/routes/components) has the following import at the top

(我正在使用Ember CLI 1.13.12的旧项目中,其中每个文件(包括app.js / controllers / routes / components)的顶部都有以下导入)

import $ from 'jquery';

I removed the above line from all the files and still the app is running perfectly with all jquery code ( using $() or this.$() ).

(我从所有文件中删除了上述行,但该应用程序仍在使用所有jquery代码(使用$()this.$() )完美运行。)

I tried to find if jquery is enabled in any config file but I couldn't.

(我试图查找是否在任何配置文件中启用了jquery,但我没有。)

Also, there is no optional-features.json file in the project where jquery-integration can be set to true .

(此外,项目中没有optional-features.jsonjquery-integration设置为true optional-features.json文件。)

So, is it necessary to import jquery in an Ember CLI 1.13 project?

(因此,是否有必要在Ember CLI 1.13项目中导入jquery?)

Can we disable the default jquery in Ember CLI 1.13?

(我们可以在Ember CLI 1.13中禁用默认的jquery吗?)

I am new to Ember and that too to an old version so finding it difficult to understand.

(我是Ember的新手,而老版本也是新手,所以很难理解。)

  ask by escapeVelocity translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

So, is it necessary to import jquery in an Ember CLI 1.13 project?

(因此,是否有必要在Ember CLI 1.13项目中导入jquery?)

No. It's actually never necessary, but recommended.

(不。实际上从来没有必要,但建议这样做。)

This makes it much easier to see where jQuery is can be very helpful when transisioning away from jQuery.

(当离开jQuery进行转换时,这使查看jQuery的位置非常有用变得更加容易。)

Can we disable the default jquery in Ember CLI 1.13?

(我们可以在Ember CLI 1.13中禁用默认的jquery吗?)

Not really, no.

(不是,不是)

Back then ember itself required jQuery.

(那时,余烬本身就需要jQuery。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...