Convert Figma logo to code with AI

lihongxun945 logojquery-weui

由于前端业界早已以React/Vue/Angular为主,个人也多年未使用过jQuery,此仓库已不再维护。推荐大家尽快转向 AntD、Element等更先进的UI库,https://ant.design/, https://element.eleme.io/#/zh-CN

4,452
1,194
4,452
347

Top Related Projects

27,157

A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.

3,168

A lightweight javascript library for WeUI.

15,076

A UI library by WeChat official design team, includes the most useful widgets/modules.

小程序WeUI组件库

Quick Overview

jQuery WeUI is a WeChat-style UI library based on jQuery and WeUI. It provides a set of mobile UI components that closely resemble the native WeChat app interface, making it easy for developers to create web applications with a familiar look and feel for WeChat users.

Pros

  • Closely mimics WeChat's native UI, providing a seamless user experience
  • Built on top of jQuery, making it easy to use for developers familiar with jQuery
  • Offers a wide range of UI components and plugins
  • Responsive design, suitable for various mobile devices

Cons

  • Relies on jQuery, which may be considered outdated for modern web development
  • Limited customization options compared to more flexible UI frameworks
  • Primarily focused on WeChat-style UI, which may not be suitable for all projects
  • Less active development and updates compared to some other UI libraries

Code Examples

  1. Initializing a dialog:
$.alert("Your message here", "Title");
  1. Creating a picker:
$("#picker").picker({
  title: "Please choose",
  cols: [
    {
      textAlign: 'center',
      values: ['iPhone 4', 'iPhone 4S', 'iPhone 5', 'iPhone 5S', 'iPhone 6', 'iPhone 6 Plus', 'iPad 2', 'iPad Retina', 'iPad Air', 'iPad mini', 'iPad mini 2', 'iPad mini 3']
    }
  ]
});
  1. Implementing an infinite scroll:
$("#infinite").infinite().on("infinite", function() {
  var self = this;
  if(self.loading) return;
  self.loading = true;
  setTimeout(function() {
    $("#infinite").append("<p>New content</p>");
    self.loading = false;
  }, 2000);
});

Getting Started

  1. Include the necessary CSS and JS files in your HTML:
<link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.1/css/jquery-weui.min.css">
<script src="https://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/jquery-weui.min.js"></script>
  1. Start using jQuery WeUI components in your JavaScript:
$(document).ready(function() {
  $("#button").click(function() {
    $.alert("Hello World!", "Greetings");
  });
});

Competitor Comparisons

27,157

A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.

Pros of weui

  • Native implementation without jQuery dependency
  • Lighter weight and potentially better performance
  • Closer adherence to WeChat's design guidelines

Cons of weui

  • Less extensive component library
  • Requires more manual JavaScript implementation
  • Steeper learning curve for developers used to jQuery

Code Comparison

weui:

<a href="javascript:;" class="weui-btn weui-btn_primary">Primary Button</a>

jquery-weui:

<a href="#" class="weui-btn weui-btn_primary">Primary Button</a>
<script>
  $('.weui-btn').click(function() {
    $.alert("Button clicked!");
  });
</script>

Summary

weui is a lightweight, native implementation of WeChat's UI components, offering better performance and closer design adherence. However, it requires more manual JavaScript implementation and has a smaller component library compared to jquery-weui.

jquery-weui, on the other hand, provides a more extensive set of components and easier implementation for developers familiar with jQuery. It's more beginner-friendly but comes with the overhead of jQuery dependency and potentially lower performance.

The choice between the two depends on project requirements, performance needs, and developer preferences. weui is ideal for lightweight, high-performance applications, while jquery-weui might be better suited for rapid development and projects where jQuery is already in use.

3,168

A lightweight javascript library for WeUI.

Pros of weui.js

  • Lightweight and focused on WeChat-specific UI components
  • Directly supported and maintained by Tencent, ensuring compatibility with WeChat
  • No jQuery dependency, potentially better performance

Cons of weui.js

  • Limited set of components compared to jquery-weui
  • Less extensive documentation and community support
  • Steeper learning curve for developers not familiar with WeChat ecosystem

Code Comparison

weui.js:

weui.alert('Alert message');
weui.confirm('Confirm message', function() {
    console.log('Confirmed');
});

jquery-weui:

$.alert('Alert message');
$.confirm('Confirm message', function() {
    console.log('Confirmed');
});

The code comparison shows that both libraries offer similar functionality for basic UI components, but with slightly different syntax. weui.js uses a standalone weui object, while jquery-weui leverages jQuery's $ syntax.

While weui.js is more focused on WeChat-specific components and doesn't require jQuery, jquery-weui offers a broader range of components and may be more familiar to developers already using jQuery. The choice between the two depends on the specific project requirements, target platform, and developer preferences.

15,076

A UI library by WeChat official design team, includes the most useful widgets/modules.

Pros of weui-wxss

  • Official WeChat UI framework, ensuring better compatibility with WeChat Mini Programs
  • More comprehensive and up-to-date documentation
  • Larger community and more frequent updates

Cons of weui-wxss

  • Limited to WeChat Mini Programs, less versatile for other web applications
  • Steeper learning curve for developers not familiar with WeChat ecosystem

