From b35d295ad7a9c18740e76716a585fd78acc9bca0 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 19 Nov 2021 15:16:15 +0800 Subject: [PATCH 01/63] feat(Sidebar): add role, aria and tabindex for a11y (#9903) --- .../vant/src/sidebar-item/SidebarItem.tsx | 10 +- packages/vant/src/sidebar/Sidebar.tsx | 2 +- .../test/__snapshots__/demo.spec.ts.snap | 111 +++++++++++++----- .../test/__snapshots__/index.spec.tsx.snap | 12 +- .../test/__snapshots__/demo.spec.ts.snap | 94 +++++++++++---- .../test/__snapshots__/index.spec.tsx.snap | 28 +++-- 6 files changed, 192 insertions(+), 65 deletions(-) diff --git a/packages/vant/src/sidebar-item/SidebarItem.tsx b/packages/vant/src/sidebar-item/SidebarItem.tsx index 477389527..3faa0537b 100644 --- a/packages/vant/src/sidebar-item/SidebarItem.tsx +++ b/packages/vant/src/sidebar-item/SidebarItem.tsx @@ -57,11 +57,17 @@ export default defineComponent({ const selected = index.value === parent.getActive(); return ( - + ); }; }, diff --git a/packages/vant/src/sidebar/Sidebar.tsx b/packages/vant/src/sidebar/Sidebar.tsx index 833b7c649..47fb001bf 100644 --- a/packages/vant/src/sidebar/Sidebar.tsx +++ b/packages/vant/src/sidebar/Sidebar.tsx @@ -41,6 +41,6 @@ export default defineComponent({ setActive, }); - return () =>
{slots.default?.()}
; + return () =>
{slots.default?.()}
; }, }); diff --git a/packages/vant/src/sidebar/test/__snapshots__/demo.spec.ts.snap b/packages/vant/src/sidebar/test/__snapshots__/demo.spec.ts.snap index 6f3baf230..905f6f890 100644 --- a/packages/vant/src/sidebar/test/__snapshots__/demo.spec.ts.snap +++ b/packages/vant/src/sidebar/test/__snapshots__/demo.spec.ts.snap @@ -9,22 +9,36 @@ exports[`should render demo and match snapshot 1`] = `

Basic Usage

-
- +
@@ -35,30 +49,44 @@ exports[`should render demo and match snapshot 1`] = `

Show Badge

-
- +
@@ -69,22 +97,35 @@ exports[`should render demo and match snapshot 1`] = `

Disabled

-
- +
@@ -95,22 +136,36 @@ exports[`should render demo and match snapshot 1`] = `

Change Event

