diff --git a/package.json b/package.json index 2867cb0..8212e7c 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "webpack-dev-server": "^1.14.0" }, "dependencies": { + "vue": "^1.0.25", "vue-popup": "^0.1.8" } -} +} \ No newline at end of file diff --git a/src/msgbox.vue b/src/msgbox.vue index 1d610b5..574fd85 100644 --- a/src/msgbox.vue +++ b/src/msgbox.vue @@ -263,11 +263,11 @@ visible(val) { if (val && this.$type === 'prompt') { - setTimeout(() => { + Vue.nextTick(() => { if (this.$els.input) { this.$els.input.focus(); } - }, 500); + }); } } },