Skip to content

Commit

Permalink
tweak select IE fix to reduce duplicate call
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Oct 11, 2016
1 parent f9bef75 commit 5925ad3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/platforms/web/runtime/directives/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if (isIE9) {
}

export default {
bind (el, binding, vnode) {
inserted (el, binding, vnode) {
if (process.env.NODE_ENV !== 'production') {
if (!modelableTagRE.test(vnode.tag)) {
warn(
Expand All @@ -32,13 +32,12 @@ export default {
}
}
if (vnode.tag === 'select') {
setSelected(el, binding, vnode.context)
const cb = () => {
setSelected(el, binding, vnode.context)
}
cb()
/* istanbul ignore if */
if (isIE || isEdge) {
const cb = () => {
setSelected(el, binding, vnode.context)
}
nextTick(cb)
setTimeout(cb, 0)
}
} else if (vnode.tag === 'textarea' || el.type === 'text') {
Expand Down

0 comments on commit 5925ad3

Please sign in to comment.