Skip to content

Commit 03b3ea5

Browse files
author
lishengzxc
committed
replace setTimeout with Vue.nextTick & add vue dependency
1 parent d415e02 commit 03b3ea5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,11 @@
263263
264264
visible(val) {
265265
if (val && this.$type === 'prompt') {
266-
setTimeout(() => {
266+
Vue.nextTick(() => {
267267
if (this.$els.input) {
268268
this.$els.input.focus();
269269
}
270-
}, 500);
270+
});
271271
}
272272
}
273273
},

0 commit comments

Comments
 (0)