File tree 2 files changed +0
-41
lines changed
src/platforms/web/compiler/directives
test/unit/features/directives
2 files changed +0
-41
lines changed Original file line number Diff line number Diff line change @@ -159,23 +159,6 @@ function genDefaultModel (
159
159
value : string ,
160
160
modifiers : ?ASTModifiers
161
161
) : ?boolean {
162
- if ( process . env . NODE_ENV !== 'production' ) {
163
- if ( el . tag === 'input' && el . attrsMap . value ) {
164
- warn (
165
- `<${ el . tag } v-model="${ value } " value="${ el . attrsMap . value } ">:\n` +
166
- 'inline value attributes will be ignored when using v-model. ' +
167
- 'Declare initial values in the component\'s data option instead.'
168
- )
169
- }
170
- if ( el . tag === 'textarea' && el . children . length ) {
171
- warn (
172
- `<textarea v-model="${ value } ">:\n` +
173
- 'inline content inside <textarea> will be ignored when using v-model. ' +
174
- 'Declare initial values in the component\'s data option instead.'
175
- )
176
- }
177
- }
178
-
179
162
const type = el . attrsMap . type
180
163
const { lazy, number, trim } = modifiers || { }
181
164
const event = lazy || ( isIE && type === 'range' ) ? 'change' : 'input'
Original file line number Diff line number Diff line change @@ -204,30 +204,6 @@ describe('Directive v-model text', () => {
204
204
} )
205
205
}
206
206
207
- it ( 'warn inline value attribute' , ( ) => {
208
- const vm = new Vue ( {
209
- data : {
210
- test : 'foo'
211
- } ,
212
- template : '<input v-model="test" value="bar">'
213
- } ) . $mount ( )
214
- expect ( vm . test ) . toBe ( 'foo' )
215
- expect ( vm . $el . value ) . toBe ( 'foo' )
216
- expect ( 'inline value attributes will be ignored' ) . toHaveBeenWarned ( )
217
- } )
218
-
219
- it ( 'warn textarea inline content' , function ( ) {
220
- const vm = new Vue ( {
221
- data : {
222
- test : 'foo'
223
- } ,
224
- template : '<textarea v-model="test">bar</textarea>'
225
- } ) . $mount ( )
226
- expect ( vm . test ) . toBe ( 'foo' )
227
- expect ( vm . $el . value ) . toBe ( 'foo' )
228
- expect ( 'inline content inside <textarea> will be ignored' ) . toHaveBeenWarned ( )
229
- } )
230
-
231
207
it ( 'warn invalid tag' , ( ) => {
232
208
new Vue ( {
233
209
data : {
You can’t perform that action at this time.
0 commit comments