File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -7,23 +7,25 @@ module.exports = {
7
7
8
8
var self = this ,
9
9
el = self . el ,
10
- type = el . type
10
+ type = el . type ,
11
+ tag = el . tagName
11
12
12
13
self . lock = false
13
14
14
15
// determine what event to listen to
15
16
self . event =
16
17
( self . compiler . options . lazy ||
17
- el . tagName === 'SELECT' ||
18
- type === 'checkbox' ||
19
- type === 'radio' )
18
+ tag === 'SELECT' ||
19
+ type === 'checkbox' || type === 'radio' )
20
20
? 'change'
21
21
: 'input'
22
22
23
23
// determin the attribute to change when updating
24
- var attr = type === 'checkbox'
24
+ var attr = self . attr = type === 'checkbox'
25
25
? 'checked'
26
- : 'value'
26
+ : ( tag === 'INPUT' || tag === 'SELECT' || tag === 'TEXTAREA' )
27
+ ? 'value'
28
+ : 'innerHTML'
27
29
28
30
// attach listener
29
31
self . set = self . filters
@@ -97,7 +99,7 @@ module.exports = {
97
99
} else if ( el . type === 'checkbox' ) { // checkbox
98
100
el . checked = ! ! value
99
101
} else {
100
- el . value = utils . toText ( value )
102
+ el [ self . attr ] = utils . toText ( value )
101
103
}
102
104
} ,
103
105
You can’t perform that action at this time.
0 commit comments