Browse Source

tweak select IE fix to reduce duplicate call

dev
Evan You 8 years ago
parent
commit
5925ad3bd2
  1. 11
      src/platforms/web/runtime/directives/model.js

11
src/platforms/web/runtime/directives/model.js

@ -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(
@ -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') {

Loading…
Cancel
Save