mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-05 05:27:59 +08:00
ensure set value last in IE9 (fix #4391)
This commit is contained in:
parent
4c3abdda92
commit
b48c45eb7e
@ -1,6 +1,7 @@
|
||||
/* @flow */
|
||||
|
||||
import { extend } from 'shared/util'
|
||||
import { isIE9 } from 'core/util/env'
|
||||
import {
|
||||
isBooleanAttr,
|
||||
isEnumeratedAttr,
|
||||
@ -17,7 +18,7 @@ function updateAttrs (oldVnode: VNodeWithData, vnode: VNodeWithData) {
|
||||
let key, cur, old
|
||||
const elm = vnode.elm
|
||||
const oldAttrs = oldVnode.data.attrs || {}
|
||||
let attrs = vnode.data.attrs || {}
|
||||
let attrs: any = vnode.data.attrs || {}
|
||||
// clone observed objects, as the user probably wants to mutate it
|
||||
if (attrs.__ob__) {
|
||||
attrs = vnode.data.attrs = extend({}, attrs)
|
||||
@ -30,6 +31,10 @@ function updateAttrs (oldVnode: VNodeWithData, vnode: VNodeWithData) {
|
||||
setAttr(elm, key, cur)
|
||||
}
|
||||
}
|
||||
// #4391: in IE9, setting type can reset value for input[type=radio]
|
||||
if (isIE9 && attrs.value !== oldAttrs.value) {
|
||||
setAttr(elm, 'value', attrs.value)
|
||||
}
|
||||
for (key in oldAttrs) {
|
||||
if (attrs[key] == null) {
|
||||
if (isXlink(key)) {
|
||||
|
Loading…
Reference in New Issue
Block a user