
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
captain-weapp
Advanced tools
高颜值、好用、易扩展的小程序 UI 库
ZanUI-WeApp是有赞移动 Web UI 规范 ZanUI
的小程序现实版本,结合了微信的视觉规范,为用户提供更加统一的使用感受。
现已包含 badge、btn、card、cell、dialog、icon、label、noticebar、panel、popup、switch、tab、toast、toptips 等组件或元素。具体可以扫描下方小程序二维码,体验组件库示例 Demo
更多背景介绍,请移步 我们写的介绍文章。
git clone https://github.com/youzan/zanui-weapp.git
# 安装项目依赖
npm install
# 执行组件编译
npm run dev
我们推荐在你的app.wxss
直接引入zanui-weapp/dist/index.wxss
。
详细使用文档,请参考 快速上手
根据功能的不同,可以将组件大致的分为2类:
如按钮组件,只需要在页面中引入按钮自定义组件即可
{
"usingComponents": {
"zan-button": "/path/to/zanui-weapp/dist/btn/index"
}
}
<!-- example/btn/index.html -->
<zan-button>按钮</zan-button>
如 Toast 组件,需要先在页面上引入自定义组件。之后在逻辑运行时,直接调用方法即可展示
{
"usingComponents": {
"zan-toast": "/path/to/zanui-weapp/dist/toast/index"
}
}
<zan-toast id="zan-toast-test"></zan-toast>
将对应的 Toast 的函数引入页面,就可以直接调用来展示 Toast 了
// example/toast/index.js
const Toast = require('/path/to/zanui-weapp/dist/toast/toast');
Page({
showToast() {
Toast({
selector: '#zan-toast-test',
message: 'toast内容'
});
}
});
更多示例可以在项目的example
目录中查看
组件库现在已经全部升级至自定义组件,如果项目暂时无法切换到自定义组件的形式,可以将使用的版本号设置为低于 3.0.0。同时,旧的代码会在分支 old_code 上保留一段时间。
建议新使用的用户,直接以自定义组件形式接入
本项目基于 MIT协议,请自由地享受和参与开源。
如果你有好的意见或建议,欢迎给我们提 issue 或 PR,为优化 ZanUI-Weapp 贡献力量
FAQs
The npm package captain-weapp receives a total of 0 weekly downloads. As such, captain-weapp popularity was classified as not popular.
We found that captain-weapp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.