Code Comparison

weui-wxss:

.weui-btn {
  position: relative;
  display: block;
  width: 184px;
  margin-left: auto;
  margin-right: auto;
  padding: 8px 24px;
  box-sizing: border-box;
  font-weight: 700;
  font-size: 17px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  line-height: 1.41176471;
  border-radius: 4px;
  overflow: hidden;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

jquery-weui:

.weui-btn {
  position: relative;
  display: block;
  margin-left: auto;
  margin-right: auto;
  padding-left: 14px;
  padding-right: 14px;
  box-sizing: border-box;
  font-size: 18px;
  text-align: center;
  text-decoration: none;
  color: #FFFFFF;
  line-height: 2.55555556;
  border-radius: 5px;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  overflow: hidden;
}

The code comparison shows similar button styling, with minor differences in padding, font size, and border-radius. weui-wxss includes additional properties like width and font-weight, while jquery-weui uses a different line-height value.

小程序WeUI组件库

Pros of weui-miniprogram

  • Specifically designed for WeChat Mini Programs, offering better integration and performance
  • Regularly updated with new features and improvements for the WeChat ecosystem
  • Lightweight and optimized for mobile devices, resulting in faster load times

Cons of weui-miniprogram

  • Limited to WeChat Mini Programs, reducing flexibility for other platforms
  • Smaller community and fewer third-party extensions compared to jQuery WeUI
  • Steeper learning curve for developers not familiar with WeChat Mini Program development

Code Comparison

jquery-weui:

$.weui.alert('Hello World');

weui-miniprogram:

wx.showModal({
  title: 'Alert',
  content: 'Hello World',
  showCancel: false
});

The code comparison shows that jquery-weui uses a more straightforward syntax for displaying alerts, while weui-miniprogram utilizes WeChat's native API, requiring slightly more verbose code but offering deeper integration with the platform.

Both libraries aim to provide UI components for mobile web development, but weui-miniprogram focuses specifically on WeChat Mini Programs, while jquery-weui offers a more general-purpose solution based on jQuery. Developers should choose based on their target platform and familiarity with the respective ecosystems.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

jQuery WeUI - 打造微信公众号开发的瑞士军刀

npm version

jQuery WeUI 是专为微信公众账号开发而设计的一个简洁而强大的UI库,包含全部WeUI官方的CSS组件,并且额外提供了大量的拓展组件,丰富的组件库可以极大减少前端开发时间。

更多文档请参阅官网: http://jqweui.com/

微信扫描二维码立刻体验:

code

为什么选择 jQuery WeUI

  • 简单易用,无上手难度
  • 丰富强大的组件库,并且还在不断完善中
  • 轻量,无限制,可以结合任何主流JS框架使用,比如 Vue, Angular, React 等
  • 高性能的 CSS3 动画,低端手机上依然可以较流畅运行
  • 详尽完善的官方文档
  • 稳定的API,不间断的更新迭代

搭配框架

jQuery WeUI 的定位正如 jQuery 的定位:做一把锋利的小刀,而不是做一个笨重的大炮。

jQuery WeUI 只是提供一些常用的UI控件,如果不是很复杂的项目,基本只用 jQuery WeUI 即可满足需求。如果项目比较复杂,或者希望实现单页应用,推荐使用 Vue 或者 Angular,或者可以看看我正在开发的另一个项目 vue-mobile

下载

推荐通过npm来安装 npm install jquery-weui

或者你可以 clone 这个仓库,自行编译,关于如何进行编译请参见下面的gulp章节。

所有编译后的代码都在 dist 目录下,为了减少垃圾文件,master默认忽略了这个目录,你可以自行编译或者切换到 build 分支就可以看到这个目录。

gulp

使用 gulp 进行代码编译,如果你没有用过或者不想自行编译,可以切换到 build 分支即可。

关于如何使用 gulp 请参考 http://gulpjs.com/

可用的 gulp 命令如下:

  • gulp 进入开发模式,同时打开 watch 和 server任务
  • gulp build 编译压缩代码

分支说明

  • master 主分支,正式发布的代码才会进入master分支
  • build 包含全部编译后代码的分支,和 master 分支同步,但是会包含 dist 目录
  • dev 开发分支
  • gh-pages 文档主分支
  • gh-pages-dev 文档的开发分支

联系和讨论

QQ 群:546452237(一群), 55572340(二群), 478537720(三群) 加群暗号是在官网执行以下代码的值:

location.host.split('.')[0]

群里更适合聊天,如果是发现bug或者有功能上的建议,推荐通过 issue 来讨论。

捐助

jQuery WeUI 是 MIT 协议的免费开源项目,不会收取任何费用。作者维护这个项目需要耗费不少精力,如果jQuery WeUI 帮到了你,你可以捐款让这个项目变得更好。当然,无论是否捐款,都感谢您对本项目的支持。

捐款是纯粹自愿的捐助行为,我将非常感谢您的捐助,但您本人并不会因为您的捐款而获得比其他不捐款用户更多的权利,望理解。

LICENSE

MIT,尽情享受开源代码。

Thanks

组件展示

NPM DownloadsLast 30 Days