-
- +
diff --git a/packages/vant/src/sidebar/test/__snapshots__/index.spec.tsx.snap b/packages/vant/src/sidebar/test/__snapshots__/index.spec.tsx.snap index eec8e97bd..5048bfa07 100644 --- a/packages/vant/src/sidebar/test/__snapshots__/index.spec.tsx.snap +++ b/packages/vant/src/sidebar/test/__snapshots__/index.spec.tsx.snap @@ -1,11 +1,17 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`should render title slot correctly 1`] = ` -
- + `; diff --git a/packages/vant/src/tree-select/test/__snapshots__/demo.spec.ts.snap b/packages/vant/src/tree-select/test/__snapshots__/demo.spec.ts.snap index 01c358217..35bc23628 100644 --- a/packages/vant/src/tree-select/test/__snapshots__/demo.spec.ts.snap +++ b/packages/vant/src/tree-select/test/__snapshots__/demo.spec.ts.snap @@ -5,22 +5,35 @@ exports[`should render demo and match snapshot 1`] = `
-
- +
@@ -44,22 +57,35 @@ exports[`should render demo and match snapshot 1`] = `
-
- +
@@ -85,17 +111,27 @@ exports[`should render demo and match snapshot 1`] = `
-
- +
@@ -110,22 +146,32 @@ exports[`should render demo and match snapshot 1`] = `
-
- +
diff --git a/packages/vant/src/tree-select/test/__snapshots__/index.spec.tsx.snap b/packages/vant/src/tree-select/test/__snapshots__/index.spec.tsx.snap index d303ad1b6..1d4680079 100644 --- a/packages/vant/src/tree-select/test/__snapshots__/index.spec.tsx.snap +++ b/packages/vant/src/tree-select/test/__snapshots__/index.spec.tsx.snap @@ -12,12 +12,18 @@ exports[`should render content slot correctly 1`] = `
-
- +
Custom Content @@ -29,7 +35,9 @@ exports[`should render empty TreeSelect correctly 1`] = `
-
+
@@ -40,15 +48,21 @@ exports[`should render nav badge correctly 1`] = `
-
- +
From 880a075340be3199a5a4a92dcd6032f82a8cb2d2 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 19 Nov 2021 15:26:24 +0800 Subject: [PATCH 02/63] fix(Pagination): button tag missing type (#9904) --- packages/vant/src/pagination/Pagination.tsx | 3 + .../test/__snapshots__/demo.spec.ts.snap | 58 ++++++++++++------- .../test/__snapshots__/index.spec.ts.snap | 28 ++++----- 3 files changed, 53 insertions(+), 36 deletions(-) diff --git a/packages/vant/src/pagination/Pagination.tsx b/packages/vant/src/pagination/Pagination.tsx index daa33cf26..ebb41e022 100644 --- a/packages/vant/src/pagination/Pagination.tsx +++ b/packages/vant/src/pagination/Pagination.tsx @@ -133,6 +133,7 @@ export default defineComponent({ ]} >
  • -
  • -
  • -
  • -
  • -
  • -
  • @@ -51,7 +55,9 @@ exports[`should render demo and match snapshot 1`] = ` >
    • -
    • @@ -59,7 +65,7 @@ exports[`should render demo and match snapshot 1`] = ` 1/12
    • -
    • @@ -72,32 +78,36 @@ exports[`should render demo and match snapshot 1`] = ` >
      • -
      • -
      • -
      • -
      • -
      • -
      • @@ -110,38 +120,42 @@ exports[`should render demo and match snapshot 1`] = ` >
        • -
        • -
        • -
        • -
        • -
        • -
        • - diff --git a/packages/vant/src/pagination/test/__snapshots__/index.spec.ts.snap b/packages/vant/src/pagination/test/__snapshots__/index.spec.ts.snap index cdbd2a479..8aec2ce03 100644 --- a/packages/vant/src/pagination/test/__snapshots__/index.spec.ts.snap +++ b/packages/vant/src/pagination/test/__snapshots__/index.spec.ts.snap @@ -6,37 +6,37 @@ exports[`should render page slot correctly 1`] = ` >
          • -
          • -
          • -
          • -
          • -
          • -
          • -
          • @@ -50,37 +50,37 @@ exports[`should render prev-text、next-text slot correctly 1`] = ` >
            • -
            • -
            • -
            • -
            • -
            • -
            • -
            • From eb6e609a9320130716abd4da3f717e0a70e167d4 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 19 Nov 2021 15:37:41 +0800 Subject: [PATCH 03/63] feat(Uploader): add role, aria and tabindex for a11y (#9905) --- .../form/test/__snapshots__/demo.spec.ts.snap | 6 ++- .../vant/src/uploader/UploaderPreviewItem.tsx | 10 +++- .../test/__snapshots__/demo.spec.ts.snap | 48 ++++++++++++++--- .../test/__snapshots__/index.spec.ts.snap | 54 +++++++++++++++---- packages/vant/src/uploader/utils.ts | 4 +- 5 files changed, 100 insertions(+), 22 deletions(-) diff --git a/packages/vant/src/form/test/__snapshots__/demo.spec.ts.snap b/packages/vant/src/form/test/__snapshots__/demo.spec.ts.snap index b2072dc75..04062414c 100644 --- a/packages/vant/src/form/test/__snapshots__/demo.spec.ts.snap +++ b/packages/vant/src/form/test/__snapshots__/demo.spec.ts.snap @@ -459,7 +459,11 @@ exports[`should render demo and match snapshot 1`] = `
    -
    +
    diff --git a/packages/vant/src/uploader/UploaderPreviewItem.tsx b/packages/vant/src/uploader/UploaderPreviewItem.tsx index 26801d22b..0c5fe5692 100644 --- a/packages/vant/src/uploader/UploaderPreviewItem.tsx +++ b/packages/vant/src/uploader/UploaderPreviewItem.tsx @@ -1,7 +1,7 @@ import { PropType, defineComponent } from 'vue'; // Utils -import { bem, isImageFile } from './utils'; +import { t, bem, isImageFile } from './utils'; import { isDef, extend, @@ -71,7 +71,13 @@ export default defineComponent({ const renderDeleteIcon = () => { if (props.deletable && props.item.status !== 'uploading') { return ( -
    +
    ); diff --git a/packages/vant/src/uploader/test/__snapshots__/demo.spec.ts.snap b/packages/vant/src/uploader/test/__snapshots__/demo.spec.ts.snap index 4ac695728..17ec1bc81 100644 --- a/packages/vant/src/uploader/test/__snapshots__/demo.spec.ts.snap +++ b/packages/vant/src/uploader/test/__snapshots__/demo.spec.ts.snap @@ -29,7 +29,11 @@ exports[`should render demo and match snapshot 1`] = `
    -
    +
    @@ -45,7 +49,11 @@ exports[`should render demo and match snapshot 1`] = `
    -
    +
    @@ -114,7 +122,11 @@ exports[`should render demo and match snapshot 1`] = ` Failed
    -
    +
    @@ -144,7 +156,11 @@ exports[`should render demo and match snapshot 1`] = `
    -
    +
    @@ -175,7 +191,11 @@ exports[`should render demo and match snapshot 1`] = `
    -
    +
    @@ -234,7 +254,11 @@ exports[`should render demo and match snapshot 1`] = `
    -
    +
    @@ -305,7 +329,11 @@ exports[`should render demo and match snapshot 1`] = `
    -
    +
    @@ -323,7 +351,11 @@ exports[`should render demo and match snapshot 1`] = `
    -
    +
    diff --git a/packages/vant/src/uploader/test/__snapshots__/index.spec.ts.snap b/packages/vant/src/uploader/test/__snapshots__/index.spec.ts.snap index 27c162802..7db4ac44d 100644 --- a/packages/vant/src/uploader/test/__snapshots__/index.spec.ts.snap +++ b/packages/vant/src/uploader/test/__snapshots__/index.spec.ts.snap @@ -16,7 +16,11 @@ exports[`delete preview image 1`] = `
    -
    +
    @@ -61,7 +65,11 @@ exports[`disable preview image 2`] = ` test.jpg
    -
    +
    @@ -107,7 +115,11 @@ exports[`image-fit prop 1`] = `
    -
    +
    @@ -141,7 +153,11 @@ exports[`preview-cover slot 1`] = ` Custom Preview Cover
    -
    +
    @@ -160,7 +176,11 @@ exports[`preview-cover slot 1`] = ` Custom Preview Cover
    -
    +
    @@ -190,7 +210,11 @@ exports[`preview-size prop 1`] = ` test.jpg
    -
    +
    @@ -223,7 +247,11 @@ exports[`render preview image 1`] = `
    -
    +
    @@ -236,7 +264,11 @@ exports[`render preview image 1`] = ` https://img.yzcdn.cn/vant/test.pdf
    -
    +
    @@ -249,7 +281,11 @@ exports[`render preview image 1`] = ` test.jpg
    -
    +
    diff --git a/packages/vant/src/uploader/utils.ts b/packages/vant/src/uploader/utils.ts index c98876fca..35aa1db3a 100644 --- a/packages/vant/src/uploader/utils.ts +++ b/packages/vant/src/uploader/utils.ts @@ -5,9 +5,9 @@ import type { UploaderFileListItem, } from './types'; -const [name, bem] = createNamespace('uploader'); +const [name, bem, t] = createNamespace('uploader'); -export { name, bem }; +export { name, bem, t }; export const toArray = (item: T | T[]): T[] => Array.isArray(item) ? item : [item]; From 5126be92d8927203f76648bf14fc14ff240ecee4 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 19 Nov 2021 15:47:36 +0800 Subject: [PATCH 04/63] feat(CountDown): add timer role for a11y (#9906) --- packages/vant/src/count-down/CountDown.tsx | 2 +- .../test/__snapshots__/index.spec.tsx.snap | 20 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/vant/src/count-down/CountDown.tsx b/packages/vant/src/count-down/CountDown.tsx index 4e746a73f..7254d24fb 100644 --- a/packages/vant/src/count-down/CountDown.tsx +++ b/packages/vant/src/count-down/CountDown.tsx @@ -58,7 +58,7 @@ export default defineComponent({ }); return () => ( -
    +
    {slots.default ? slots.default(current.value) : timeText.value}
    ); diff --git a/packages/vant/src/count-down/test/__snapshots__/index.spec.tsx.snap b/packages/vant/src/count-down/test/__snapshots__/index.spec.tsx.snap index 6db98621a..1233e3fdd 100644 --- a/packages/vant/src/count-down/test/__snapshots__/index.spec.tsx.snap +++ b/packages/vant/src/count-down/test/__snapshots__/index.spec.tsx.snap @@ -1,31 +1,41 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`should format S milliseconds correctly 1`] = ` -
    +
    01-5
    `; exports[`should format SS milliseconds correctly 1`] = ` -
    +
    01-50
    `; exports[`should format complete time correctly 1`] = ` -
    +
    01-05-59-59-999
    `; exports[`should format incomplete time correctly 1`] = ` -
    +
    29-59-59-999
    `; exports[`should not start counting when auto-start prop is false 1`] = ` -
    +
    100
    `; From 9677f19f59f96ac06ce2126169508bb43a54da2d Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Fri, 19 Nov 2021 15:49:42 +0800 Subject: [PATCH 05/63] release: 3.3.0 --- packages/vant/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vant/package.json b/packages/vant/package.json index cd1019e13..f8beec912 100644 --- a/packages/vant/package.json +++ b/packages/vant/package.json @@ -1,6 +1,6 @@ { "name": "vant", - "version": "3.2.8", + "version": "3.3.0", "description": "Mobile UI Components built on Vue", "main": "lib/index.js", "module": "es/index.js", From 82c16d69b930088707d8c394f08b02e9de374c41 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Fri, 19 Nov 2021 16:19:25 +0800 Subject: [PATCH 06/63] docs(changelog): 3.3.0 --- .../site/desktop/components/Content.vue | 4 ++ .../vant/docs/markdown/changelog.en-US.md | 54 ++++++++++++++++-- .../vant/docs/markdown/changelog.zh-CN.md | 57 +++++++++++++++++-- 3 files changed, 103 insertions(+), 12 deletions(-) diff --git a/packages/vant-cli/site/desktop/components/Content.vue b/packages/vant-cli/site/desktop/components/Content.vue index bc1926a08..31d2af192 100644 --- a/packages/vant-cli/site/desktop/components/Content.vue +++ b/packages/vant-cli/site/desktop/components/Content.vue @@ -170,6 +170,10 @@ export default { } } + > ul { + margin: 12px 0; + } + > ul li, > ol li { position: relative; diff --git a/packages/vant/docs/markdown/changelog.en-US.md b/packages/vant/docs/markdown/changelog.en-US.md index 7c534c010..55a2e80f0 100644 --- a/packages/vant/docs/markdown/changelog.en-US.md +++ b/packages/vant/docs/markdown/changelog.en-US.md @@ -16,22 +16,64 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/). ## Details +### [v3.3.0](https://github.com/compare/v3.2.8...v3.3.0) + +`2021-11-19` + +**Accessibility** + +- Cascader: add role, aria and tabindex [#9886](https://github.com/youzan/vant/issues/9886) +- CountDown: add timer role [#9906](https://github.com/youzan/vant/issues/9906) +- DropdownMenu: add role, aria and tabindex [#9893](https://github.com/youzan/vant/issues/9893) +- Field: add aria-labelledby [#9883](https://github.com/youzan/vant/issues/9883) +- List: add role and tabindex [#9888](https://github.com/youzan/vant/issues/9888) +- Pagination: refactor DOM to improve a11y [#9901](https://github.com/youzan/vant/issues/9901) +- Popover: add tabindex and aria-disabled [#9889](https://github.com/youzan/vant/issues/9889) +- Rate: improve a11y when disabled or readonly [#9881](https://github.com/youzan/vant/issues/9881) +- Search: id prop add default value [#9884](https://github.com/youzan/vant/issues/9884) +- Sidebar: add role, aria and tabindex [#9903](https://github.com/youzan/vant/issues/9903) +- Slider: improve a11y when disabled or readonly [#9880](https://github.com/youzan/vant/issues/9880) +- Stepper: add aria-disabled [#9877](https://github.com/youzan/vant/issues/9877) +- Stepper: add group role [#9876](https://github.com/youzan/vant/issues/9876) +- Switch: add tabindex [#9887](https://github.com/youzan/vant/issues/9887) +- Tabbar: add role, aria and tabindex [#9895](https://github.com/youzan/vant/issues/9895) +- Tabs: add aria-controls [#9882](https://github.com/youzan/vant/issues/9882) +- Tabs: add aria-disabled [#9878](https://github.com/youzan/vant/issues/9878) +- Tabs: add aria-orientation and tabindex [#9872](https://github.com/youzan/vant/issues/9872) +- Uploader: add role, aria and tabindex [#9905](https://github.com/youzan/vant/issues/9905) +- remove tabindex from disabled elements [#9879](https://github.com/youzan/vant/issues/9879) + +**Feature** + +- Popup: reduce unused listener [#9896](https://github.com/youzan/vant/issues/9896) +- Field: expose sub-types of FieldRule [#9843](https://github.com/youzan/vant/issues/9843) +- minify svg icons [#9869](https://github.com/youzan/vant/issues/9869) + +**Bug Fixes** + +- Popover: useClickAway failed in SSR [#9899](https://github.com/youzan/vant/issues/9899) +- CouponList: incorrect list height [#9874](https://github.com/youzan/vant/issues/9874) +- Field: should not trigger validation after blurring readonly input [#9862](https://github.com/youzan/vant/issues/9862) +- Switch: switch node inherit font-size [#9842](https://github.com/youzan/vant/issues/9842) +- Tabbar: before-change not work in route mode [#9856](https://github.com/youzan/vant/issues/9856) +- Tabs: rename panel class to `van-tab__panel` [#9885](https://github.com/youzan/vant/issues/9885) + ### [v3.2.8](https://github.com/compare/v3.2.7...v3.2.8) `2021-11-09` **Feature** -- Cascader: add options-bottom slot [#9804](https://github.com/issues/9804) +- Cascader: add options-bottom slot [#9804](https://github.com/youzan/vant/issues/9804) - SubmitBar: add SubmitBarTextAlign type [f95567](https://github.com/commit/f95567ade758d453f4acad8a40d8ae717035476a) -- PasswordInput: add PasswordInputProps type [#9820](https://github.com/issues/9820) +- PasswordInput: add PasswordInputProps type [#9820](https://github.com/youzan/vant/issues/9820) **Bug Fixes** -- NavBar: fix NavBarProps spelling [#9818](https://github.com/issues/9818) -- Progress: incorrect border-radius [#9826](https://github.com/issues/9826) -- SubmitBar: fix missing SubmitBarProps export [#9819](https://github.com/issues/9819) -- Tabs: should emit click-tab after before-change [#9805](https://github.com/issues/9805) +- NavBar: fix NavBarProps spelling [#9818](https://github.com/youzan/vant/issues/9818) +- Progress: incorrect border-radius [#9826](https://github.com/youzan/vant/issues/9826) +- SubmitBar: fix missing SubmitBarProps export [#9819](https://github.com/youzan/vant/issues/9819) +- Tabs: should emit click-tab after before-change [#9805](https://github.com/youzan/vant/issues/9805) ### [v3.2.7](https://github.com/youzan/vant/compare/v3.2.6...v3.2.7) diff --git a/packages/vant/docs/markdown/changelog.zh-CN.md b/packages/vant/docs/markdown/changelog.zh-CN.md index 9da7fde78..7f7f41a1a 100644 --- a/packages/vant/docs/markdown/changelog.zh-CN.md +++ b/packages/vant/docs/markdown/changelog.zh-CN.md @@ -16,22 +16,67 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。 ## 更新内容 +### [v3.3.0](https://github.com/compare/v3.2.8...v3.3.0) + +`2021-11-19` + +**Accessibility** + +改善以下组件的无障碍访问体验: + +- Cascader: 增加 role="menu", tabindex, aria-checked, aria-disabled 属性 [#9886](https://github.com/youzan/vant/issues/9886) +- CountDown: 增加 role="timer" 属性 [#9906](https://github.com/youzan/vant/issues/9906) +- DropdownMenu: 增加 role="menu", tabindex, aria-labelledby 属性 [#9893](https://github.com/youzan/vant/issues/9893) +- Field: 增加 aria-labelledby 属性 [#9883](https://github.com/youzan/vant/issues/9883) +- List: 增加 role="button", tabindex 属性 [#9888](https://github.com/youzan/vant/issues/9888) +- Pagination: 增加 role="navigation" 和 button 标签 [#9901](https://github.com/youzan/vant/issues/9901) +- Popover: 增加 tabindex, aria-disabled 属性 [#9889](https://github.com/youzan/vant/issues/9889) +- Rate: 增加 aria-disabled, aria-readonly 属性 [#9881](https://github.com/youzan/vant/issues/9881) +- Search: 提供默认的 id 属性 属性 [#9884](https://github.com/youzan/vant/issues/9884) +- Sidebar: 增加 role="tab", tabindex, aria-selected 属性 [#9903](https://github.com/youzan/vant/issues/9903) +- Slider: 增加 aria-disabled, aria-readonly 属性 [#9880](https://github.com/youzan/vant/issues/9880) +- Stepper: 增加 aria-disabled 属性 [#9877](https://github.com/youzan/vant/issues/9877) +- Stepper: 增加 role="group" 属性 [#9876](https://github.com/youzan/vant/issues/9876) +- Switch: 增加 tabindex 属性 [#9887](https://github.com/youzan/vant/issues/9887) +- Tabbar: 增加 role="tab", tabindex, aria-selected 属性 [#9895](https://github.com/youzan/vant/issues/9895) +- Tabs: 增加 aria-controls 属性 [#9882](https://github.com/youzan/vant/issues/9882) +- Tabs: 增加 aria-disabled 属性 [#9878](https://github.com/youzan/vant/issues/9878) +- Tabs: 增加 tabindex, aria-orientation 属性 [#9872](https://github.com/youzan/vant/issues/9872) +- Uploader: 删除按钮增加 role="button", tabindex, aria-label 属性 [#9905](https://github.com/youzan/vant/issues/9905) +- 移除禁用元素的 tabindex 属性 [#9879](https://github.com/youzan/vant/issues/9879) + +**Feature** + +- Popup: 移除多余的 click 事件监听 [#9896](https://github.com/youzan/vant/issues/9896) +- Field: 导出 `FieldRuleValidator` 等多个类型定义 [#9843](https://github.com/youzan/vant/issues/9843) +- Empty: 压缩 svg 图标 [#9869](https://github.com/youzan/vant/issues/9869) +- NumberKeyboard: 压缩 svg 图标 [#9869](https://github.com/youzan/vant/issues/9869) +- Tabs: 将 `van-tab__pane` 类重命名为 `van-tab__panel` [#9885](https://github.com/youzan/vant/issues/9885) + +**Bug Fixes** + +- Popover: 修复 useClickAway 方法在 SSR 时报错的问题 [#9899](https://github.com/youzan/vant/issues/9899) +- CouponList: 修复列表高度不正确的问题 [#9874](https://github.com/youzan/vant/issues/9874) +- Field: 修复点击只读输入框会触发表单验证的问题 [#9862](https://github.com/youzan/vant/issues/9862) +- Switch: 修复全局设置 font-size 时样式错误的问题 [#9842](https://github.com/youzan/vant/issues/9842) +- Tabbar: 修复 route 模式下无法触发 before-change 属性的问题 [#9856](https://github.com/youzan/vant/issues/9856) + ### [v3.2.8](https://github.com/compare/v3.2.7...v3.2.8) `2021-11-09` **Feature** -- Cascader: 新增 options-bottom 插槽 [#9804](https://github.com/issues/9804) +- Cascader: 新增 options-bottom 插槽 [#9804](https://github.com/youzan/vant/issues/9804) - SubmitBar: 新增 SubmitBarTextAlign 类型 [f95567](https://github.com/commit/f95567ade758d453f4acad8a40d8ae717035476a) -- PasswordInput: 新增 PasswordInputProps 类型 [#9820](https://github.com/issues/9820) +- PasswordInput: 新增 PasswordInputProps 类型 [#9820](https://github.com/youzan/vant/issues/9820) **Bug Fixes** -- NavBar: 修复 NavBarProps 拼写错误的问题 [#9818](https://github.com/issues/9818) -- Progress: 修复圆角大小错误的问题 [#9826](https://github.com/issues/9826) -- SubmitBar: 修复未导出 SubmitBarProps 的问题 [#9819](https://github.com/issues/9819) -- Tabs: 修复 click-tab 触发顺序早于 before-change 的问题 [#9805](https://github.com/issues/9805) +- NavBar: 修复 NavBarProps 拼写错误的问题 [#9818](https://github.com/youzan/vant/issues/9818) +- Progress: 修复圆角大小错误的问题 [#9826](https://github.com/youzan/vant/issues/9826) +- SubmitBar: 修复未导出 SubmitBarProps 的问题 [#9819](https://github.com/youzan/vant/issues/9819) +- Tabs: 修复 click-tab 触发顺序早于 before-change 的问题 [#9805](https://github.com/youzan/vant/issues/9805) ### [v3.2.7](https://github.com/youzan/vant/compare/v3.2.6...v3.2.7) From 0a96f11bfafe98b493d39392b385cdd43f02daed Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 20 Nov 2021 21:43:32 +0800 Subject: [PATCH 07/63] docs: translate use-event-listener.md to en-US (#9908) --- .../docs/markdown/use-event-listener.en-US.md | 66 +++++++++++++++++++ .../docs/markdown/use-event-listener.zh-CN.md | 14 ++-- packages/vant/vant.config.mjs | 64 +++++++++--------- 3 files changed, 105 insertions(+), 39 deletions(-) create mode 100644 packages/vant/docs/markdown/use-event-listener.en-US.md diff --git a/packages/vant/docs/markdown/use-event-listener.en-US.md b/packages/vant/docs/markdown/use-event-listener.en-US.md new file mode 100644 index 000000000..b36e84808 --- /dev/null +++ b/packages/vant/docs/markdown/use-event-listener.en-US.md @@ -0,0 +1,66 @@ +# useEventListener + +### Intro + +Attaching an event when the component is `mounted` and `activated`, then removing the event when the component is `unmounted` and `deactivated`. + +## Usage + +### Basic Usage + +```js +import { ref } from 'vue'; +import { useEventListener } from '@vant/use'; + +export default { + setup() { + // attach the resize event to window + useEventListener('resize', () => { + console.log('window resize'); + }); + + // attach the click event to the body element + useEventListener( + 'click', + () => { + console.log('click body'); + }, + { target: document.body } + ); + }, +}; +``` + +## API + +### Type Declarations + +```ts +type Options = { + target?: EventTarget | Ref; + capture?: boolean; + passive?: boolean; +}; + +function useEventListener( + type: string, + listener: EventListener, + options?: Options +): void; +``` + +### Params + +| Name | Description | Type | Default Value | +| -------- | ----------------- | --------------- | ------------- | +| type | Event type | _string_ | - | +| listener | Callback function | _EventListener_ | - | +| options | Options | _Options_ | - | + +### Options + +| Name | Description | Type | Default Value | +| --- | --- | --- | --- | +| target | Target element | _EventTarget \| Ref\_ | `window` | +| capture | Whether to enable capture | _boolean_ | `false` | +| passive | if true, indicates that the listener will never call `preventDefault()` | _boolean_ | `false` | diff --git a/packages/vant/docs/markdown/use-event-listener.zh-CN.md b/packages/vant/docs/markdown/use-event-listener.zh-CN.md index cb6b0e9ce..a8fe6a6df 100644 --- a/packages/vant/docs/markdown/use-event-listener.zh-CN.md +++ b/packages/vant/docs/markdown/use-event-listener.zh-CN.md @@ -32,6 +32,8 @@ export default { }; ``` +## API + ### 类型定义 ```ts @@ -48,15 +50,13 @@ function useEventListener( ): void; ``` -## API - ### 参数 -| 参数 | 说明 | 类型 | 默认值 | -| -------- | ------------------------ | --------------- | ------ | -| type | 监听的事件类型 | _string_ | - | -| listener | 点击外部时触发的回调函数 | _EventListener_ | - | -| options | 可选的配置项 | _Options_ | - | +| 参数 | 说明 | 类型 | 默认值 | +| -------- | -------------- | --------------- | ------ | +| type | 监听的事件类型 | _string_ | - | +| listener | 事件回调函数 | _EventListener_ | - | +| options | 可选的配置项 | _Options_ | - | ### Options diff --git a/packages/vant/vant.config.mjs b/packages/vant/vant.config.mjs index 92a437cf3..231c274ec 100644 --- a/packages/vant/vant.config.mjs +++ b/packages/vant/vant.config.mjs @@ -421,8 +421,8 @@ export default { title: '介绍', }, { - path: 'use-toggle', - title: 'useToggle', + path: 'use-click-away', + title: 'useClickAway', }, { path: 'use-count-down', @@ -432,10 +432,6 @@ export default { path: 'use-custom-field-value', title: 'useCustomFieldValue', }, - { - path: 'use-rect', - title: 'useRect', - }, { path: 'use-event-listener', title: 'useEventListener', @@ -445,20 +441,24 @@ export default { title: 'usePageVisibility', }, { - path: 'use-scroll-parent', - title: 'useScrollParent', - }, - { - path: 'use-window-size', - title: 'useWindowSize', + path: 'use-rect', + title: 'useRect', }, { path: 'use-relation', title: 'useRelation', }, { - path: 'use-click-away', - title: 'useClickAway', + path: 'use-scroll-parent', + title: 'useScrollParent', + }, + { + path: 'use-toggle', + title: 'useToggle', + }, + { + path: 'use-window-size', + title: 'useWindowSize', }, ], }, @@ -835,8 +835,8 @@ export default { title: 'Intro', }, { - path: 'use-toggle', - title: 'useToggle', + path: 'use-click-away', + title: 'useClickAway', }, { path: 'use-count-down', @@ -846,33 +846,33 @@ export default { path: 'use-custom-field-value', title: 'useCustomFieldValue', }, - // { - // path: 'use-rect', - // title: 'useRect', - // }, - // { - // path: 'use-event-listener', - // title: 'useEventListener', - // }, + { + path: 'use-event-listener', + title: 'useEventListener', + }, // { // path: 'use-page-visibility', // title: 'usePageVisibility', // }, // { - // path: 'use-scroll-parent', - // title: 'useScrollParent', - // }, - // { - // path: 'use-window-size', - // title: 'useWindowSize', + // path: 'use-rect', + // title: 'useRect', // }, // { // path: 'use-relation', // title: 'useRelation', // }, // { - // path: 'use-click-away', - // title: 'useClickAway', + // path: 'use-scroll-parent', + // title: 'useScrollParent', + // }, + { + path: 'use-toggle', + title: 'useToggle', + }, + // { + // path: 'use-window-size', + // title: 'useWindowSize', // }, ], }, From 4335bae975cbbf77f806027e6b3216df60fd84ff Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 20 Nov 2021 21:52:39 +0800 Subject: [PATCH 08/63] docs: add Accessibility to readme (#9909) --- README.md | 1 + README.zh-CN.md | 1 + packages/vant/docs/markdown/home.en-US.md | 1 + packages/vant/docs/markdown/home.zh-CN.md | 1 + 4 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 1c310d914..96f186fc5 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ - 🍭 Support Vue 2 & Vue 3 - 🍭 Support Tree Shaking - 🍭 Support Custom Theme +- 🍭 Support Accessibility (still improving) - 🍭 Support i18n - 🌍 Support SSR diff --git a/README.zh-CN.md b/README.zh-CN.md index fd07f8e92..5d66381bc 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -40,6 +40,7 @@ Vant 是**有赞前端团队**开源的移动端组件库,于 2017 年开源 - 🍭 支持 Vue 2、Vue 3 和微信小程序 - 🍭 支持主题定制,内置 700+ 个主题变量 - 🍭 支持按需引入和 Tree Shaking +- 🍭 支持无障碍访问(持续改进中) - 🍭 支持服务器端渲染 - 🌍 支持国际化和语言包定制 diff --git a/packages/vant/docs/markdown/home.en-US.md b/packages/vant/docs/markdown/home.en-US.md index d5a860695..a4cbbc416 100644 --- a/packages/vant/docs/markdown/home.en-US.md +++ b/packages/vant/docs/markdown/home.en-US.md @@ -17,6 +17,7 @@ - 🍭 Support Vue 2 & Vue 3 - 🍭 Support Tree Shaking - 🍭 Support Custom Theme +- 🍭 Support Accessibility (still improving) - 🍭 Support i18n - 🌍 Support SSR diff --git a/packages/vant/docs/markdown/home.zh-CN.md b/packages/vant/docs/markdown/home.zh-CN.md index e92e2e47f..e9c40a927 100644 --- a/packages/vant/docs/markdown/home.zh-CN.md +++ b/packages/vant/docs/markdown/home.zh-CN.md @@ -27,6 +27,7 @@ Vant 是**有赞前端团队**开源的移动端组件库,于 2017 年开源 - 🍭 支持 Vue 2、Vue 3 和微信小程序 - 🍭 支持主题定制,内置 700+ 个主题变量 - 🍭 支持按需引入和 Tree Shaking +- 🍭 支持无障碍访问(持续改进中) - 🍭 支持服务器端渲染 - 🌍 支持国际化和语言包定制 From e12be89d7cc937d24e1a7d45234d6cd157651a5f Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 20 Nov 2021 22:47:04 +0800 Subject: [PATCH 09/63] docs: add contributors (#9910) --- README.md | 24 +++++++++++++--- README.zh-CN.md | 28 +++++++++++++++---- packages/vant/docs/markdown/home.en-US.md | 30 ++++++++++++++++---- packages/vant/docs/markdown/home.zh-CN.md | 34 ++++++++++++++++++----- 4 files changed, 94 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 96f186fc5..f6e51db73 100644 --- a/README.md +++ b/README.md @@ -75,10 +75,6 @@ app.use(Button); See more in [Quickstart](https://youzan.github.io/vant#/en-US/quickstart). -## Contribution - -Please make sure to read the [Contributing Guide](./.github/CONTRIBUTING.md) before making a pull request. - ## Browser Support Vant 2 supports modern browsers and Android >= 4.0、iOS >= 8.0. @@ -118,6 +114,26 @@ You can scan the following QR code to access the demo: +## Core Team + +Core contributors of Vant and Vant Weapp: + +| [![chenjiahan](https://avatars.githubusercontent.com/u/7237365?s=80&v=4)](https://github.com/chenjiahan/) | [![cookfront](https://avatars.githubusercontent.com/u/4829465?s=80&v=4)](https://github.com/cookfront/) | [![w91](https://avatars.githubusercontent.com/u/2599455?s=80&v=4)](https://github.com/w91/) | [![pangxie1991](https://avatars.githubusercontent.com/u/5961240?s=80&v=4)](https://github.com/pangxie1991/) | [![rex-zsd](https://avatars.githubusercontent.com/u/8767877?s=80&v=4)](https://github.com/rex-zsd/) | [![nemo-shen](https://avatars.githubusercontent.com/u/13480805?s=80&v=4)](https://github.com/nemo-shen/) | [![Lindysen](https://avatars.githubusercontent.com/u/33708359?s=80&v=4)](https://github.com/Lindysen/) | [![nemo-shen](https://avatars.githubusercontent.com/u/16181940?s=80&v=4)](https://github.com/JakeLaoyu/) | +| :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | +| [chenjiahan](https://github.com/chenjiahan/) | [cookfront](https://github.com/cookfront/) | [wangnaiyi](https://github.com/w91/) | [pangxie](https://github.com/pangxie1991/) | [rex-zsd](https://github.com/rex-zsd/) | [nemo-shen](https://github.com/nemo-shen/) | [Lindysen](https://github.com/Lindysen/) | [JakeLaoyu](https://github.com/JakeLaoyu/) | + +## All Contributors + +Thanks to the following friends for their contributions to Vant: + + + contributors + + +## Contribution Guide + +Please make sure to read the [Contributing Guide](./.github/CONTRIBUTING.md) before making a pull request. + ## LICENSE [MIT](https://en.wikipedia.org/wiki/MIT_License) diff --git a/README.zh-CN.md b/README.zh-CN.md index 5d66381bc..03f6f2285 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -79,12 +79,6 @@ app.use(Button); vant 也支持按需引入、CDN 引入等方式,详细说明见 [快速上手](https://vant-contrib.gitee.io/vant#/zh-CN/quickstart). -## 贡献代码 - -修改代码请阅读我们的 [贡献指南](https://vant-contrib.gitee.io/vant/#/zh-CN/contribution)。 - -使用过程中发现任何问题都可以提 [Issue](https://github.com/youzan/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/youzan/vant/pulls)。 - ## 浏览器支持 Vant 2 支持现代浏览器以及 Android >= 4.0、iOS >= 8.0。 @@ -128,6 +122,28 @@ Vant 3 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一致 +## 核心团队 + +以下是 Vant 和 Vant Weapp 的核心贡献者们: + +| [![chenjiahan](https://avatars.githubusercontent.com/u/7237365?s=80&v=4)](https://github.com/chenjiahan/) | [![cookfront](https://avatars.githubusercontent.com/u/4829465?s=80&v=4)](https://github.com/cookfront/) | [![w91](https://avatars.githubusercontent.com/u/2599455?s=80&v=4)](https://github.com/w91/) | [![pangxie1991](https://avatars.githubusercontent.com/u/5961240?s=80&v=4)](https://github.com/pangxie1991/) | [![rex-zsd](https://avatars.githubusercontent.com/u/8767877?s=80&v=4)](https://github.com/rex-zsd/) | [![nemo-shen](https://avatars.githubusercontent.com/u/13480805?s=80&v=4)](https://github.com/nemo-shen/) | [![Lindysen](https://avatars.githubusercontent.com/u/33708359?s=80&v=4)](https://github.com/Lindysen/) | [![nemo-shen](https://avatars.githubusercontent.com/u/16181940?s=80&v=4)](https://github.com/JakeLaoyu/) | +| :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | +| [chenjiahan](https://github.com/chenjiahan/) | [cookfront](https://github.com/cookfront/) | [wangnaiyi](https://github.com/w91/) | [pangxie](https://github.com/pangxie1991/) | [rex-zsd](https://github.com/rex-zsd/) | [nemo-shen](https://github.com/nemo-shen/) | [Lindysen](https://github.com/Lindysen/) | [JakeLaoyu](https://github.com/JakeLaoyu/) | + +## 贡献者们 + +感谢以下小伙伴们为 Vant 发展做出的贡献: + + + contributors + + +## 贡献指南 + +修改代码请阅读我们的 [贡献指南](https://vant-contrib.gitee.io/vant/#/zh-CN/contribution)。 + +使用过程中发现任何问题都可以提 [Issue](https://github.com/youzan/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/youzan/vant/pulls)。 + ## 开源协议 本项目基于 [MIT](https://zh.wikipedia.org/wiki/MIT%E8%A8%B1%E5%8F%AF%E8%AD%89) 协议,请自由地享受和参与开源。 diff --git a/packages/vant/docs/markdown/home.en-US.md b/packages/vant/docs/markdown/home.en-US.md index a4cbbc416..36e907c5a 100644 --- a/packages/vant/docs/markdown/home.en-US.md +++ b/packages/vant/docs/markdown/home.en-US.md @@ -25,16 +25,14 @@ See in [Quickstart](#/en-US/quickstart). -### Contribution - -Please make sure to read the [Contributing Guide](https://github.com/youzan/vant/blob/dev/.github/CONTRIBUTING.md) before making a pull request. - ### Browser Support Vant 2 supports modern browsers and Android >= 4.0、iOS >= 8.0. Vant 3 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3). +## Links + ### Official Ecosystem | Project | Description | @@ -56,12 +54,34 @@ Vant 3 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3). | [vant-theme](https://github.com/Aisen60/vant-theme) | Online theme preview built on Vant UI | | [@antmjs/vantui](https://github.com/antmjs/vantui) | Mobile UI Components based on Vant, supporting Taro and React | -### Links +### Other Links - [Feedback](https://github.com/youzan/vant/issues) - [Changelog](#/en-US/changelog) - [Gitter](https://gitter.im/vant-contrib/discuss?utm_source=share-link&utm_medium=link&utm_campaign=share-link) +## Contribution + +### Core Team + +Core contributors of Vant and Vant Weapp: + +| [![chenjiahan](https://avatars.githubusercontent.com/u/7237365?s=80&v=4)](https://github.com/chenjiahan/) | [![cookfront](https://avatars.githubusercontent.com/u/4829465?s=80&v=4)](https://github.com/cookfront/) | [![w91](https://avatars.githubusercontent.com/u/2599455?s=80&v=4)](https://github.com/w91/) | [![pangxie1991](https://avatars.githubusercontent.com/u/5961240?s=80&v=4)](https://github.com/pangxie1991/) | [![rex-zsd](https://avatars.githubusercontent.com/u/8767877?s=80&v=4)](https://github.com/rex-zsd/) | [![nemo-shen](https://avatars.githubusercontent.com/u/13480805?s=80&v=4)](https://github.com/nemo-shen/) | [![Lindysen](https://avatars.githubusercontent.com/u/33708359?s=80&v=4)](https://github.com/Lindysen/) | [![nemo-shen](https://avatars.githubusercontent.com/u/16181940?s=80&v=4)](https://github.com/JakeLaoyu/) | +| :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | +| [chenjiahan](https://github.com/chenjiahan/) | [cookfront](https://github.com/cookfront/) | [wangnaiyi](https://github.com/w91/) | [pangxie](https://github.com/pangxie1991/) | [rex-zsd](https://github.com/rex-zsd/) | [nemo-shen](https://github.com/nemo-shen/) | [Lindysen](https://github.com/Lindysen/) | [JakeLaoyu](https://github.com/JakeLaoyu/) | + +### All Contributors + +Thanks to the following friends for their contributions to Vant: + + + contributors + + +### 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. + ### LICENSE [MIT](https://zh.wikipedia.org/wiki/MIT%E8%A8%B1%E5%8F%AF%E8%AD%89) diff --git a/packages/vant/docs/markdown/home.zh-CN.md b/packages/vant/docs/markdown/home.zh-CN.md index e9c40a927..5748fb7e0 100644 --- a/packages/vant/docs/markdown/home.zh-CN.md +++ b/packages/vant/docs/markdown/home.zh-CN.md @@ -35,18 +35,14 @@ Vant 是**有赞前端团队**开源的移动端组件库,于 2017 年开源 请阅读[快速上手](#/zh-CN/quickstart)章节,通过该章节你可以了解到 Vant 的安装方法和基本使用姿势。 -### 贡献代码 - -贡献代码请阅读我们的[贡献指南](#/zh-CN/contribution)。 - -使用过程中发现任何问题都可以提 [Issue](https://github.com/youzan/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/youzan/vant/pulls)。 - ### 浏览器支持 Vant 2 支持现代浏览器以及 Android >= 4.0、iOS >= 8.0。 Vant 3 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一致)。 +## 链接 + ### 官方生态 由 Vant 官方团队维护的项目如下: @@ -72,13 +68,37 @@ Vant 3 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一致 | [vant-theme](https://github.com/Aisen60/vant-theme) | Vant 在线主题预览工具 | | [@antmjs/vantui](https://github.com/antmjs/vantui) | 基于 Vant Weapp 开发的多端组件库,同时支持 Taro 和 React | -### 链接 +### 其他链接 - [意见反馈](https://github.com/youzan/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) +## 贡献 + +### 核心团队 + +以下是 Vant 和 Vant Weapp 的核心贡献者们: + +| [![chenjiahan](https://avatars.githubusercontent.com/u/7237365?s=80&v=4)](https://github.com/chenjiahan/) | [![cookfront](https://avatars.githubusercontent.com/u/4829465?s=80&v=4)](https://github.com/cookfront/) | [![w91](https://avatars.githubusercontent.com/u/2599455?s=80&v=4)](https://github.com/w91/) | [![pangxie1991](https://avatars.githubusercontent.com/u/5961240?s=80&v=4)](https://github.com/pangxie1991/) | [![rex-zsd](https://avatars.githubusercontent.com/u/8767877?s=80&v=4)](https://github.com/rex-zsd/) | [![nemo-shen](https://avatars.githubusercontent.com/u/13480805?s=80&v=4)](https://github.com/nemo-shen/) | [![Lindysen](https://avatars.githubusercontent.com/u/33708359?s=80&v=4)](https://github.com/Lindysen/) | [![nemo-shen](https://avatars.githubusercontent.com/u/16181940?s=80&v=4)](https://github.com/JakeLaoyu/) | +| :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | +| [chenjiahan](https://github.com/chenjiahan/) | [cookfront](https://github.com/cookfront/) | [wangnaiyi](https://github.com/w91/) | [pangxie](https://github.com/pangxie1991/) | [rex-zsd](https://github.com/rex-zsd/) | [nemo-shen](https://github.com/nemo-shen/) | [Lindysen](https://github.com/Lindysen/) | [JakeLaoyu](https://github.com/JakeLaoyu/) | + +### 贡献者们 + +感谢以下小伙伴们为 Vant 发展做出的贡献: + + + contributors + + +### 贡献指南 + +贡献代码请阅读我们的[贡献指南](#/zh-CN/contribution)。 + +使用过程中发现任何问题都可以提 [Issue](https://github.com/youzan/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/youzan/vant/pulls)。 + ### 开源协议 本项目基于 [MIT](https://zh.wikipedia.org/wiki/MIT%E8%A8%B1%E5%8F%AF%E8%AD%89) 协议,请自由地享受和参与开源 From 2e7fafeba0179e4e0d80dcb5666a3e0a073b562d Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 23 Nov 2021 10:14:54 +0800 Subject: [PATCH 10/63] chore: extends base tsconfig (#9912) --- packages/create-vant-cli-app/tsconfig.json | 7 ++----- packages/vant-area-data/tsconfig.json | 8 ++------ packages/vant-cli/tsconfig.json | 9 ++------- packages/vant-markdown-vetur/tsconfig.json | 7 ++----- packages/vant-popperjs/tsconfig.json | 8 ++------ packages/vant-use/tsconfig.json | 8 ++------ packages/vant/tsconfig.json | 11 ++--------- tsconfig.json | 13 +++++++++++++ 8 files changed, 27 insertions(+), 44 deletions(-) create mode 100644 tsconfig.json diff --git a/packages/create-vant-cli-app/tsconfig.json b/packages/create-vant-cli-app/tsconfig.json index d40c806f7..738ecb181 100644 --- a/packages/create-vant-cli-app/tsconfig.json +++ b/packages/create-vant-cli-app/tsconfig.json @@ -1,13 +1,10 @@ { + "extends": "../../tsconfig", "compilerOptions": { "target": "ES2019", "outDir": "./lib", "module": "commonjs", - "strict": true, - "declaration": true, - "skipLibCheck": true, - "esModuleInterop": true, - "lib": ["esnext"] + "declaration": true }, "include": ["src/**/*"] } diff --git a/packages/vant-area-data/tsconfig.json b/packages/vant-area-data/tsconfig.json index 69369e785..12b1beb8b 100644 --- a/packages/vant-area-data/tsconfig.json +++ b/packages/vant-area-data/tsconfig.json @@ -1,13 +1,9 @@ { + "extends": "../../tsconfig", "compilerOptions": { "target": "ES2019", "outDir": "./lib", - "module": "ES2015", - "strict": true, - "declaration": true, - "skipLibCheck": true, - "esModuleInterop": true, - "lib": ["esnext"] + "declaration": true }, "include": ["src/**/*"] } diff --git a/packages/vant-cli/tsconfig.json b/packages/vant-cli/tsconfig.json index 3bfcc20c0..12b1beb8b 100644 --- a/packages/vant-cli/tsconfig.json +++ b/packages/vant-cli/tsconfig.json @@ -1,14 +1,9 @@ { + "extends": "../../tsconfig", "compilerOptions": { "target": "ES2019", "outDir": "./lib", - "module": "ESNext", - "strict": true, - "declaration": true, - "skipLibCheck": true, - "esModuleInterop": true, - "moduleResolution":"Node", - "lib": ["esnext", "dom"] + "declaration": true }, "include": ["src/**/*"] } diff --git a/packages/vant-markdown-vetur/tsconfig.json b/packages/vant-markdown-vetur/tsconfig.json index d40c806f7..738ecb181 100644 --- a/packages/vant-markdown-vetur/tsconfig.json +++ b/packages/vant-markdown-vetur/tsconfig.json @@ -1,13 +1,10 @@ { + "extends": "../../tsconfig", "compilerOptions": { "target": "ES2019", "outDir": "./lib", "module": "commonjs", - "strict": true, - "declaration": true, - "skipLibCheck": true, - "esModuleInterop": true, - "lib": ["esnext"] + "declaration": true }, "include": ["src/**/*"] } diff --git a/packages/vant-popperjs/tsconfig.json b/packages/vant-popperjs/tsconfig.json index ac6b07b09..04da53d75 100644 --- a/packages/vant-popperjs/tsconfig.json +++ b/packages/vant-popperjs/tsconfig.json @@ -1,12 +1,8 @@ { + "extends": "../../tsconfig", "compilerOptions": { - "target": "ES2015", "outDir": "./dist", - "module": "ESNext", - "strict": true, - "declaration": true, - "skipLibCheck": true, - "moduleResolution": "Node", + "declaration": true }, "include": ["src/**/*"] } diff --git a/packages/vant-use/tsconfig.json b/packages/vant-use/tsconfig.json index ac6b07b09..04da53d75 100644 --- a/packages/vant-use/tsconfig.json +++ b/packages/vant-use/tsconfig.json @@ -1,12 +1,8 @@ { + "extends": "../../tsconfig", "compilerOptions": { - "target": "ES2015", "outDir": "./dist", - "module": "ESNext", - "strict": true, - "declaration": true, - "skipLibCheck": true, - "moduleResolution": "Node", + "declaration": true }, "include": ["src/**/*"] } diff --git a/packages/vant/tsconfig.json b/packages/vant/tsconfig.json index b21270cc4..11326058e 100644 --- a/packages/vant/tsconfig.json +++ b/packages/vant/tsconfig.json @@ -1,15 +1,8 @@ { + "extends": "../../tsconfig", "compilerOptions": { - "baseUrl": ".", - "jsx": "preserve", - "target": "ES2015", - "module": "ES2015", - "strict": true, "allowJs": true, - "skipLibCheck": true, - "noImplicitThis": true, - "esModuleInterop": true, - "moduleResolution": "node" + "noImplicitThis": true }, "include": ["src/**/*", "docs/**/*", "test/**/*"] } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..923de7527 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "jsx": "preserve", + "strict": true, + "target": "ES2015", + "module": "ESNext", + "skipLibCheck": true, + "esModuleInterop": true, + "moduleResolution": "Node", + "lib": ["esnext", "dom"] + } +} From d31304c0c5ffb2cc46b2a3b9cfda236d0f043edc Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 23 Nov 2021 20:26:15 +0800 Subject: [PATCH 11/63] fix(AddressEdit): should not emit save event when validation failed (#9917) --- packages/vant/src/address-edit/AddressEdit.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/vant/src/address-edit/AddressEdit.tsx b/packages/vant/src/address-edit/AddressEdit.tsx index 69229bfb2..4842c4a01 100644 --- a/packages/vant/src/address-edit/AddressEdit.tsx +++ b/packages/vant/src/address-edit/AddressEdit.tsx @@ -351,7 +351,6 @@ export default defineComponent({ class={bem('button')} loading={props.isSaving} nativeType="submit" - onClick={onSave} /> {props.showDelete && (