diff --git a/packages/vant/src/button/README.md b/packages/vant/src/button/README.md index d0613e80b..8af1334c0 100644 --- a/packages/vant/src/button/README.md +++ b/packages/vant/src/button/README.md @@ -109,6 +109,30 @@ app.use(Button); ``` +### Animated Button + +```html + + + Do Task + Lottery + + + + +``` + ## API ### Props diff --git a/packages/vant/src/button/README.zh-CN.md b/packages/vant/src/button/README.zh-CN.md index c043350a6..b5884d886 100644 --- a/packages/vant/src/button/README.zh-CN.md +++ b/packages/vant/src/button/README.zh-CN.md @@ -131,6 +131,32 @@ app.use(Button); ``` +### 动画按钮 + +搭配 Button 和 Swipe 组件,可以实现垂直滚动的动画按钮效果。 + +```html + + + 做任务 + 抽大奖 + + + + +``` + ## API ### Props diff --git a/packages/vant/src/button/demo/index.vue b/packages/vant/src/button/demo/index.vue index 12646da33..304dc2582 100644 --- a/packages/vant/src/button/demo/index.vue +++ b/packages/vant/src/button/demo/index.vue @@ -1,5 +1,7 @@ @@ -140,6 +148,21 @@ const t = useTranslate({ :text="t('gradient')" /> + + + + + {{ t('doTask') }} + {{ t('lottery') }} + + + diff --git a/packages/vant/src/button/test/__snapshots__/demo-ssr.spec.ts.snap b/packages/vant/src/button/test/__snapshots__/demo-ssr.spec.ts.snap index 1b44259cb..eeb36e2ab 100644 --- a/packages/vant/src/button/test/__snapshots__/demo-ssr.spec.ts.snap +++ b/packages/vant/src/button/test/__snapshots__/demo-ssr.spec.ts.snap @@ -420,4 +420,36 @@ exports[`should render demo and match snapshot 1`] = ` +
+ + +
`; diff --git a/packages/vant/src/button/test/__snapshots__/demo.spec.ts.snap b/packages/vant/src/button/test/__snapshots__/demo.spec.ts.snap index 0967a18c3..55156b822 100644 --- a/packages/vant/src/button/test/__snapshots__/demo.spec.ts.snap +++ b/packages/vant/src/button/test/__snapshots__/demo.spec.ts.snap @@ -356,4 +356,30 @@ exports[`should render demo and match snapshot 1`] = ` +
+ +
`;