Skip to content

Commit

Permalink
fix: fix Popconfirm i18n bug
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkun authored and BANKA2017 committed Mar 16, 2021
1 parent 1e71c47 commit bed5cd1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/popconfirm/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
:type="cancelButtonType"
@click="cancel"
>
{{cancelButtonText}}
{{ displayCancelButtonText }}
</el-button>
<el-button
size="mini"
:type="confirmButtonType"
@click="confirm"
>
{{confirmButtonText}}
{{ displayConfirmButtonText }}
</el-button>
</div>
</div>
Expand All @@ -47,12 +47,10 @@ export default {
type: String
},
confirmButtonText: {
type: String,
default: t('el.popconfirm.confirmButtonText')
type: String
},
cancelButtonText: {
type: String,
default: t('el.popconfirm.cancelButtonText')
type: String
},
confirmButtonType: {
type: String,
Expand Down Expand Up @@ -84,6 +82,14 @@ export default {
visible: false
};
},
computed: {
displayConfirmButtonText() {
return this.confirmButtonText || t('el.popconfirm.confirmButtonText')
},
displayCancelButtonText() {
return this.cancelButtonText || t('el.popconfirm.cancelButtonText')
}
},
methods: {
confirm() {
this.visible = false;
Expand Down

0 comments on commit bed5cd1

Please sign in to comment.