Compare commits

...

12 Commits

Author SHA1 Message Date
chenjiahan
83a4e286bd Merge branch 'dev' into next 2022-07-23 22:20:49 +08:00
chenjiahan
f4ab1b8c0c chore: fix missing deps 2022-07-23 22:13:26 +08:00
chenjiahan
7879fd6395 chore: update repo links 2022-07-23 22:10:20 +08:00
neverland
11dbde14f6
chore(@vant/cli): no longer provide stylelint (#10844) 2022-07-23 21:41:38 +08:00
neverland
537e629d7d
chore: update baidu analytics seed (#10843) 2022-07-23 21:23:50 +08:00
chenjiahan
178df39c44 Merge branch 'dev' into next 2022-07-23 21:20:27 +08:00
neverland
74c1c2927e
feat(@vant/cli): bump vite 3.0 (#10842)
* feat(@vant/cli): bump vite 3.0

* chore: bump vite plugins
2022-07-23 18:59:57 +08:00
neverland
a31f78b07a
docs: improve description of name and required props (#10841)
* docs: improve description of name and required props

* docs: fix
2022-07-23 18:36:00 +08:00
neverland
794fd029a0
fix(Popover): allow to dynamically set offset prop (#10840) 2022-07-23 18:26:15 +08:00
chenjiahan
c628a66770 release: create-vant-cli-app 2.0.1 2022-07-23 18:14:28 +08:00
neverland
b6c8d3f39f
fix(create-vant-cli-app): missing demo registration (#10839) 2022-07-23 18:11:48 +08:00
neverland
11d25a0b0e
fix: failed to get correct height of safe area element (#10827)
* fix: failed to get correct height of safe area element

* docs: upd
2022-07-17 15:10:35 +08:00
98 changed files with 492 additions and 1000 deletions

View File

@ -2,4 +2,4 @@
请移步 GitHub issues 进行反馈:
https://github.com/youzan/vant/issues
https://github.com/vant-ui/vant/issues

View File

@ -29,7 +29,7 @@ It's welcomed to pull request, And there are some tips about that:
You will need [Node.js >= 14](https://nodejs.org) and [pnpm](https://pnpm.io).
```bash
git clone git@github.com:youzan/vant.git
git clone git@github.com:vant-ui/vant.git
# Install dependencies
pnpm i

View File

@ -9,8 +9,8 @@ body:
在提交 Bug 报告前,请注意:
- 确认你的问题无法通过官方文档得到解决。
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant/issues),并且没有发现同样的问题。
- 如果不是反馈 Bug请到 [Discussions 讨论区](https://github.com/youzan/vant/discussions) 发帖。
- 确认你搜索过 [历史 issue](https://github.com/vant-ui/vant/issues),并且没有发现同样的问题。
- 如果不是反馈 Bug请到 [Discussions 讨论区](https://github.com/vant-ui/vant/discussions) 发帖。
- type: input
id: reproduce

View File

@ -9,8 +9,8 @@ body:
在提交 Bug 报告前,请注意:
- 确认你的问题无法通过官方文档得到解决。
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant/issues),并且没有发现同样的问题。
- 如果不是反馈 Bug请到 [Discussions 讨论区](https://github.com/youzan/vant/discussions) 发帖。
- 确认你搜索过 [历史 issue](https://github.com/vant-ui/vant/issues),并且没有发现同样的问题。
- 如果不是反馈 Bug请到 [Discussions 讨论区](https://github.com/vant-ui/vant/discussions) 发帖。
- type: input
id: reproduce

View File

@ -9,8 +9,8 @@ body:
在提交功能需求前,请注意:
- 确认这是一个通用功能,并且无法通过现有的 API 或 Slot 实现。
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant/issues),并且没有发现同样的需求。
- 可以先到 [Discussions 讨论区](https://github.com/youzan/vant/discussions) 发帖,讨论一下需求是否合理。
- 确认你搜索过 [历史 issue](https://github.com/vant-ui/vant/issues),并且没有发现同样的需求。
- 可以先到 [Discussions 讨论区](https://github.com/vant-ui/vant/discussions) 发帖,讨论一下需求是否合理。
- type: textarea
id: description

View File

@ -9,8 +9,8 @@ body:
在提交功能需求前,请注意:
- 确认这是一个通用功能,并且无法通过现有的 API 实现。
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant/issues),并且没有发现同样的需求。
- 可以先到 [Discussions 讨论区](https://github.com/youzan/vant/discussions) 发帖,讨论一下需求是否合理。
- 确认你搜索过 [历史 issue](https://github.com/vant-ui/vant/issues),并且没有发现同样的需求。
- 可以先到 [Discussions 讨论区](https://github.com/vant-ui/vant/discussions) 发帖,讨论一下需求是否合理。
- type: textarea
id: description

View File

@ -1,6 +1,6 @@
### Before submitting a pull request, please make sure the following is done:
1. Read the [contributing guide](https://github.com/youzan/vant/blob/dev/.github/CONTRIBUTING.md).
1. Read the [contributing guide](https://github.com/vant-ui/vant/blob/dev/.github/CONTRIBUTING.md).
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes (`npm test`).

View File

@ -15,6 +15,6 @@ jobs:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
with:
# GitHub 源仓库地址
source-repo: git@github.com:youzan/vant.git
source-repo: git@github.com:vant-ui/vant.git
# Gitee 目标仓库地址
destination-repo: git@gitee.com:vant-contrib/vant.git

View File

@ -1,3 +0,0 @@
{
"extends": ["@vant/stylelint-config"]
}

View File

@ -8,8 +8,8 @@
<p align="center">
<img src="https://img.shields.io/npm/v/vant?style=flat-square" alt="npm version" />
<img src="https://img.shields.io/github/workflow/status/youzan/vant/CI/dev?style=flat-square" alt="CI Status" />
<img src="https://img.shields.io/codecov/c/github/youzan/vant/dev.svg?style=flat-square&color=#4fc08d" alt="Coverage Status" />
<img src="https://img.shields.io/github/workflow/status/vant-ui/vant/CI/dev?style=flat-square" alt="CI Status" />
<img src="https://img.shields.io/codecov/c/github/vant-ui/vant/dev.svg?style=flat-square&color=#4fc08d" alt="Coverage Status" />
<img src="https://img.shields.io/npm/dm/vant.svg?style=flat-square&color=#4fc08d" alt="downloads" />
<img src="https://img.shields.io/jsdelivr/npm/hm/vant?style=flat-square" alt="Jsdelivr Hits">
<img src="https://img.badgesize.io/https://unpkg.com/vant@3/lib/vant.min.js?compression=gzip&style=flat-square&label=gzip%20size&color=#4fc08d" alt="Gzip Size" />
@ -86,11 +86,11 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
| Project | Description |
| --- | --- |
| [vant-weapp](https://github.com/youzan/vant-weapp) | WeChat MiniProgram UI |
| [vant-weapp](https://github.com/vant-ui/vant-weapp) | WeChat MiniProgram UI |
| [vant-demo](https://github.com/vant-ui/vant-demo) | Collection of Vant demos |
| [vant-cli](https://github.com/youzan/vant/tree/dev/packages/vant-cli) | Scaffold for UI library |
| [vant-icons](https://github.com/youzan/vant/tree/dev/packages/vant-icons) | Vant icons |
| [vant-touch-emulator](https://github.com/youzan/vant/tree/dev/packages/vant-touch-emulator) | Using vant in desktop browsers |
| [vant-cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli) | Scaffold for UI library |
| [vant-icons](https://github.com/vant-ui/vant/tree/dev/packages/vant-icons) | Vant icons |
| [vant-touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator) | Using vant in desktop browsers |
## Community Ecosystem
@ -128,7 +128,7 @@ Core contributors of Vant and Vant Weapp:
Thanks to the following friends for their contributions to Vant:
<a href="https://github.com/youzan/vant/graphs/contributors">
<a href="https://github.com/vant-ui/vant/graphs/contributors">
<img src="https://opencollective.com/vant/contributors.svg?width=890&button=false" alt="contributors">
</a>

View File

@ -8,8 +8,8 @@
<p align="center">
<img src="https://img.shields.io/npm/v/vant?style=flat-square" alt="npm version" />
<img src="https://img.shields.io/github/workflow/status/youzan/vant/CI/dev?style=flat-square" alt="CI Status" />
<img src="https://img.shields.io/codecov/c/github/youzan/vant/dev.svg?style=flat-square&color=#4fc08d" alt="Coverage Status" />
<img src="https://img.shields.io/github/workflow/status/vant-ui/vant/CI/dev?style=flat-square" alt="CI Status" />
<img src="https://img.shields.io/codecov/c/github/vant-ui/vant/dev.svg?style=flat-square&color=#4fc08d" alt="Coverage Status" />
<img src="https://img.shields.io/npm/dm/vant.svg?style=flat-square&color=#4fc08d" alt="downloads" />
<img src="https://img.shields.io/jsdelivr/npm/hm/vant?style=flat-square" alt="Jsdelivr Hits">
<img src="https://img.badgesize.io/https://unpkg.com/vant@3/lib/vant.min.js?compression=gzip&style=flat-square&label=gzip%20size&color=#4fc08d" alt="Gzip Size" />
@ -92,11 +92,11 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
| 项目 | 描述 |
| --- | --- |
| [vant-weapp](https://github.com/youzan/vant-weapp) | Vant 微信小程序版 |
| [vant-weapp](https://github.com/vant-ui/vant-weapp) | Vant 微信小程序版 |
| [vant-demo](https://github.com/vant-ui/vant-demo) | Vant 官方示例合集 |
| [vant-cli](https://github.com/youzan/vant/tree/dev/packages/vant-cli) | 开箱即用的组件库搭建工具 |
| [vant-icons](https://github.com/youzan/vant/tree/dev/packages/vant-icons) | Vant 图标库 |
| [vant-touch-emulator](https://github.com/youzan/vant/tree/dev/packages/vant-touch-emulator) | 在桌面端使用 Vant 的辅助库 |
| [vant-cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli) | 开箱即用的组件库搭建工具 |
| [vant-icons](https://github.com/vant-ui/vant/tree/dev/packages/vant-icons) | Vant 图标库 |
| [vant-touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator) | 在桌面端使用 Vant 的辅助库 |
## 社区生态
@ -136,7 +136,7 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
感谢以下小伙伴们为 Vant 发展做出的贡献:
<a href="https://github.com/youzan/vant/graphs/contributors">
<a href="https://github.com/vant-ui/vant/graphs/contributors">
<img src="https://opencollective.com/vant/contributors.svg?width=890&button=false" alt="contributors">
</a>
@ -144,7 +144,7 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
修改代码请阅读我们的 [贡献指南](https://vant-contrib.gitee.io/vant/#/zh-CN/contribution)。
使用过程中发现任何问题都可以提 [Issue](https://github.com/youzan/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/youzan/vant/pulls)。
使用过程中发现任何问题都可以提 [Issue](https://github.com/vant-ui/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/vant-ui/vant/pulls)。
## 开源协议

View File

@ -12,20 +12,17 @@
"nano-staged": {
"*.md": "prettier --write",
"*.{ts,tsx,js,vue,less}": "prettier --write",
"*.{ts,tsx,js,vue}": "eslint --fix",
"*.{vue,css,less}": "stylelint --fix"
"*.{ts,tsx,js,vue}": "eslint --fix"
},
"packageManager": "pnpm@7.1.6",
"devDependencies": {
"@vant/cli": "workspace:*",
"@vant/eslint-config": "workspace:*",
"@vant/stylelint-config": "workspace:*",
"eslint": "^8.2.0",
"husky": "^8.0.1",
"nano-staged": "^0.8.0",
"prettier": "^2.5.0",
"rimraf": "^3.0.2",
"stylelint": "^13.13.1"
"rimraf": "^3.0.2"
},
"pnpm": {
"peerDependencyRules": {

View File

@ -25,8 +25,7 @@
}
},
"nano-staged": {
"*.{ts,tsx,js,jsx,vue}": "eslint --fix",
"*.{vue,css,less,scss}": "stylelint --fix"
"*.{ts,tsx,js,jsx,vue}": "eslint --fix"
},
"peerDependencies": {
"vue": "^2.6.11",
@ -43,11 +42,6 @@
"@vant"
]
},
"stylelint": {
"extends": [
"@vant/stylelint-config"
]
},
"prettier": {
"singleQuote": true
},

View File

@ -25,8 +25,7 @@
"nano-staged": {
"*.md": "prettier --write",
"*.{ts,tsx,js,vue,less,scss}": "prettier --write",
"*.{ts,tsx,js,vue}": "eslint --fix",
"*.{vue,css,less,scss}": "stylelint --fix"
"*.{ts,tsx,js,vue}": "eslint --fix"
},
"peerDependencies": {
"vue": "^3.0.0"
@ -42,11 +41,6 @@
"@vant"
]
},
"stylelint": {
"extends": [
"@vant/stylelint-config"
]
},
"prettier": {
"singleQuote": true
},

View File

@ -7,3 +7,7 @@
<demo-button color="#03a9f4" style="margin-left: 15px">按钮</demo-button>
</demo-block>
</template>
<script setup>
import DemoButton from '../index.vue';
</script>

View File

@ -1,6 +1,6 @@
{
"name": "create-vant-cli-app",
"version": "2.0.0",
"version": "2.0.1",
"description": "Create Vant CLI App",
"main": "lib/index.js",
"bin": {
@ -24,10 +24,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/youzan/vant.git",
"url": "https://github.com/vant-ui/vant.git",
"directory": "packages/create-vant-cli-app"
},
"bugs": "https://github.com/youzan/vant/issues",
"bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan",
"license": "MIT",
"devDependencies": {

View File

@ -29,10 +29,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/youzan/vant.git",
"url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant-area-data"
},
"bugs": "https://github.com/youzan/vant/issues",
"bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan",
"license": "MIT",
"devDependencies": {

View File

@ -10,7 +10,7 @@ Vant CLI is a tool for building vue component library. You can quickly build a f
- Provides rich commands covering the complete process from development to deploy
- Based on conventional directory structure. Generate elegant document website and component examples automatically.
- ESlint Stylelint built-in.
- ESlint built-in.
- Support Tree Shaking/Theme Customization/Import on Demand
### Quickstart
@ -50,16 +50,12 @@ Please add the followed config to `package.json` file.
"nano-staged": {
"*.md": "prettier --write",
"*.{ts,tsx,js,vue,less,scss}": "prettier --write",
"*.{ts,tsx,js,vue}": "eslint --fix",
"*.{vue,css,less,scss}": "stylelint --fix"
"*.{ts,tsx,js,vue}": "eslint --fix"
},
"eslintConfig": {
"root": true,
"extends": ["@vant"]
},
"stylelint": {
"extends": ["@vant/stylelint-config"]
},
"prettier": {
"singleQuote": true
},
@ -69,7 +65,7 @@ Please add the followed config to `package.json` file.
## More Details
- [cli](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/commands.md)
- [config](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/config.md)
- [directory structure](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/directory.md)
- [CHANGELOG](https://github.com/youzan/vant/tree/dev/packages/vant-cli/changelog.md)
- [cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/commands.md)
- [config](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/config.md)
- [directory structure](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.md)
- [CHANGELOG](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/changelog.md)

View File

@ -6,7 +6,7 @@ Vant CLI 是一个 Vue 组件库构建工具,通过 Vant CLI 可以快速搭
- 提供丰富的命令,涵盖从开发测试到构建发布的完整流程
- 基于约定的目录结构,自动生成优雅的文档站点和组件示例
- 内置 ESLint、Stylelint 校验规则,提交代码时自动执行校验
- 内置 ESLint 校验规则,提交代码时自动执行校验
- 构建后的组件库默认支持按需引入、主题定制、Tree Shaking
### 快速上手
@ -46,16 +46,12 @@ pnpm add @vant/cli -D
"nano-staged": {
"*.md": "prettier --write",
"*.{ts,tsx,js,vue,less,scss}": "prettier --write",
"*.{ts,tsx,js,vue}": "eslint --fix",
"*.{vue,css,less,scss}": "stylelint --fix"
"*.{ts,tsx,js,vue}": "eslint --fix"
},
"eslintConfig": {
"root": true,
"extends": ["@vant"]
},
"stylelint": {
"extends": ["@vant/stylelint-config"]
},
"prettier": {
"singleQuote": true
},
@ -65,7 +61,7 @@ pnpm add @vant/cli -D
## 详细文档
- [命令](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/commands.zh-CN.md)
- [配置指南](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/config.zh-CN.md)
- [目录结构](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/directory.zh-CN.md)
- [更新日志](https://github.com/youzan/vant/tree/dev/packages/vant-cli/changelog.md)
- [命令](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/commands.zh-CN.md)
- [配置指南](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/config.zh-CN.md)
- [目录结构](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.zh-CN.md)
- [更新日志](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/changelog.md)

View File

@ -1,5 +1,30 @@
# 更新日志
## v5.0.0 (未发布)
### 依赖升级
对以下依赖进行了大版本升级:
- vite v3
- @vitejs/plugin-vue v3
- @vitejs/plugin-vue-jsx v2
### 依赖精简
- 不再默认安装 `gh-pages` 依赖,请按照如下方式更新 `package.json`
```diff
- "release:site": "pnpm build:site && gh-pages -d site-dist",
+ "release:site": "pnpm build:site && npx gh-pages -d site-dist",
```
- 不再默认内置 `stylelint`,需要的话可以自行安装:
```bash
yarn add stylelint@13 @vant/stylelint-config
```
## v4.0.3
`2022-07-02`
@ -406,15 +431,15 @@ yarn add sass
`2020-03-29`
- 优化网站导航栏在大屏上的适配 ([#5928](https://github.com/youzan/vant/pull/5928))
- 优化网站导航栏在大屏上的适配 ([#5928](https://github.com/vant-ui/vant/pull/5928))
### v2.3.0
`2020-03-25`
- build 命令支持编译 scoped 样式 ([#5910](https://github.com/youzan/vant/pull/5910))
- build 命令支持生成 WebStorm 组件定义文件 ([#5899](https://github.com/youzan/vant/issues/5899))
- clean 命令现在会移除而不是清空文件夹 ([#5895](https://github.com/youzan/vant/issues/5895))
- build 命令支持编译 scoped 样式 ([#5910](https://github.com/vant-ui/vant/pull/5910))
- build 命令支持生成 WebStorm 组件定义文件 ([#5899](https://github.com/vant-ui/vant/issues/5899))
- clean 命令现在会移除而不是清空文件夹 ([#5895](https://github.com/vant-ui/vant/issues/5895))
- 升级 @vant/markdown-vetur 2.0.0
### v2.2.8
@ -448,7 +473,7 @@ yarn add sass
`2020-02-14`
- 修复在 windows 上构建出的样式入口文件路径错误的问题 ([#5655](https://github.com/youzan/vant/pull/5655)
- 修复在 windows 上构建出的样式入口文件路径错误的问题 ([#5655](https://github.com/vant-ui/vant/pull/5655)
### v2.2.3
@ -460,14 +485,14 @@ yarn add sass
`2020-02-05`
- 修复在 windows 上获取 markdown 路径错误的问题 ([#5626](https://github.com/youzan/vant/pull/5626))
- 修复在 windows 上获取 markdown 路径错误的问题 ([#5626](https://github.com/vant-ui/vant/pull/5626))
### v2.2.1
`2020-02-04`
- 升级 babel@7.8
- 修复切换版本时跳转 undefined 的问题 ([#5620](https://github.com/youzan/vant/pull/5620))
- 修复切换版本时跳转 undefined 的问题 ([#5620](https://github.com/vant-ui/vant/pull/5620))
### v2.2.0

View File

@ -29,7 +29,7 @@ Start local dev server for browsering components and demo.
Build Vue component library.
Files will be output to `es` and `lib` directory. More details [directory structure](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/directory.md)
Files will be output to `es` and `lib` directory. More details [directory structure](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.md)
Please add the followed config to `package.json` when publish to npm.

View File

@ -31,7 +31,7 @@ npx vant-cli dev
构建组件库。
运行 build 命令会在 `es``lib` 目录下生成可用于生产环境的组件代码,详见 [目录结构](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/directory.zh-CN.md)。
运行 build 命令会在 `es``lib` 目录下生成可用于生产环境的组件代码,详见 [目录结构](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.zh-CN.md)。
发布 npm 时,请将以下配置加入到 `package.json` 中,使 npm 包能被正确识别:

View File

@ -32,10 +32,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/youzan/vant.git",
"url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant-cli"
},
"bugs": "https://github.com/youzan/vant/issues",
"bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan",
"license": "MIT",
"devDependencies": {
@ -55,10 +55,9 @@
"@types/jest": "^27.0.3",
"@vant/eslint-config": "^3.3.2",
"@vant/markdown-vetur": "^2.3.0",
"@vant/stylelint-config": "^1.4.2",
"@vant/touch-emulator": "^1.3.2",
"@vitejs/plugin-vue": "^2.0.0",
"@vitejs/plugin-vue-jsx": "^1.3.3",
"@vitejs/plugin-vue": "^3.0.1",
"@vitejs/plugin-vue-jsx": "^2.0.0",
"@vue/babel-plugin-jsx": "^1.1.1",
"autoprefixer": "^10.4.0",
"commander": "^9.3.0",
@ -85,10 +84,9 @@
"postcss-load-config": "^3.1.0",
"prettier": "^2.5.0",
"release-it": "^15.1.1",
"stylelint": "^13.0.0",
"transliteration": "^2.2.0",
"typescript": "^4.7.4",
"vite": "^2.9.0",
"vite": "^3.0.0",
"vite-plugin-html": "^2.1.1",
"vite-plugin-md": "^0.11.4",
"vue-router": "^4.0.12"

View File

@ -16,7 +16,7 @@ program
program
.command('lint')
.description('Run eslint and stylelint')
.description('Run ESLint')
.action(async () => {
const { lint } = await import('./commands/lint.js');
return lint();

View File

@ -44,23 +44,10 @@ function eslint() {
);
}
function stylelint() {
return runCommand(
'stylelint',
['src/**/*.css', 'src/**/*.vue', 'src/**/*.less', 'src/**/*.sass', '--fix'],
{
start: 'Running stylelint...',
succeed: 'Stylelint Passed.',
failed: 'Stylelint failed!',
}
);
}
export async function lint() {
const eslintPassed = await eslint();
const stylelintPassed = await stylelint();
if (!eslintPassed || !stylelintPassed) {
if (!eslintPassed) {
process.exit(1);
}
}

View File

@ -204,9 +204,9 @@ export function getViteConfigForSiteProd(): InlineConfig {
base: publicPath,
build: {
outDir,
brotliSize: false,
reportCompressedSize: false,
emptyOutDir: true,
// https://github.com/youzan/vant/issues/9703
// https://github.com/vant-ui/vant/issues/9703
cssTarget: ['chrome53'],
rollupOptions: {
input: {

View File

@ -29,10 +29,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/youzan/vant.git",
"url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant-compat"
},
"bugs": "https://github.com/youzan/vant/issues",
"bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan",
"license": "MIT",
"devDependencies": {

View File

@ -13,10 +13,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/youzan/vant.git",
"url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant-eslint-config"
},
"bugs": "https://github.com/youzan/vant/issues",
"bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan",
"license": "MIT",
"dependencies": {

View File

@ -16,10 +16,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/youzan/vant.git",
"url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant-icons"
},
"bugs": "https://github.com/youzan/vant/issues",
"bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan",
"license": "MIT",
"devDependencies": {

View File

@ -1,6 +1,3 @@
/* stylelint-disable selector-pseudo-element-colon-notation */
/* stylelint-disable font-family-no-missing-generic-family-keyword */
.van-icon {
position: relative;
display: inline-block;

View File

@ -1,7 +1,5 @@
@import './common.less';
/* stylelint-disable selector-pseudo-element-colon-notation */
/* stylelint-disable font-family-no-missing-generic-family-keyword */
@font-face {
font-weight: normal;
font-family: 'vant-icon';

View File

@ -18,10 +18,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/youzan/vant.git",
"url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant-markdown-vetur"
},
"bugs": "https://github.com/youzan/vant/issues",
"bugs": "https://github.com/vant-ui/vant/issues",
"author": "zhangshuai",
"license": "MIT",
"dependencies": {

View File

@ -21,4 +21,4 @@ see: https://popper.js.org/
## Refer
issue: https://github.com/youzan/vant/issues/7626
issue: https://github.com/vant-ui/vant/issues/7626

View File

@ -30,10 +30,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/youzan/vant.git",
"url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant-popperjs"
},
"bugs": "https://github.com/youzan/vant/issues",
"bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan",
"license": "MIT",
"dependencies": {

View File

@ -1,10 +0,0 @@
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.

View File

@ -1,22 +0,0 @@
# Stylelint Config of Vant
## Install
```shell
# with npm
npm i @vant/stylelint-config -D
# with yarn
yarn add @vant/stylelint-config -D
# with pnpm
pnpm add @vant/stylelint-config -D
```
## Usage
```js
{
"extends": ["@vant/stylelint-config"]
}
```

View File

@ -1,18 +0,0 @@
module.exports = {
extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
rules: {
'no-descending-specificity': null,
'selector-pseudo-element-no-unknown': [
true,
{
ignorePseudoElements: ['v-deep'],
},
],
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['deep'],
},
],
},
};

View File

@ -1,25 +0,0 @@
{
"name": "@vant/stylelint-config",
"version": "1.4.2",
"description": "stylelint config of vant.",
"main": "index.js",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"repository": {
"type": "git",
"url": "https://github.com/youzan/vant.git",
"directory": "packages/vant-stylelint-config"
},
"bugs": "https://github.com/youzan/vant/issues",
"author": "chenjiahan",
"license": "MIT",
"dependencies": {
"stylelint-config-prettier": "^8.0.1",
"stylelint-config-standard": "^22.0.0"
},
"devDependencies": {
"stylelint": "^13.0.0"
}
}

View File

@ -10,7 +10,7 @@
`2021-05-26`
- add SSR support [\#8767](https://github.com/youzan/vant/pull/8767)
- add SSR support [\#8767](https://github.com/vant-ui/vant/pull/8767)
### [v1.2.0]

View File

@ -8,10 +8,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/youzan/vant.git",
"url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant-touch-emulator"
},
"bugs": "https://github.com/youzan/vant/issues",
"bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan",
"license": "MIT"
}

View File

@ -30,10 +30,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/youzan/vant.git",
"url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant-use"
},
"bugs": "https://github.com/youzan/vant/issues",
"bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan",
"license": "MIT",
"devDependencies": {

View File

@ -107,7 +107,7 @@ export function useCountDown(options: UseCountDownOptions) {
const tick = () => {
// should not start counting in server
// see: https://github.com/youzan/vant/issues/7807
// see: https://github.com/vant-ui/vant/issues/7807
if (!inBrowser) {
return;
}

View File

@ -15,7 +15,7 @@ function isElement(node: Element) {
);
}
// https://github.com/youzan/vant/issues/3823
// https://github.com/vant-ui/vant/issues/3823
export function getScrollParent(
el: Element,
root: ScrollElement | undefined = defaultRoot

View File

@ -132,7 +132,7 @@ module.exports = {
### Adapt to PC Browsers
Vant is a mobile-first component library, if you want to use Vant in PC browsers, you can use the [@vant/touch-emulator](https://github.com/youzan/vant/tree/dev/packages/vant-touch-emulator) module. This module will automatically convert the mouse events of the PC browser into the touch events of the mobile browser.
Vant is a mobile-first component library, if you want to use Vant in PC browsers, you can use the [@vant/touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator) module. This module will automatically convert the mouse events of the PC browser into the touch events of the mobile browser.
```bash
# Install

View File

@ -195,7 +195,7 @@ module.exports = {
Vant 是一个面向移动端的组件库,因此默认只适配了移动端设备,这意味着组件只监听了移动端的 `touch` 事件,没有监听桌面端的 `mouse` 事件。
如果你需要在桌面端使用 Vant可以引入我们提供的 [@vant/touch-emulator](https://github.com/youzan/vant/tree/dev/packages/vant-touch-emulator),这个库会在桌面端自动将 `mouse` 事件转换成对应的 `touch` 事件,使得组件能够在桌面端使用。
如果你需要在桌面端使用 Vant可以引入我们提供的 [@vant/touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator),这个库会在桌面端自动将 `mouse` 事件转换成对应的 `touch` 事件,使得组件能够在桌面端使用。
```bash
# 安装模块

View File

@ -19,82 +19,82 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
## Details
### [v4.0.0-beta.0](https://github.com/youzan/vant/compare/v3.5.2...v4.0.0-beta.0)
### [v4.0.0-beta.0](https://github.com/vant-ui/vant/compare/v3.5.2...v4.0.0-beta.0)
`2022-07-16`
**Breaking Changes**
- Toast: redesign function-call API [#10804](https://github.com/youzan/vant/issues/10804)
- Dialog: redesign function-call API [#10781](https://github.com/youzan/vant/issues/10781)
- Notify: redesign function-call API [#10782](https://github.com/youzan/vant/issues/10782)
- ImagePreview: redesign function-call API [#10802](https://github.com/youzan/vant/issues/10802)
- Toast: redesign function-call API [#10804](https://github.com/vant-ui/vant/issues/10804)
- Dialog: redesign function-call API [#10781](https://github.com/vant-ui/vant/issues/10781)
- Notify: redesign function-call API [#10782](https://github.com/vant-ui/vant/issues/10782)
- ImagePreview: redesign function-call API [#10802](https://github.com/vant-ui/vant/issues/10802)
**Feature**
- add @vant/compat package [#10806](https://github.com/youzan/vant/issues/10806)
- Calendar: expose getSelectedDate method [419a8e](https://github.com/youzan/vant/commit/419a8e4f0e6454b9aac30d5800318deabec099cb)
- remove less source file to remove bundle size [#10752](https://github.com/youzan/vant/issues/10752)
- add @vant/compat package [#10806](https://github.com/vant-ui/vant/issues/10806)
- Calendar: expose getSelectedDate method [419a8e](https://github.com/vant-ui/vant/commit/419a8e4f0e6454b9aac30d5800318deabec099cb)
- remove less source file to remove bundle size [#10752](https://github.com/vant-ui/vant/issues/10752)
**Bug Fixes**
- Uploader: should not preview failed images [#10790](https://github.com/youzan/vant/issues/10790)
- Uploader: should not preview failed images [#10790](https://github.com/vant-ui/vant/issues/10790)
### [v4.0.0-alpha.4](https://github.com/youzan/vant/compare/v3.5.0-beta.0...v4.0.0-alpha.4)
### [v4.0.0-alpha.4](https://github.com/vant-ui/vant/compare/v3.5.0-beta.0...v4.0.0-alpha.4)
`2022-05-31`
**Feature**
- using mjs extension for esmodule [#10625](https://github.com/youzan/vant/issues/10625)
- using mjs extension for esmodule [#10625](https://github.com/vant-ui/vant/issues/10625)
### [v4.0.0-alpha.3](https://github.com/youzan/vant/compare/v3.4.9...v4.0.0-alpha.3)
### [v4.0.0-alpha.3](https://github.com/vant-ui/vant/compare/v3.4.9...v4.0.0-alpha.3)
`2022-05-02`
**Feature**
- Form: support setting multiple validate-trigger [#10544](https://github.com/youzan/vant/issues/10544)
- Empty: localize all images [#10514](https://github.com/youzan/vant/issues/10514) [#10515](https://github.com/youzan/vant/issues/10515) [#10516](https://github.com/youzan/vant/issues/10516)
- Loading: add aria to improve a11y [#10568](https://github.com/youzan/vant/issues/10568)
- Form: support setting multiple validate-trigger [#10544](https://github.com/vant-ui/vant/issues/10544)
- Empty: localize all images [#10514](https://github.com/vant-ui/vant/issues/10514) [#10515](https://github.com/vant-ui/vant/issues/10515) [#10516](https://github.com/vant-ui/vant/issues/10516)
- Loading: add aria to improve a11y [#10568](https://github.com/vant-ui/vant/issues/10568)
**Bug Fixes**
- Search: style error in dark mode [#10527](https://github.com/youzan/vant/issues/10527)
- @vant/area-data: only publish dist folder to npm [f927f6](https://github.com/youzan/vant/commit/f927f6a7518cf7d08ec8abc5dd35019685c19e3a)
- Search: style error in dark mode [#10527](https://github.com/vant-ui/vant/issues/10527)
- @vant/area-data: only publish dist folder to npm [f927f6](https://github.com/vant-ui/vant/commit/f927f6a7518cf7d08ec8abc5dd35019685c19e3a)
### [v4.0.0-alpha.2](https://github.com/youzan/vant/compare/v3.4.8...v4.0.0-alpha.2)
### [v4.0.0-alpha.2](https://github.com/vant-ui/vant/compare/v3.4.8...v4.0.0-alpha.2)
`2022-04-16`
- CalendarDay: add default margin-bottom [#10441](https://github.com/youzan/vant/issues/10441)
- Empty: support set the image size separately [#10465](https://github.com/youzan/vant/issues/10465)
- Field: add enterkeyhint prop [#10478](https://github.com/youzan/vant/issues/10478)
- Form: add getValues method [#10511](https://github.com/youzan/vant/issues/10511)
- Icon: add some icons for ShareSheet [#10468](https://github.com/youzan/vant/issues/10468)
- Locale: add Danish lang [#10513](https://github.com/youzan/vant/issues/10513)
- ShareSheet: no longer rely on CDN images [#10469](https://github.com/youzan/vant/issues/10469)
- Add event arguments in web-types.json [#10474](https://github.com/youzan/vant/issues/10474)
- CalendarDay: add default margin-bottom [#10441](https://github.com/vant-ui/vant/issues/10441)
- Empty: support set the image size separately [#10465](https://github.com/vant-ui/vant/issues/10465)
- Field: add enterkeyhint prop [#10478](https://github.com/vant-ui/vant/issues/10478)
- Form: add getValues method [#10511](https://github.com/vant-ui/vant/issues/10511)
- Icon: add some icons for ShareSheet [#10468](https://github.com/vant-ui/vant/issues/10468)
- Locale: add Danish lang [#10513](https://github.com/vant-ui/vant/issues/10513)
- ShareSheet: no longer rely on CDN images [#10469](https://github.com/vant-ui/vant/issues/10469)
- Add event arguments in web-types.json [#10474](https://github.com/vant-ui/vant/issues/10474)
**Bug Fixes**
- DatetimePicker: modeValue is inconsistent with the selected data [#10448](https://github.com/youzan/vant/issues/10448)
- Rate: support precisely selected [#10500](https://github.com/youzan/vant/issues/10500)
- DatetimePicker: modeValue is inconsistent with the selected data [#10448](https://github.com/vant-ui/vant/issues/10448)
- Rate: support precisely selected [#10500](https://github.com/vant-ui/vant/issues/10500)
### [v4.0.0-alpha.1](https://github.com/youzan/vant/compare/v3.4.6...v4.0.0-alpha.1)
### [v4.0.0-alpha.1](https://github.com/vant-ui/vant/compare/v3.4.6...v4.0.0-alpha.1)
`2022-03-19`
**Feature**
- @vant/area-data: update counties of NanJing [#10410](https://github.com/youzan/vant/issues/10410)
- Locale: add la-LA.ts [#10388](https://github.com/youzan/vant/issues/10388)
- @vant/area-data: update counties of NanJing [#10410](https://github.com/vant-ui/vant/issues/10410)
- Locale: add la-LA.ts [#10388](https://github.com/vant-ui/vant/issues/10388)
**Bug Fixes**
- Calendar: fix title color in dark mode [#10403](https://github.com/youzan/vant/issues/10403)
- Picker: fix title color in dark mode [#10403](https://github.com/youzan/vant/issues/10403)
- ConfigProvider: dark mode not work as default value [#10413](https://github.com/youzan/vant/issues/10413)
- DatePicker: failed to update model value [#10415](https://github.com/youzan/vant/issues/10415)
- Dialog: fix title and message color in dark mode [#10379](https://github.com/youzan/vant/issues/10379)
- IndexBar: allow active bottom anchor [#10404](https://github.com/youzan/vant/issues/10404)
- Calendar: fix title color in dark mode [#10403](https://github.com/vant-ui/vant/issues/10403)
- Picker: fix title color in dark mode [#10403](https://github.com/vant-ui/vant/issues/10403)
- ConfigProvider: dark mode not work as default value [#10413](https://github.com/vant-ui/vant/issues/10413)
- DatePicker: failed to update model value [#10415](https://github.com/vant-ui/vant/issues/10415)
- Dialog: fix title and message color in dark mode [#10379](https://github.com/vant-ui/vant/issues/10379)
- IndexBar: allow active bottom anchor [#10404](https://github.com/vant-ui/vant/issues/10404)

View File

@ -19,89 +19,89 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
## 更新内容
### [v4.0.0-beta.0](https://github.com/youzan/vant/compare/v3.5.2...v4.0.0-beta.0)
### [v4.0.0-beta.0](https://github.com/vant-ui/vant/compare/v3.5.2...v4.0.0-beta.0)
`2022-07-16`
**Breaking Changes**
- Toast: 重新设计函数调用 API [#10804](https://github.com/youzan/vant/issues/10804)
- Dialog: 重新设计函数调用 API [#10781](https://github.com/youzan/vant/issues/10781)
- Notify: 重新设计函数调用 API[#10782](https://github.com/youzan/vant/issues/10782)
- ImagePreview: 重新设计函数调用 API [#10802](https://github.com/youzan/vant/issues/10802)
- Toast: 重新设计函数调用 API [#10804](https://github.com/vant-ui/vant/issues/10804)
- Dialog: 重新设计函数调用 API [#10781](https://github.com/vant-ui/vant/issues/10781)
- Notify: 重新设计函数调用 API[#10782](https://github.com/vant-ui/vant/issues/10782)
- ImagePreview: 重新设计函数调用 API [#10802](https://github.com/vant-ui/vant/issues/10802)
关于以上改动的详细描述和迁移方法,请参考 [从 v3 升级到 v4](/vant/v4/#/zh-CN/migrate-from-v3) 的 「API 调整」部分。
**Feature**
- 新增 @vant/compat 包,用于辅助代码迁移 [#10806](https://github.com/youzan/vant/issues/10806)
- Calendar: 新增 getSelectedDate 方法 [419a8e](https://github.com/youzan/vant/commit/419a8e4f0e6454b9aac30d5800318deabec099cb)
- 由于主题定制方式调整,发布到 npm 的代码中将不再包含 .less 样式源文件,从而减少 npm 包体积 [#10752](https://github.com/youzan/vant/issues/10752)
- 新增 @vant/compat 包,用于辅助代码迁移 [#10806](https://github.com/vant-ui/vant/issues/10806)
- Calendar: 新增 getSelectedDate 方法 [419a8e](https://github.com/vant-ui/vant/commit/419a8e4f0e6454b9aac30d5800318deabec099cb)
- 由于主题定制方式调整,发布到 npm 的代码中将不再包含 .less 样式源文件,从而减少 npm 包体积 [#10752](https://github.com/vant-ui/vant/issues/10752)
**Bug Fixes**
- Uploader: 修复预览图片时会展示上传失败的图片的问题 [#10790](https://github.com/youzan/vant/issues/10790)
- Uploader: 修复预览图片时会展示上传失败的图片的问题 [#10790](https://github.com/vant-ui/vant/issues/10790)
### [v4.0.0-alpha.4](https://github.com/youzan/vant/compare/v3.5.0-beta.0...v4.0.0-alpha.4)
### [v4.0.0-alpha.4](https://github.com/vant-ui/vant/compare/v3.5.0-beta.0...v4.0.0-alpha.4)
`2022-05-31`
**Feature**
- 适配 nuxt 3现在 dist 目录下所有 esmodule 文件将使用 `.mjs` 文件后缀 [#10625](https://github.com/youzan/vant/issues/10625)
- 适配 nuxt 3现在 dist 目录下所有 esmodule 文件将使用 `.mjs` 文件后缀 [#10625](https://github.com/vant-ui/vant/issues/10625)
### [v4.0.0-alpha.3](https://github.com/youzan/vant/compare/v3.4.9...v4.0.0-alpha.3)
### [v4.0.0-alpha.3](https://github.com/vant-ui/vant/compare/v3.4.9...v4.0.0-alpha.3)
`2022-05-02`
**Feature**
- Form: 支持同时设置多个 validate-trigger 值 [#10544](https://github.com/youzan/vant/issues/10544)
- Empty: 支持在无网络的环境下离线使用,图片从 CDN 调整为内联的 SVG 图片 [#10514](https://github.com/youzan/vant/issues/10514) [#10515](https://github.com/youzan/vant/issues/10515) [#10516](https://github.com/youzan/vant/issues/10516)
- Loading: 优化无障碍访问 [#10568](https://github.com/youzan/vant/issues/10568)
- Form: 支持同时设置多个 validate-trigger 值 [#10544](https://github.com/vant-ui/vant/issues/10544)
- Empty: 支持在无网络的环境下离线使用,图片从 CDN 调整为内联的 SVG 图片 [#10514](https://github.com/vant-ui/vant/issues/10514) [#10515](https://github.com/vant-ui/vant/issues/10515) [#10516](https://github.com/vant-ui/vant/issues/10516)
- Loading: 优化无障碍访问 [#10568](https://github.com/vant-ui/vant/issues/10568)
**Bug Fixes**
- Search: 修复暗色模式下样式错误的问题 [#10527](https://github.com/youzan/vant/issues/10527)
- @vant/area-data: 修复发布到 npm 时包含 tsconfig.json 文件导致编译错误的问题 [f927f6](https://github.com/youzan/vant/commit/f927f6a7518cf7d08ec8abc5dd35019685c19e3a)
- Search: 修复暗色模式下样式错误的问题 [#10527](https://github.com/vant-ui/vant/issues/10527)
- @vant/area-data: 修复发布到 npm 时包含 tsconfig.json 文件导致编译错误的问题 [f927f6](https://github.com/vant-ui/vant/commit/f927f6a7518cf7d08ec8abc5dd35019685c19e3a)
### [v4.0.0-alpha.2](https://github.com/youzan/vant/compare/v3.4.8...v4.0.0-alpha.2)
### [v4.0.0-alpha.2](https://github.com/vant-ui/vant/compare/v3.4.8...v4.0.0-alpha.2)
`2022-04-16`
**Feature**
- CalendarDay: 增加日期行间距 [#10441](https://github.com/youzan/vant/issues/10441)
- Empty: 支持单独设置 image 的宽高 [#10465](https://github.com/youzan/vant/issues/10465)
- Field: 新增 enterkeyhint 属性 [#10478](https://github.com/youzan/vant/issues/10478)
- Form: 新增 getValues 方法 [#10511](https://github.com/youzan/vant/issues/10511)
- Icon: 新增 qq、weibo 等图标 [#10468](https://github.com/youzan/vant/issues/10468)
- Locale: 新增 Danish 丹麦语 [#10513](https://github.com/youzan/vant/issues/10513)
- ShareSheet: 不再依赖 CDN 上的图片资源,使用 iconfont 代替 [#10469](https://github.com/youzan/vant/issues/10469)
- web-types.json 文件增加 event arguments 信息 [#10474](https://github.com/youzan/vant/issues/10474)
- CalendarDay: 增加日期行间距 [#10441](https://github.com/vant-ui/vant/issues/10441)
- Empty: 支持单独设置 image 的宽高 [#10465](https://github.com/vant-ui/vant/issues/10465)
- Field: 新增 enterkeyhint 属性 [#10478](https://github.com/vant-ui/vant/issues/10478)
- Form: 新增 getValues 方法 [#10511](https://github.com/vant-ui/vant/issues/10511)
- Icon: 新增 qq、weibo 等图标 [#10468](https://github.com/vant-ui/vant/issues/10468)
- Locale: 新增 Danish 丹麦语 [#10513](https://github.com/vant-ui/vant/issues/10513)
- ShareSheet: 不再依赖 CDN 上的图片资源,使用 iconfont 代替 [#10469](https://github.com/vant-ui/vant/issues/10469)
- web-types.json 文件增加 event arguments 信息 [#10474](https://github.com/vant-ui/vant/issues/10474)
**Bug Fixes**
- DatetimePicker: 修复 modeValue 与选中的数据不一致的问题 [#10448](https://github.com/youzan/vant/issues/10448)
- Rate: 修复多行时滑动选中不正确的问题 [#10500](https://github.com/youzan/vant/issues/10500)
- DatetimePicker: 修复 modeValue 与选中的数据不一致的问题 [#10448](https://github.com/vant-ui/vant/issues/10448)
- Rate: 修复多行时滑动选中不正确的问题 [#10500](https://github.com/vant-ui/vant/issues/10500)
### [v4.0.0-alpha.1](https://github.com/youzan/vant/compare/v3.4.6...v4.0.0-alpha.1)
### [v4.0.0-alpha.1](https://github.com/vant-ui/vant/compare/v3.4.6...v4.0.0-alpha.1)
`2022-03-19`
**Feature**
- @vant/area-data: 新增南京市江北新区 [#10410](https://github.com/youzan/vant/issues/10410)
- Locale: 新增老挝语 [#10388](https://github.com/youzan/vant/issues/10388)
- @vant/area-data: 新增南京市江北新区 [#10410](https://github.com/vant-ui/vant/issues/10410)
- Locale: 新增老挝语 [#10388](https://github.com/vant-ui/vant/issues/10388)
**Bug Fixes**
- Calendar: 修复暗色模式下标题颜色 [#10403](https://github.com/youzan/vant/issues/10403)
- Picker: 修复暗色模式下标题颜色 [#10403](https://github.com/youzan/vant/issues/10403)
- ConfigProvider: 修复默认设置暗色模式不生效的问题 [#10413](https://github.com/youzan/vant/issues/10413)
- DatePicker: 修复更新 v-model 不生效的问题 [#10415](https://github.com/youzan/vant/issues/10415)
- Dialog: 修复暗色模式下标题和文本颜色 [#10379](https://github.com/youzan/vant/issues/10379)
- IndexBar: 修复底部索引无法高亮的问题 [#10404](https://github.com/youzan/vant/issues/10404)
- Calendar: 修复暗色模式下标题颜色 [#10403](https://github.com/vant-ui/vant/issues/10403)
- Picker: 修复暗色模式下标题颜色 [#10403](https://github.com/vant-ui/vant/issues/10403)
- ConfigProvider: 修复默认设置暗色模式不生效的问题 [#10413](https://github.com/vant-ui/vant/issues/10413)
- DatePicker: 修复更新 v-model 不生效的问题 [#10415](https://github.com/vant-ui/vant/issues/10415)
- Dialog: 修复暗色模式下标题和文本颜色 [#10379](https://github.com/vant-ui/vant/issues/10379)
- IndexBar: 修复底部索引无法高亮的问题 [#10404](https://github.com/vant-ui/vant/issues/10404)
### 4.0.0-alpha.0

View File

@ -21,7 +21,7 @@
```bash
# 克隆仓库
git clone git@github.com:youzan/vant.git
git clone git@github.com:vant-ui/vant.git
# 安装依赖
pnpm i
@ -89,7 +89,7 @@ src
在编写代码时,请注意:
- 确保代码可以通过仓库的 ESLint 和 Stylelint 校验。
- 确保代码可以通过仓库的 ESLint 校验。
- 确保代码格式是规范的,使用 prettier 进行代码格式化。
- 确保没有使用超出兼容性范围的 API比如 `async/await`
@ -124,7 +124,7 @@ src
```bash
# 添加主仓库到 remote作为 fork 后仓库的上游仓库
git remote add upstream git@github.com:youzan/vant.git
git remote add upstream git@github.com:vant-ui/vant.git
# 拉取主仓库最新代码
git fetch upstream

View File

@ -22,7 +22,7 @@ Contains color specifications, font specifications, and component design specifi
<img src="https://fastly.jsdelivr.net/npm/@vant/assets/tab_202009101415.png" style="width: 80%; box-shadow: 0 1px 2px rgba(0,0,0,.2)">
<a class="design-download" href="https://github.com/youzan/vant/blob/dev/packages/vant/docs/assets/design.sketch?raw=true">Download</a>
<a class="design-download" href="https://github.com/vant-ui/vant/blob/dev/packages/vant/docs/assets/design.sketch?raw=true">Download</a>
### Icons (Sketch)
@ -30,7 +30,7 @@ Contains icon library resources.
<img src="https://fastly.jsdelivr.net/npm/@vant/assets/design-icons-0321.png" style="width: 80%; box-shadow: 0 1px 2px rgba(0,0,0,.2)">
<a class="design-download" href="https://github.com/youzan/vant/blob/dev/packages/vant-icons/assets/icons.sketch?raw=true">Download</a>
<a class="design-download" href="https://github.com/vant-ui/vant/blob/dev/packages/vant-icons/assets/icons.sketch?raw=true">Download</a>
### Axure

View File

@ -22,7 +22,7 @@
<img src="https://fastly.jsdelivr.net/npm/@vant/assets/tab_202009101415.png" style="width: 80%; box-shadow: 0 1px 2px rgba(0,0,0,.2)">
<a class="design-download" href="https://github.com/youzan/vant/blob/dev/packages/vant/docs/assets/design.sketch?raw=true">下载</a>
<a class="design-download" href="https://github.com/vant-ui/vant/blob/dev/packages/vant/docs/assets/design.sketch?raw=true">下载</a>
### 图标设计稿Sketch
@ -30,7 +30,7 @@
<img src="https://fastly.jsdelivr.net/npm/@vant/assets/design-icons-0321.png" style="width: 80%; box-shadow: 0 1px 2px rgba(0,0,0,.2)">
<a class="design-download" href="https://github.com/youzan/vant/blob/dev/packages/vant-icons/assets/icons.sketch?raw=true">下载</a>
<a class="design-download" href="https://github.com/vant-ui/vant/blob/dev/packages/vant-icons/assets/icons.sketch?raw=true">下载</a>
#### 在线资源

View File

@ -38,11 +38,11 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
| Project | Description |
| --- | --- |
| [vant-weapp](https://github.com/youzan/vant-weapp) | WeChat MiniProgram UI |
| [vant-weapp](https://github.com/vant-ui/vant-weapp) | WeChat MiniProgram UI |
| [vant-demo](https://github.com/vant-ui/vant-demo) | Collection of Vant demos |
| [vant-cli](https://github.com/youzan/vant/tree/dev/packages/vant-cli) | Scaffold for UI library |
| [vant-icons](https://github.com/youzan/vant/tree/dev/packages/vant-icons) | Vant icons |
| [vant-touch-emulator](https://github.com/youzan/vant/tree/dev/packages/vant-touch-emulator) | Using vant in desktop browsers |
| [vant-cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli) | Scaffold for UI library |
| [vant-icons](https://github.com/vant-ui/vant/tree/dev/packages/vant-icons) | Vant icons |
| [vant-touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator) | Using vant in desktop browsers |
### Community Ecosystem
@ -58,7 +58,7 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
### Other Links
- [Feedback](https://github.com/youzan/vant/issues)
- [Feedback](https://github.com/vant-ui/vant/issues)
- [Changelog](#/en-US/changelog)
- [Gitter](https://gitter.im/vant-contrib/discuss?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
@ -76,13 +76,13 @@ Core contributors of Vant and Vant Weapp:
Thanks to the following friends for their contributions to Vant:
<a href="https://github.com/youzan/vant/graphs/contributors" target="_black">
<a href="https://github.com/vant-ui/vant/graphs/contributors" target="_black">
<img src="https://opencollective.com/vant/contributors.svg?width=890&button=false" alt="contributors" style="width: 100%; margin: 16px 0">
</a>
### Contribution Guide
Please make sure to read the [Contributing Guide](https://github.com/youzan/vant/blob/dev/.github/CONTRIBUTING.md) before making a pull request.
Please make sure to read the [Contributing Guide](https://github.com/vant-ui/vant/blob/dev/.github/CONTRIBUTING.md) before making a pull request.
### LICENSE

View File

@ -50,11 +50,11 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
| 项目 | 描述 |
| --- | --- |
| [vant-weapp](https://github.com/youzan/vant-weapp) | Vant 微信小程序版 |
| [vant-weapp](https://github.com/vant-ui/vant-weapp) | Vant 微信小程序版 |
| [vant-demo](https://github.com/vant-ui/vant-demo) | Vant 官方示例合集 |
| [vant-cli](https://github.com/youzan/vant/tree/dev/packages/vant-cli) | 开箱即用的组件库搭建工具 |
| [vant-icons](https://github.com/youzan/vant/tree/dev/packages/vant-icons) | Vant 图标库 |
| [vant-touch-emulator](https://github.com/youzan/vant/tree/dev/packages/vant-touch-emulator) | 在桌面端使用 Vant 的辅助库 |
| [vant-cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli) | 开箱即用的组件库搭建工具 |
| [vant-icons](https://github.com/vant-ui/vant/tree/dev/packages/vant-icons) | Vant 图标库 |
| [vant-touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator) | 在桌面端使用 Vant 的辅助库 |
### 社区生态
@ -72,7 +72,7 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
### 其他链接
- [意见反馈](https://github.com/youzan/vant/issues)
- [意见反馈](https://github.com/vant-ui/vant/issues)
- [更新日志](#/zh-CN/changelog)
- [码云镜像](https://gitee.com/vant-contrib/vant)
- [Gitter 讨论组](https://gitter.im/vant-contrib/discuss?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
@ -91,7 +91,7 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
感谢以下小伙伴们为 Vant 发展做出的贡献:
<a href="https://github.com/youzan/vant/graphs/contributors" target="_black">
<a href="https://github.com/vant-ui/vant/graphs/contributors" target="_black">
<img src="https://opencollective.com/vant/contributors.svg?width=890&button=false" alt="contributors" style="width: 100%; margin: 16px 0">
</a>
@ -99,7 +99,7 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
贡献代码请阅读我们的[贡献指南](#/zh-CN/contribution)。
使用过程中发现任何问题都可以提 [Issue](https://github.com/youzan/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/youzan/vant/pulls)。
使用过程中发现任何问题都可以提 [Issue](https://github.com/vant-ui/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/vant-ui/vant/pulls)。
### 开源协议

View File

@ -32,10 +32,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/youzan/vant.git",
"url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant"
},
"bugs": "https://github.com/youzan/vant/issues",
"bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan",
"license": "MIT",
"keywords": [

View File

@ -52,7 +52,7 @@ export default {
### @vant/area-data
Vant officially provides a default China area data, which can be imported through [@vant/area-data](https://github.com/youzan/vant/tree/dev/packages/vant-area-data):
Vant officially provides a default China area data, which can be imported through [@vant/area-data](https://github.com/vant-ui/vant/tree/dev/packages/vant-area-data):
```bash
# with npm

View File

@ -54,7 +54,7 @@ const areaList = {
### @vant/area-data
Vant 官方提供了一份默认的中国省市区数据,可以通过 [@vant/area-data](https://github.com/youzan/vant/tree/dev/packages/vant-area-data) 引入:
Vant 官方提供了一份默认的中国省市区数据,可以通过 [@vant/area-data](https://github.com/vant-ui/vant/tree/dev/packages/vant-area-data) 引入:
```bash
# 通过 npm

View File

@ -127,7 +127,7 @@ const t = useTranslate({
<van-button
:text="t('urlRoute')"
type="primary"
url="https://github.com/youzan/vant"
url="https://github.com/vant-ui/vant"
/>
<van-button :text="t('vueRoute')" type="primary" to="index" />
</demo-block>

View File

@ -204,7 +204,7 @@ body {
height: 100%;
// fix icon vertical align
// see: https://github.com/youzan/vant/issues/7617
// see: https://github.com/vant-ui/vant/issues/7617
&::before {
content: ' ';
}

View File

@ -312,7 +312,7 @@ export default defineComponent({
raf(() => {
// add Math.floor to avoid decimal height issues
// https://github.com/youzan/vant/issues/5640
// https://github.com/vant-ui/vant/issues/5640
bodyHeight = Math.floor(useRect(bodyRef).height);
});
scrollToCurrentDate();

View File

@ -81,7 +81,7 @@ const t = useTranslate({
<van-cell
:title="t('urlRoute')"
is-link
url="https://github.com/youzan/vant"
url="https://github.com/vant-ui/vant"
/>
<van-cell :title="t('vueRoute')" is-link to="index" />
</demo-block>

View File

@ -250,7 +250,7 @@ export default {
| Attribute | Description | Type | Default |
| --- | --- | --- | --- |
| v-model | Check status | _boolean_ | `false` |
| name | Checkbox name | _any_ | - |
| name | Checkbox name, usually a unique string or number | _any_ | - |
| shape | Can be set to `square` | _string_ | `round` |
| disabled | Disable checkbox | _boolean_ | `false` |
| label-disabled | Whether to disable label click | _boolean_ | `false` |

View File

@ -265,17 +265,17 @@ export default {
### Checkbox Props
| 参数 | 说明 | 类型 | 默认值 |
| -------------- | ------------------------- | ------------------ | --------- |
| v-model | 是否为选中状态 | _boolean_ | `false` |
| name | 标识符 | _any_ | - |
| shape | 形状,可选值为 `square` | _string_ | `round` |
| disabled | 是否禁用复选框 | _boolean_ | `false` |
| label-disabled | 是否禁用复选框文本点击 | _boolean_ | `false` |
| label-position | 文本位置,可选值为 `left` | _string_ | `right` |
| icon-size | 图标大小,默认单位为 `px` | _number \| string_ | `20px` |
| checked-color | 选中状态颜色 | _string_ | `#1989fa` |
| bind-group | 是否与复选框组绑定 | _boolean_ | `true` |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| v-model | 是否为选中状态 | _boolean_ | `false` |
| name | 标识符,通常为一个唯一的字符串或数字 | _any_ | - |
| shape | 形状,可选值为 `square` | _string_ | `round` |
| disabled | 是否禁用复选框 | _boolean_ | `false` |
| label-disabled | 是否禁用复选框文本点击 | _boolean_ | `false` |
| label-position | 文本位置,可选值为 `left` | _string_ | `right` |
| icon-size | 图标大小,默认单位为 `px` | _number \| string_ | `20px` |
| checked-color | 选中状态颜色 | _string_ | `#1989fa` |
| bind-group | 是否与复选框组绑定 | _boolean_ | `true` |
### CheckboxGroup Props

View File

@ -23,7 +23,7 @@ body {
&__title {
.van-cell__right-icon::before {
// using translateZ to fix safari rendering issues
// see: https://github.com/youzan/vant/issues/8608
// see: https://github.com/vant-ui/vant/issues/8608
transform: rotate(90deg) translateZ(0);
transition: transform var(--van-collapse-item-duration);
}

View File

@ -1,7 +1,10 @@
import { useRect } from '@vant/use';
import { Ref, ref, onMounted, nextTick } from 'vue';
export const useHeight = (element: Element | Ref<Element | undefined>) => {
export const useHeight = (
element: Element | Ref<Element | undefined>,
withSafeArea?: boolean
) => {
const height = ref<number>();
const setHeight = () => {
@ -10,8 +13,16 @@ export const useHeight = (element: Element | Ref<Element | undefined>) => {
onMounted(() => {
nextTick(setHeight);
// https://github.com/youzan/vant/issues/10131
setTimeout(setHeight, 100);
// If the element is using safe area, the system will not return the correct height on page load.
// So we need to wait for the height to be set.
// https://github.com/vant-ui/vant/issues/10131
// https://stackoverflow.com/questions/64891541
if (withSafeArea) {
for (let i = 1; i <= 3; i++) {
setTimeout(setHeight, 100 * i);
}
}
});
return height;

View File

@ -3,7 +3,7 @@ import { useHeight } from './use-height';
import type { BEM } from '../utils/create';
export function usePlaceholder(contentRef: Ref<Element | undefined>, bem: BEM) {
const height = useHeight(contentRef);
const height = useHeight(contentRef, true);
return (renderContent: () => JSX.Element) => (
<div

View File

@ -180,7 +180,7 @@ export default defineComponent({
return (
<div
// add key to force re-render
// see: https://github.com/youzan/vant/issues/7963
// see: https://github.com/vant-ui/vant/issues/7963
key={allowHtml ? 1 : 0}
class={bem('content', { isolated: !hasTitle })}
>

View File

@ -263,7 +263,7 @@ export default defineComponent({
};
// native maxlength have incorrect line-break counting
// see: https://github.com/youzan/vant/issues/5033
// see: https://github.com/vant-ui/vant/issues/5033
const limitValueLength = (value: string) => {
const { maxlength } = props;
if (isDef(maxlength) && getStringLength(value) > maxlength) {

View File

@ -75,7 +75,7 @@ body {
background-color: transparent;
border: 0;
resize: none;
// https://github.com/youzan/vant/pull/9418
// https://github.com/vant-ui/vant/pull/9418
user-select: auto;
&::placeholder {

View File

@ -177,7 +177,7 @@ test('should limit maxlength of input value when using maxlength prop', async ()
expect(wrapper.emitted('update:modelValue')[0][0]).toEqual('123');
await wrapper.setProps({ modelValue: '123' });
// see: https://github.com/youzan/vant/issues/7265
// see: https://github.com/vant-ui/vant/issues/7265
input.element.value = 1423;
input.trigger('input');
expect(input.element.value).toEqual('123');

View File

@ -81,7 +81,7 @@ export function resizeTextarea(
if (height) {
input.style.height = `${height}px`;
// https://github.com/youzan/vant/issues/9178
// https://github.com/vant-ui/vant/issues/9178
setRootScrollTop(scrollTop);
}
}
@ -110,7 +110,7 @@ export function mapInputType(type: FieldType): {
}
// get correct length of emoji
// https://github.com/youzan/vant/issues/10032
// https://github.com/vant-ui/vant/issues/10032
export function getStringLength(str: string) {
return [...str].length;
}

View File

@ -509,7 +509,7 @@ export default {
| Key | Description | Type |
| --- | --- | --- |
| required | Whether to be a required field, the value is not allowed to be empty string, empty array, `undefined`, `null` | _boolean_ |
| required | Whether to be a required field, the value is not allowed to be empty string, empty array, `false`, `undefined`, `null` | _boolean_ |
| message | Error message | _string \| (value, rule) => string_ |
| validator | Custom validator | _(value, rule) => boolean \| string \| Promise_ |
| pattern | Regex pattern | _RegExp_ |

View File

@ -545,7 +545,7 @@ export default {
| 键名 | 说明 | 类型 |
| --- | --- | --- |
| required | 是否为必选字段,当值为空字符串、空数组、`undefined`、`null` 时,校验不通过 | _boolean_ |
| required | 是否为必选字段,当值为空字符串、空数组、`false`、`undefined`、`null` 时,校验不通过 | _boolean_ |
| message | 错误提示文案 | _string \| (value, rule) => string_ |
| validator | 通过函数进行校验 | _(value, rule) => boolean \| string \| Promise_ |
| pattern | 通过正则表达式进行校验 | _RegExp_ |

View File

@ -23,7 +23,7 @@ body {
color: var(--van-grid-item-text-color);
font-size: var(--van-grid-item-text-font-size);
line-height: 1.5;
// https://github.com/youzan/vant/issues/3894
// https://github.com/vant-ui/vant/issues/3894
word-break: break-all;
}

View File

@ -85,7 +85,7 @@ const t = useTranslate({
<van-grid-item
icon="search"
:text="t('urlRoute')"
url="https://github.com/youzan/vant"
url="https://github.com/vant-ui/vant"
/>
</van-grid>
</demo-block>

View File

@ -169,7 +169,7 @@ export default defineComponent({
check();
} else {
// LazyLoad may trigger loaded event before Image mounted
// https://github.com/youzan/vant/issues/10046
// https://github.com/vant-ui/vant/issues/10046
nextTick(check);
}
};

View File

@ -159,7 +159,7 @@ test('should not emit load event when inside an inactive tab', async () => {
expect(onLoad2).toHaveBeenCalledTimes(0);
});
// https://github.com/youzan/vant/issues/9017
// https://github.com/vant-ui/vant/issues/9017
test('should emit load event when parent tab is activated', async () => {
const onLoad1 = jest.fn();
const onLoad2 = jest.fn();

View File

@ -72,8 +72,8 @@ Current supported languages:
| Traditional Chinese (HK) | zh-HK | - |
| Traditional Chinese (TW) | zh-TW | - |
> View all language configs [Here](https://github.com/youzan/vant/tree/dev/packages/vant/src/locale/lang).
> View all language configs [Here](https://github.com/vant-ui/vant/tree/dev/packages/vant/src/locale/lang).
### Add new language
If you cant find the language you need, please send us a Pull Request to add the new language pack, you can refer to [Add German language pack](https://github.com/youzan/vant/pull/7245) PR.
If you cant find the language you need, please send us a Pull Request to add the new language pack, you can refer to [Add German language pack](https://github.com/vant-ui/vant/pull/7245) PR.

View File

@ -73,13 +73,13 @@ Locale.add(messages);
| 繁體中文(港) | zh-HK | - |
| 繁體中文(台) | zh-TW | - |
> 在 [这里](https://github.com/youzan/vant/tree/dev/packages/vant/src/locale/lang) 查看所有的语言包源文件。
> 在 [这里](https://github.com/vant-ui/vant/tree/dev/packages/vant/src/locale/lang) 查看所有的语言包源文件。
## 常见问题
### 找不到所需的语言包?
如果上方列表中没有你需要的语言,欢迎给我们提 Pull Request 来增加新的语言包,改动内容可以参考[增加德语语言包](https://github.com/youzan/vant/pull/7245) 的 PR。
如果上方列表中没有你需要的语言,欢迎给我们提 Pull Request 来增加新的语言包,改动内容可以参考[增加德语语言包](https://github.com/vant-ui/vant/pull/7245) 的 PR。
### 业务代码如何实现国际化?

View File

@ -59,7 +59,7 @@ export default defineComponent({
const onTouchEnd = (event: TouchEvent) => {
if (active.value) {
// eliminate tap delay on safari
// see: https://github.com/youzan/vant/issues/6836
// see: https://github.com/vant-ui/vant/issues/6836
if (!slots.default) {
preventDefault(event);
}

View File

@ -93,25 +93,31 @@ export default defineComponent({
const wrapperRef = ref<HTMLElement>();
const popoverRef = ref<ComponentInstance>();
const getPopoverOptions = () => ({
placement: props.placement,
modifiers: [
{
name: 'computeStyles',
options: {
adaptive: false,
gpuAcceleration: false,
},
},
extend({}, offsetModifier, {
options: {
offset: props.offset,
},
}),
],
});
const createPopperInstance = () => {
if (wrapperRef.value && popoverRef.value) {
return createPopper(wrapperRef.value, popoverRef.value.popupRef.value, {
placement: props.placement,
modifiers: [
{
name: 'computeStyles',
options: {
adaptive: false,
gpuAcceleration: false,
},
},
extend({}, offsetModifier, {
options: {
offset: props.offset,
},
}),
],
});
return createPopper(
wrapperRef.value,
popoverRef.value.popupRef.value,
getPopoverOptions()
);
}
return null;
};
@ -125,9 +131,7 @@ export default defineComponent({
if (!popper) {
popper = createPopperInstance();
} else {
popper.setOptions({
placement: props.placement,
});
popper.setOptions(getPopoverOptions());
}
});
};
@ -207,7 +211,7 @@ export default defineComponent({
}
});
watch(() => [props.show, props.placement], updateLocation);
watch(() => [props.show, props.offset, props.placement], updateLocation);
useClickAway(wrapperRef, onClickAway, { eventName: 'touchstart' });

View File

@ -85,6 +85,17 @@ const show = ref({
const showPicker = ref(false);
const currentPlacement = ref<PopoverPlacement>('top');
const onClickChoosePlacement = () => {
showPicker.value = true;
setTimeout(() => {
show.value = {
...show.value,
placement: true,
};
}, 300);
};
const onPickerChange = (value: PopoverPlacement) => {
setTimeout(() => {
show.value.placement = true;
@ -129,7 +140,7 @@ const onSelect = (action: { text: string }) => showToast(action.text);
readonly
name="picker"
:label="t('choosePlacement')"
@click="showPicker = true"
@click="onClickChoosePlacement"
/>
<van-popup

View File

@ -178,7 +178,7 @@ import type {
| Attribute | Description | Type | Default |
| --- | --- | --- | --- |
| name | Radio name | _any_ | - |
| name | Radio name, usually a unique string or number | _any_ | - |
| shape | Can be set to `square` | _string_ | `round` |
| disabled | Whether to disable radio | _boolean_ | `false` |
| label-disabled | Whether to disable label click | _boolean_ | `false` |

View File

@ -176,15 +176,15 @@ export default {
### Radio Props
| 参数 | 说明 | 类型 | 默认值 |
| -------------- | ------------------------- | ------------------ | --------- |
| name | 标识符 | _any_ | - |
| shape | 形状,可选值为 `square` | _string_ | `round` |
| disabled | 是否为禁用状态 | _boolean_ | `false` |
| label-disabled | 是否禁用文本内容点击 | _boolean_ | `false` |
| label-position | 文本位置,可选值为 `left` | _string_ | `right` |
| icon-size | 图标大小,默认单位为 `px` | _number \| string_ | `20px` |
| checked-color | 选中状态颜色 | _string_ | `#1989fa` |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| name | 标识符,通常为一个唯一的字符串或数字 | _any_ | - |
| shape | 形状,可选值为 `square` | _string_ | `round` |
| disabled | 是否为禁用状态 | _boolean_ | `false` |
| label-disabled | 是否禁用文本内容点击 | _boolean_ | `false` |
| label-position | 文本位置,可选值为 `left` | _string_ | `right` |
| icon-size | 图标大小,默认单位为 `px` | _number \| string_ | `20px` |
| checked-color | 选中状态颜色 | _string_ | `#1989fa` |
### RadioGroup Props

View File

@ -36,7 +36,7 @@ body {
}
&__text {
// https://github.com/youzan/vant/issues/7455
// https://github.com/vant-ui/vant/issues/7455
word-break: break-all;
}

View File

@ -200,7 +200,7 @@ test('should not emit change event when value not changed', async () => {
expect(wrapper.emitted('change')).toHaveLength(1);
});
// https://github.com/youzan/vant/issues/8889
// https://github.com/vant-ui/vant/issues/8889
test('should format v-model with step correctly', async () => {
const wrapper = mount(Slider, {
props: {

View File

@ -128,7 +128,7 @@ export default {
| max | Max value | _number \| string_ | - |
| default-value | Default value, valid when v-model is empty | _number \| string_ | `1` |
| step | Value change step | _number \| string_ | `1` |
| name | Stepper name | _number \| string_ | - |
| name | Stepper name, usually a unique string or number | _number \| string_ | - |
| input-width | Input width | _number \| string_ | `32px` |
| button-size | Button size | _number \| string_ | `28px` |
| decimal-length | Decimal length | _number \| string_ | - |

View File

@ -148,7 +148,7 @@ export default {
| max | 最大值 | _number \| string_ | - |
| default-value | 初始值,当 v-model 为空时生效 | _number \| string_ | `1` |
| step | 步长,每次点击时改变的值 | _number \| string_ | `1` |
| name | 标识符,可以在 `change` 事件回调参数中获取 | _number \| string_ | - |
| name | 标识符,通常为一个唯一的字符串或数字,可以在 `change` 事件回调参数中获取 | _number \| string_ | - |
| input-width | 输入框宽度,默认单位为 `px` | _number \| string_ | `32px` |
| button-size | 按钮大小以及输入框高度,默认单位为 `px` | _number \| string_ | `28px` |
| decimal-length | 固定显示的小数位数 | _number \| string_ | - |

View File

@ -246,7 +246,7 @@ export default defineComponent({
const onMousedown = (event: MouseEvent) => {
// fix mobile safari page scroll down issue
// see: https://github.com/youzan/vant/issues/7690
// see: https://github.com/vant-ui/vant/issues/7690
if (props.disableInput) {
preventDefault(event);
}

View File

@ -107,7 +107,7 @@ export default {
| Attribute | Description | Type | Default |
| --- | --- | --- | --- |
| name | Identifier of SwipeCell | _number \| string_ | - |
| name | Identifier of SwipeCell, usually a unique string or number | _number \| string_ | - |
| left-width | Width of the left swipe area | _number \| string_ | `auto` |
| right-width | Width of the right swipe area | _number \| string_ | `auto` |
| before-close | Callback function before close | _(args) => boolean \| Promise\<boolean\>_ | - |

View File

@ -114,7 +114,7 @@ export default {
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| name | 标识符,可以在事件参数中获取到 | _number \| string_ | `''` |
| name | 标识符,通常为一个唯一的字符串或数字,可以在事件参数中获取到 | _number \| string_ | `''` |
| left-width | 指定左侧滑动区域宽度,单位为 `px` | _number \| string_ | `auto` |
| right-width | 指定右侧滑动区域宽度,单位为 `px` | _number \| string_ | `auto` |
| before-close | 关闭前的回调函数,返回 `false` 可阻止关闭,支持返回 Promise | _(args) => boolean \| Promise\<boolean\>_ | - |

View File

@ -274,7 +274,7 @@ export default defineComponent({
autoplay();
};
// issue: https://github.com/youzan/vant/issues/10052
// issue: https://github.com/vant-ui/vant/issues/10052
if (isHidden(root)) {
nextTick().then(cb);
} else {

View File

@ -10,7 +10,7 @@ body {
.van-swipe {
position: relative;
overflow: hidden;
// https://github.com/youzan/vant/issues/9931
// https://github.com/vant-ui/vant/issues/9931
transform: translateZ(0);
cursor: grab;
user-select: none;

View File

@ -33,7 +33,7 @@ body {
left: 2px;
width: var(--van-switch-node-size);
height: var(--van-switch-node-size);
// https://github.com/youzan/vant/issues/9839
// https://github.com/vant-ui/vant/issues/9839
font-size: inherit;
background: var(--van-switch-node-background);
border-radius: 100%;

View File

@ -36,7 +36,7 @@ body {
// allow newline character
white-space: pre-wrap;
text-align: center;
// https://github.com/youzan/vant/issues/8959
// https://github.com/vant-ui/vant/issues/8959
word-break: break-all;
background: var(--van-toast-background);
border-radius: var(--van-toast-radius);

View File

@ -308,7 +308,7 @@ export default {
| --- | --- | --- | --- |
| v-model | List of uploaded files | _FileListItem[]_ | - |
| accept | Accepted [file type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers) | _string_ | `image/*` |
| name | Input name | _number \| string_ | - |
| name | Input name, usually a unique string or number | _number \| string_ | - |
| preview-size | Size of preview image | _number \| string \| Array_ | `80px` |
| preview-image | Whether to show image preview | _boolean_ | `true` |
| preview-full-image | Whether to show full screen image preview when image is clicked | _boolean_ | `true` |

View File

@ -327,7 +327,7 @@ export default {
| --- | --- | --- | --- |
| v-model | 已上传的文件列表 | _FileListItem[]_ | - |
| accept | 允许上传的文件类型,[详细说明](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/Input/file#%E9%99%90%E5%88%B6%E5%85%81%E8%AE%B8%E7%9A%84%E6%96%87%E4%BB%B6%E7%B1%BB%E5%9E%8B) | _string_ | `image/*` |
| name | 标识符,可以在回调函数的第二项参数中获取 | _number \| string_ | - |
| name | 标识符,通常为一个唯一的字符串或数字,可以在回调函数的第二项参数中获取 | _number \| string_ | - |
| preview-size | 预览图和上传区域的尺寸,默认单位为 `px` | _number \| string \| Array_ | `80px` |
| preview-image | 是否在上传完成后展示预览图 | _boolean_ | `true` |
| preview-full-image | 是否在点击预览图后展示全屏图片预览 | _boolean_ | `true` |

View File

@ -1,7 +1,7 @@
import { App } from 'vue';
import { camelize } from './format';
// https://github.com/youzan/vant/issues/8302
// https://github.com/vant-ui/vant/issues/8302
type EventShim = {
new (...args: any[]): {
$props: {

View File

@ -29,17 +29,11 @@ export default {
{ label: 'v3', link: '/vant/v3/' },
],
baiduAnalytics: {
seed: 'ad6b5732c36321f2dafed737ac2da92f',
seed: 'af5d41bc4e446e76665dbe3ec18d55c3',
},
htmlMeta: {
'docsearch:version': 'v4',
},
headHtml: `<script>
if (location.host === 'youzan.github.io') {
location.href = location.href.replace('youzan.github.io', 'vant-ui.github.io');
}
</script>
`,
locales: {
'zh-CN': {
title: 'Vant 4',
@ -54,7 +48,7 @@ location.href = location.href.replace('youzan.github.io', 'vant-ui.github.io');
},
{
logo: 'https://fastly.jsdelivr.net/npm/@vant/assets/github.svg',
url: 'https://github.com/youzan/vant',
url: 'https://github.com/vant-ui/vant',
},
],
nav: [
@ -477,7 +471,7 @@ location.href = location.href.replace('youzan.github.io', 'vant-ui.github.io');
links: [
{
logo: 'https://fastly.jsdelivr.net/npm/@vant/assets/github.svg',
url: 'https://github.com/youzan/vant',
url: 'https://github.com/vant-ui/vant',
},
],
nav: [

766
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff