JQueryUI at Ember upgrade

我的未来我决定 提交于 2019-12-10 14:30:34

问题


After upgrade and dismissing Bower as recommended: Is there a way to include JQueryUI into an Ember project without using Bower? My project depends heavily of JQueryUI dialogs.

$ ember -v
ember-cli: 3.3.0  
node: 8.11.3  
os: linux x64  

Do I have to reintroduce Bower into my project? Like in this old Using jquery in Ember-cli advice?


回答1:


does this solve your use case?:

ember install ember-auto-import
npm install jquery-ui

and then wherever you need to use it:

import { stuff } from 'jquery-ui';



回答2:


Including external js through npm package is always suggested. Above answer shows how to do it.

Sometime the developer won't maintain the package. In that case, you have to include it manually to get the latest js for your app.

If you want to include it manually (not depending on the npm package), here is the way to add external js in your application

1) Download the latest stable jquery-ui from their official site.

2) Extract it. Include jquery-ui.js file in your app/vendor/jquery-ui.js

(Where vendor is the home for external js)

3) Once added import the js in ember-cli-build.js file

app.import('vendor/jquery-ui.js');

4) Restart the ember app.



来源:https://stackoverflow.com/questions/51766188/jqueryui-at-ember-upgrade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!