File tree 3 files changed +1
-43
lines changed
3 files changed +1
-43
lines changed Original file line number Diff line number Diff line change @@ -477,15 +477,6 @@ function processAttrs (el) {
477
477
}
478
478
}
479
479
addAttr ( el , name , JSON . stringify ( value ) )
480
- // #4530 also bind special attributes as props even if they are static
481
- // so that patches between dynamic/static are consistent
482
- if ( platformMustUseProp ( el . tag , name ) ) {
483
- if ( name === 'value' ) {
484
- addProp ( el , name , JSON . stringify ( value ) )
485
- } else {
486
- addProp ( el , name , 'true' )
487
- }
488
- }
489
480
}
490
481
}
491
482
}
Original file line number Diff line number Diff line change @@ -413,7 +413,7 @@ describe('parser', () => {
413
413
414
414
it ( 'literal attribute' , ( ) => {
415
415
// basic
416
- const ast1 = parse ( '<input type="text" name="field1" value="hello world" checked >' , baseOptions )
416
+ const ast1 = parse ( '<input type="text" name="field1" value="hello world">' , baseOptions )
417
417
expect ( ast1 . attrsList [ 0 ] . name ) . toBe ( 'type' )
418
418
expect ( ast1 . attrsList [ 0 ] . value ) . toBe ( 'text' )
419
419
expect ( ast1 . attrsList [ 1 ] . name ) . toBe ( 'name' )
@@ -429,13 +429,6 @@ describe('parser', () => {
429
429
expect ( ast1 . attrs [ 1 ] . value ) . toBe ( '"field1"' )
430
430
expect ( ast1 . attrs [ 2 ] . name ) . toBe ( 'value' )
431
431
expect ( ast1 . attrs [ 2 ] . value ) . toBe ( '"hello world"' )
432
- expect ( ast1 . attrs [ 3 ] . name ) . toBe ( 'checked' )
433
- expect ( ast1 . attrs [ 3 ] . value ) . toBe ( '""' )
434
- // also bind speicals as props
435
- expect ( ast1 . props [ 0 ] . name ) . toBe ( 'value' )
436
- expect ( ast1 . props [ 0 ] . value ) . toBe ( '"hello world"' )
437
- expect ( ast1 . props [ 1 ] . name ) . toBe ( 'checked' )
438
- expect ( ast1 . props [ 1 ] . value ) . toBe ( 'true' )
439
432
// interpolation warning
440
433
parse ( '<input type="text" name="field1" value="{{msg}}">' , baseOptions )
441
434
expect ( 'Interpolation inside attributes has been removed' ) . toHaveBeenWarned ( )
Original file line number Diff line number Diff line change @@ -114,30 +114,4 @@ describe('vdom patch: edge cases', () => {
114
114
} )
115
115
. then ( done )
116
116
} )
117
-
118
- // #4530
119
- it ( 'should not reset value when patching bewteen dyanmic/static bindings' , done => {
120
- const vm = new Vue ( {
121
- data : { ok : true } ,
122
- template : `
123
- <div>
124
- <input v-if="ok" value="a">
125
- <input v-else :value="'b'">
126
- <input v-if="ok" type="checkbox" checked>
127
- <input v-else type="checkbox" :checked="false">
128
- </div>
129
- `
130
- } ) . $mount ( )
131
- expect ( vm . $el . children [ 0 ] . value ) . toBe ( 'a' )
132
- expect ( vm . $el . children [ 1 ] . checked ) . toBe ( true )
133
- vm . ok = false
134
- waitForUpdate ( ( ) => {
135
- expect ( vm . $el . children [ 0 ] . value ) . toBe ( 'b' )
136
- expect ( vm . $el . children [ 1 ] . checked ) . toBe ( false )
137
- vm . ok = true
138
- } ) . then ( ( ) => {
139
- expect ( vm . $el . children [ 0 ] . value ) . toBe ( 'a' )
140
- expect ( vm . $el . children [ 1 ] . checked ) . toBe ( true )
141
- } ) . then ( done )
142
- } )
143
117
} )
You can’t perform that action at this time.
0 commit comments