54 Star 223 Fork 80

Gitee 极速下载 / Vant

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/youzan/vant
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

logo

Vant

轻量、可定制的移动端 Vue 组件库

npm version Coverage Status downloads Gzip Size

🔥 文档网站(国内)   🌈 文档网站(GitHub)


介绍

Vant 是一个轻量、可定制的移动端组件库,于 2017 年开源。

目前 Vant 官方提供了 Vue 2 版本Vue 3 版本微信小程序版本,并由社区团队维护 React 版本支付宝小程序版本

特性

  • 🚀 性能极佳,组件平均体积小于 1KB(min+gzip)
  • 🚀 80+ 个高质量组件,覆盖移动端主流场景
  • 🚀 零外部依赖,不依赖三方 npm 包
  • 💪 使用 TypeScript 编写,提供完整的类型定义
  • 💪 单元测试覆盖率超过 90%,提供稳定性保障
  • 📖 提供丰富的中英文文档和组件示例
  • 📖 提供 Sketch 和 Axure 设计资源
  • 🍭 支持 Vue 2、Vue 3 和微信小程序
  • 🍭 支持 Nuxt 2、Nuxt 3,提供 Nuxt 的 Vant Module
  • 🍭 支持主题定制,内置 700+ 个主题变量
  • 🍭 支持按需引入和 Tree Shaking
  • 🍭 支持无障碍访问(持续改进中)
  • 🍭 支持深色模式
  • 🍭 支持服务器端渲染
  • 🌍 支持国际化,内置 30+ 种语言包

安装

在现有项目中使用 Vant 时,可以通过 npm 进行安装:

# Vue 3 项目,安装最新版 Vant
npm i vant

# Vue 2 项目,安装 Vant 2
npm i vant@latest-v2

当然,你也可以通过 yarnpnpmbun 进行安装:

# 通过 yarn 安装
yarn add vant

# 通过 pnpm 安装
pnpm add vant

# 通过 bun 安装
bun add vant

脚手架

推荐使用 Rsbuild 来创建一个脚手架项目。

Rsbuild 是基于 Rspack 的构建工具,由 Vant 作者开发,具备一流的构建速度和开发体验,对 Vant 提供第一优先级支持。

你可以通过以下命令创建一个 Rsbuild 项目:

npm create rsbuild@latest

请访问 Rsbuild 仓库 了解更多信息。

快速上手

import { createApp } from 'vue';
// 1. 引入你需要的组件
import { Button } from 'vant';
// 2. 引入组件样式
import 'vant/lib/index.css';

const app = createApp();

// 3. 注册你需要的组件
app.use(Button);

vant 也支持按需引入、CDN 引入等方式,详细说明见 快速上手.

浏览器支持

Vant 2 支持现代浏览器以及 Android >= 4.0、iOS >= 8.0。

Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一致)。

官方生态

由 Vant 官方团队维护的项目如下:

项目 描述
vant-weapp Vant 微信小程序版
vant-demo Vant 官方示例合集
vant-cli 开箱即用的组件库搭建工具
vant-icons Vant 图标库
vant-touch-emulator 在桌面端使用 Vant 的辅助库
vant-nuxt 为 Nuxt 准备的模块

社区生态

由社区维护的项目如下,欢迎补充:

项目 描述
3lang3/react-vant 参照 Vant 打造的 React 框架移动端组件库
vant-aliapp Vant 支付宝小程序版
taroify Vant Taro 版
vant-theme Vant 在线主题预览工具
@antmjs/vantui 基于 Vant Weapp 开发的多端组件库,同时支持 Taro 和 React
vant-playground Vant Playground
sfc-playground-vant Vant Playground
vue3-h5-template 基于 Vant 的移动端项目模板
vue3-vant-mobile 基于 Vant 的移动端项目模板
vscode-common-intellisense VS Code 扩展,为 Vant 开发者提供更好的智能感知

链接

手机预览

可以手机扫码以下二维码访问手机端 demo:

核心团队

以下是 Vant 和 Vant Weapp 的核心贡献者们:

chenjiahan cookfront w91 pangxie1991 rex-zsd nemo-shen
chenjiahan cookfront wangnaiyi pangxie rex-zsd nemo-shen
Lindysen JakeLaoyu landluck wjw-gavin inottn zhousg
Lindysen JakeLaoyu landluck wjw-gavin inottn zhousg

贡献者们

感谢以下小伙伴们为 Vant 发展做出的贡献:

contributors

贡献指南

修改代码请阅读我们的 贡献指南

使用过程中发现任何问题都可以提 Issue 给我们,当然,我们也非常欢迎你给我们发 PR

在 Cloud IDE 中预览

https://idegithub.com/youzan/vant

开源协议

本项目基于 MIT 协议,请自由地享受和参与开源。

MIT License Copyright (c) Youzan Copyright (c) Chen Jiahan and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Vant 是有赞开源的一套基于 Vue 2.0 的 Mobile 组件库 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/mirrors/Vant.git
git@gitee.com:mirrors/Vant.git
mirrors
Vant
Vant
main

搜索帮助

14c37bed 8189591 565d56ea 8189591