diff --git a/packages/message-box/src/main.vue b/packages/message-box/src/main.vue index fe53793ac..1ce126d0e 100644 --- a/packages/message-box/src/main.vue +++ b/packages/message-box/src/main.vue @@ -16,7 +16,7 @@
{{ cancelButtonText }} - {{ confirmButtonText }} + {{ confirmButtonText }}
@@ -146,6 +146,11 @@ }, value(val) { + if (this.$type === 'alert' || this.$type === 'confirm') { + this.$nextTick(() => { + this.$refs.confirm.$el.focus(); + }); + } if (this.$type !== 'prompt') return; if (val) { setTimeout(() => {