feat(Dialog): add new prop theme (#6921)

* feat(dialog): add new prop button-theme & change default confirm button text color

* test(dialog): update snapshot

* refactor(dialog): rename button-theme to theme

* refactor(dialog): add theme definition

* docs(dialog): add version tip & change default confirm-button-color
This commit is contained in:
rex
2020-08-03 21:02:14 +08:00
committed by GitHub
parent 39c6637894
commit 26c754e2f6
9 changed files with 131 additions and 6 deletions
+25
View File
@@ -9,6 +9,15 @@
</van-button>
</demo-block>
<demo-block :title="t('round')">
<van-button type="primary" @click="onClickRound">
{{ t('alert1') }}
</van-button>
<van-button type="primary" @click="onClickRound2">
{{ t('alert2') }}
</van-button>
</demo-block>
<demo-block :title="t('confirm')">
<van-button type="primary" @click="onClickConfirm">
{{ t('confirm') }}
@@ -43,6 +52,7 @@ export default {
'zh-CN': {
alert1: '提示弹窗',
alert2: '提示弹窗(无标题)',
round: '圆角样式',
confirm: '确认弹窗',
asyncClose: '异步关闭',
componentCall: '组件调用',
@@ -79,6 +89,21 @@ export default {
});
},
onClickRound() {
this.$dialog.alert({
theme: 'round',
title: this.t('title'),
message: this.t('content'),
});
},
onClickRound2() {
this.$dialog.alert({
theme: 'round',
message: this.t('content'),
});
},
onClickConfirm() {
this.$dialog.confirm({
title: this.t('title'),