diff --git a/.github/workflows/deploy-v4-site.yml b/.github/workflows/deploy-v4-site.yml
index bc275f1be..3cac9c586 100644
--- a/.github/workflows/deploy-v4-site.yml
+++ b/.github/workflows/deploy-v4-site.yml
@@ -6,6 +6,8 @@ on:
paths:
- 'packages/vant/docs/**'
+ workflow_dispatch:
+
jobs:
build-and-deploy:
runs-on: ubuntu-latest
@@ -16,9 +18,7 @@ jobs:
ref: 'next'
- name: Install pnpm
- uses: pnpm/action-setup@v2.0.1
- with:
- version: 6.20.3
+ run: npm i pnpm@7 -g
- uses: actions/setup-node@v2
with:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index f6bd54ab3..1082a8153 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -1,6 +1,6 @@
name: CI
-on: [push, pull_request]
+on: [push]
jobs:
lint:
@@ -9,9 +9,7 @@ jobs:
- uses: actions/checkout@v2
- name: Install pnpm
- uses: pnpm/action-setup@v2.0.1
- with:
- version: 6.20.3
+ run: npm i pnpm@7 -g
- uses: actions/setup-node@v2
with:
@@ -30,9 +28,7 @@ jobs:
- uses: actions/checkout@v2
- name: Install pnpm
- uses: pnpm/action-setup@v2.0.1
- with:
- version: 6.20.3
+ run: npm i pnpm@7 -g
- uses: actions/setup-node@v2
with:
@@ -56,9 +52,7 @@ jobs:
- uses: actions/checkout@v2
- name: Install pnpm
- uses: pnpm/action-setup@v2.0.1
- with:
- version: 6.20.3
+ run: npm i pnpm@7 -g
- uses: actions/setup-node@v2
with:
diff --git a/README.md b/README.md
index bdc154c71..d4810fb7e 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-
+
Vant
@@ -87,7 +87,7 @@ 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-demo](https://github.com/youzan/vant-demo) | Collection of Vant demos |
+| [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 |
@@ -114,7 +114,7 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
You can scan the following QR code to access the demo:
-
+
## Core Team
diff --git a/README.zh-CN.md b/README.zh-CN.md
index cfadb3ea2..e0ff482af 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -1,5 +1,5 @@
-
+
Vant
@@ -93,7 +93,7 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
| 项目 | 描述 |
| --- | --- |
| [vant-weapp](https://github.com/youzan/vant-weapp) | Vant 微信小程序版 |
-| [vant-demo](https://github.com/youzan/vant-demo) | 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 的辅助库 |
@@ -122,7 +122,7 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
可以手机扫码以下二维码访问手机端 demo:
-
+
## 核心团队
diff --git a/package.json b/package.json
index 55f257472..432d40bed 100644
--- a/package.json
+++ b/package.json
@@ -2,12 +2,12 @@
"private": true,
"scripts": {
"prepare": "husky install",
- "dev": "pnpm dev --dir ./packages/vant",
- "lint": "pnpm lint --dir ./packages/vant",
- "test": "pnpm test --dir ./packages/vant",
- "test:watch": "pnpm test:watch --dir ./packages/vant",
- "build": "pnpm build --dir ./packages/vant",
- "build:site": "pnpm build:site --dir ./packages/vant"
+ "dev": "pnpm --dir ./packages/vant dev",
+ "lint": "pnpm --dir ./packages/vant lint",
+ "test": "pnpm --dir ./packages/vant test",
+ "test:watch": "pnpm --dir ./packages/vant test:watch",
+ "build": "pnpm --dir ./packages/vant build",
+ "build:site": "pnpm --dir ./packages/vant build:site"
},
"lint-staged": {
"*.md": "prettier --write",
@@ -15,7 +15,7 @@
"*.{ts,tsx,js,vue}": "eslint --fix",
"*.{vue,css,less}": "stylelint --fix"
},
- "packageManager": "pnpm",
+ "packageManager": "pnpm@7.1.6",
"devDependencies": {
"@vant/cli": "workspace:*",
"@vant/eslint-config": "workspace:*",
diff --git a/packages/create-vant-cli-app/generators/vue2/vant.config.js b/packages/create-vant-cli-app/generators/vue2/vant.config.js
index a7fe8bb3c..1732cbb4f 100644
--- a/packages/create-vant-cli-app/generators/vue2/vant.config.js
+++ b/packages/create-vant-cli-app/generators/vue2/vant.config.js
@@ -10,7 +10,7 @@ module.exports = {
},
site: {
title: '<%= name %>',
- logo: 'https://cdn.jsdelivr.net/npm/@vant/assets/logo.png',
+ logo: 'https://fastly.jsdelivr.net/npm/@vant/assets/logo.png',
nav: [
{
title: '开发指南',
diff --git a/packages/create-vant-cli-app/generators/vue3/vant.config.mjs b/packages/create-vant-cli-app/generators/vue3/vant.config.mjs
index 6e71e8679..baa16cbf2 100644
--- a/packages/create-vant-cli-app/generators/vue3/vant.config.mjs
+++ b/packages/create-vant-cli-app/generators/vue3/vant.config.mjs
@@ -10,7 +10,7 @@ export default {
},
site: {
title: '<%= name %>',
- logo: 'https://cdn.jsdelivr.net/npm/@vant/assets/logo.png',
+ logo: 'https://fastly.jsdelivr.net/npm/@vant/assets/logo.png',
nav: [
{
title: '开发指南',
diff --git a/packages/vant-area-data/package.json b/packages/vant-area-data/package.json
index 83d0c64a6..a1c2dc14d 100644
--- a/packages/vant-area-data/package.json
+++ b/packages/vant-area-data/package.json
@@ -1,10 +1,16 @@
{
"name": "@vant/area-data",
- "version": "1.2.4",
+ "version": "1.3.1",
"description": "Vant 省市区数据",
"main": "dist/index.cjs.js",
- "module": "dist/index.esm.js",
+ "module": "dist/index.esm.mjs",
"types": "dist/index.d.ts",
+ "exports": {
+ ".": {
+ "import": "./dist/index.esm.mjs",
+ "require": "./dist/index.cjs.js"
+ }
+ },
"files": [
"dist"
],
diff --git a/packages/vant-cli/docs/config.md b/packages/vant-cli/docs/config.md
index 9bd0541a7..84604f7dc 100644
--- a/packages/vant-cli/docs/config.md
+++ b/packages/vant-cli/docs/config.md
@@ -44,7 +44,7 @@ export default {
// title
title: 'Demo UI',
// logo
- logo: 'https://cdn.jsdelivr.net/npm/@vant/assets/logo.png',
+ logo: 'https://fastly.jsdelivr.net/npm/@vant/assets/logo.png',
// description
description: '示例组件库',
// left nav
diff --git a/packages/vant-cli/docs/config.zh-CN.md b/packages/vant-cli/docs/config.zh-CN.md
index 81b022e26..24ece4b09 100644
--- a/packages/vant-cli/docs/config.zh-CN.md
+++ b/packages/vant-cli/docs/config.zh-CN.md
@@ -44,7 +44,7 @@ export default {
// 标题
title: 'Demo UI',
// 图标
- logo: 'https://cdn.jsdelivr.net/npm/@vant/assets/logo.png',
+ logo: 'https://fastly.jsdelivr.net/npm/@vant/assets/logo.png',
// 描述
description: '示例组件库',
// 左侧导航
diff --git a/packages/vant-cli/package.json b/packages/vant-cli/package.json
index c92702d33..77092cdb5 100644
--- a/packages/vant-cli/package.json
+++ b/packages/vant-cli/package.json
@@ -42,7 +42,11 @@
"@types/fs-extra": "^9.0.13",
"@types/less": "^3.0.3",
"@types/markdown-it": "^12.2.3",
- "vue": "^3.2.27"
+ "@types/react": "^18",
+ "@jest/types": "^27",
+ "vue": "^3.2.27",
+ "react": "^18",
+ "react-dom": "^18"
},
"dependencies": {
"@babel/core": "^7.16.0",
diff --git a/packages/vant-cli/site/desktop/components/SearchInput.vue b/packages/vant-cli/site/desktop/components/SearchInput.vue
index 62dfaac69..c83550ba8 100644
--- a/packages/vant-cli/site/desktop/components/SearchInput.vue
+++ b/packages/vant-cli/site/desktop/components/SearchInput.vue
@@ -3,9 +3,6 @@
+
```
## 禁用 touch 模拟
diff --git a/packages/vant-use/build.js b/packages/vant-use/build.js
index a763c8758..2afe17ad7 100644
--- a/packages/vant-use/build.js
+++ b/packages/vant-use/build.js
@@ -1,7 +1,8 @@
const { build } = require('esbuild');
function bundleBundle(format) {
- const outfile = `dist/index.${format}.js`;
+ const ext = format === 'esm' ? '.mjs' : '.js';
+ const outfile = `dist/index.${format}${ext}`;
const finish = () => console.log('Build finished:', outfile);
const onRebuild = (error) => (error ? console.log(error) : finish());
diff --git a/packages/vant-use/changelog.md b/packages/vant-use/changelog.md
index 50d60899d..3e3369d68 100644
--- a/packages/vant-use/changelog.md
+++ b/packages/vant-use/changelog.md
@@ -1,5 +1,13 @@
# Changelog
+## v1.4.1
+
+- Add `exports` field to package.json, support nuxt 3.
+
+## v1.4.0
+
+- Using `.mjs` extension, `dist/index.esm.js` -> `dist/index.esm.mjs`
+
## v1.3.6
- Fix missing VisibilityState type
diff --git a/packages/vant-use/package.json b/packages/vant-use/package.json
index c0398891e..2fcf9287c 100644
--- a/packages/vant-use/package.json
+++ b/packages/vant-use/package.json
@@ -1,10 +1,16 @@
{
"name": "@vant/use",
- "version": "1.3.6",
+ "version": "1.4.1",
"description": "Vant Composition API",
"main": "dist/index.cjs.js",
- "module": "dist/index.esm.js",
+ "module": "dist/index.esm.mjs",
"typings": "dist/index.d.ts",
+ "exports": {
+ ".": {
+ "import": "./dist/index.esm.mjs",
+ "require": "./dist/index.cjs.js"
+ }
+ },
"sideEffects": false,
"files": [
"dist"
diff --git a/packages/vant/docs/markdown/advanced-usage.zh-CN.md b/packages/vant/docs/markdown/advanced-usage.zh-CN.md
index 50ce21981..780eab1c9 100644
--- a/packages/vant/docs/markdown/advanced-usage.zh-CN.md
+++ b/packages/vant/docs/markdown/advanced-usage.zh-CN.md
@@ -92,9 +92,10 @@ export default {
data() {
return {
checked: true,
- activeIcon: 'https://cdn.jsdelivr.net/npm/@vant/assets/user-active.png',
+ activeIcon:
+ 'https://fastly.jsdelivr.net/npm/@vant/assets/user-active.png',
inactiveIcon:
- 'https://cdn.jsdelivr.net/npm/@vant/assets/user-inactive.png',
+ 'https://fastly.jsdelivr.net/npm/@vant/assets/user-inactive.png',
};
},
};
@@ -224,4 +225,4 @@ iPhone X 等机型底部存在底部指示条,指示条的操作区域与页
```
-
+
diff --git a/packages/vant/docs/markdown/design.en-US.md b/packages/vant/docs/markdown/design.en-US.md
index bd757fd2f..c4abbdaac 100644
--- a/packages/vant/docs/markdown/design.en-US.md
+++ b/packages/vant/docs/markdown/design.en-US.md
@@ -12,15 +12,15 @@ Contains color specifications, font specifications, and component design specifi
#### Colors
-
+
#### Fonts
-
+
#### Components
-
+
Download
@@ -28,13 +28,13 @@ Contains color specifications, font specifications, and component design specifi
Contains icon library resources.
-
+
Download
### Axure
-
+
Download
diff --git a/packages/vant/docs/markdown/design.zh-CN.md b/packages/vant/docs/markdown/design.zh-CN.md
index 651ff4c4b..2582c515a 100644
--- a/packages/vant/docs/markdown/design.zh-CN.md
+++ b/packages/vant/docs/markdown/design.zh-CN.md
@@ -12,15 +12,15 @@
#### 色彩规范
-
+
#### 字体规范
-
+
#### 组件规范
-
+
下载
@@ -28,7 +28,7 @@
包含 Sketch 格式的图标库资源。
-
+
下载
@@ -40,7 +40,7 @@ Vant 的所有图标都托管在 **iconfont.cn** 上,点此查看:[Vant 图
Axure 元件库,由社区的 [@axure-tczy](https://github.com/axure-tczy) 同学贡献。
-
+
下载
diff --git a/packages/vant/docs/markdown/home.en-US.md b/packages/vant/docs/markdown/home.en-US.md
index 630646bac..811989c14 100644
--- a/packages/vant/docs/markdown/home.en-US.md
+++ b/packages/vant/docs/markdown/home.en-US.md
@@ -1,6 +1,6 @@
-
+
Vant
Mobile UI Components built on Vue
@@ -39,7 +39,7 @@ 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-demo](https://github.com/youzan/vant-demo) | Collection of Vant demos |
+| [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 |
diff --git a/packages/vant/docs/markdown/home.zh-CN.md b/packages/vant/docs/markdown/home.zh-CN.md
index 2854bc303..26c4de8ad 100644
--- a/packages/vant/docs/markdown/home.zh-CN.md
+++ b/packages/vant/docs/markdown/home.zh-CN.md
@@ -1,6 +1,6 @@
-
+
Vant
轻量、可靠的移动端 Vue 组件库
@@ -51,7 +51,7 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
| 项目 | 描述 |
| --- | --- |
| [vant-weapp](https://github.com/youzan/vant-weapp) | Vant 微信小程序版 |
-| [vant-demo](https://github.com/youzan/vant-demo) | 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 的辅助库 |
diff --git a/packages/vant/docs/markdown/quickstart.en-US.md b/packages/vant/docs/markdown/quickstart.en-US.md
index 088ca21a3..efc877e92 100644
--- a/packages/vant/docs/markdown/quickstart.en-US.md
+++ b/packages/vant/docs/markdown/quickstart.en-US.md
@@ -32,12 +32,12 @@ The easiest way to use Vant is to include a CDN link in the html file, after whi
-
-
+
+
-
+
+