Skip to content

Commit

Permalink
replace setTimeout with Vue.nextTick & add vue dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
lishengzxc committed Jun 23, 2016
1 parent d415e02 commit 03b3ea5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"webpack-dev-server": "^1.14.0"
},
"dependencies": {
"vue": "^1.0.25",
"vue-popup": "^0.1.8"
}
}
}
4 changes: 2 additions & 2 deletions src/msgbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@
visible(val) {
if (val && this.$type === 'prompt') {
setTimeout(() => {
Vue.nextTick(() => {
if (this.$els.input) {
this.$els.input.focus();
}
}, 500);
});
}
}
},
Expand Down

0 comments on commit 03b3ea5

Please sign in to comment.