如何在凉亭中使用jQuery UI?

编程入门 行业动态 更新时间:2024-10-11 19:17:33
本文介绍了如何在凉亭中使用jQuery UI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试 yeoman 和下端.

我使用以下命令创建了一个yeoman Web应用程序

I have created a yeoman webapp using the following command

yo webapp

我想使用 jqueryui ,所以我已经使用Bower安装了它:

I want to use jqueryui so I have installed it using bower:

bower install jquery-ui --save

这很好用,但是jQuery UI组件不包含带有所有"组件的javascript文件,它仅包含许多javascript文件,每个组件一个.

This works fine, but the jQuery UI component doesn't contain a javascript file with "all" the components, it just contains a lot of javascript files, one for each component.

我应该只包含所需的javascript文件吗?还是在使用jQuery UI之前我应该​​做其他事情?

Should I include only the javascript files that I need? Or should I do something else before using jQuery UI?

感谢您的提示!

推荐答案

在bower.json(或component.json)的dependencies中将jquery-ui与jquery一起添加.

Added jquery-ui in dependencies of bower.json (or component.json) along with jquery.

{ …, "dependencies": { "jquery": "~1.9.1", "jquery-ui": "~1.10.3", ... }, … }

安装它们:

bower install

然后,在main.js中添加到jqueryui的路径并要求它:

Then, added path to jqueryui In main.js and require it:

require.config({ paths: { jquery: '../components/jquery/jquery', jqueryui: '../components/jquery-ui/ui/jquery-ui', … }, shim: { jqueryui: 'jquery', … }, … }); require(['app', 'jquery', 'jqueryui', 'bootstrap'], function (app, $) { 'use strict'; ... });

对我有用.

更多推荐

如何在凉亭中使用jQuery UI?

本文发布于:2023-11-06 03:45:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562641.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:凉亭   如何在   UI   jQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!