Skip to content

Commit 43c1edf

Browse files
author
lishengzxc
committed
remove unnecessary judgment & add vue dependency
1 parent d415e02 commit 43c1edf

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"webpack-dev-server": "^1.14.0"
4343
},
4444
"dependencies": {
45+
"vue": "^1.0.25",
4546
"vue-popup": "^0.1.8"
4647
}
47-
}
48+
}

src/msgbox.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,9 @@
263263
264264
visible(val) {
265265
if (val && this.$type === 'prompt') {
266-
setTimeout(() => {
267-
if (this.$els.input) {
268-
this.$els.input.focus();
269-
}
270-
}, 500);
266+
Vue.nextTick(() => {
267+
this.$els.input.focus();
268+
});
271269
}
272270
}
273271
},

0 commit comments

Comments
 (0)