Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromvuejs/vue

Commit01c0750

Browse files
committed
revert: revert prop object validation
closevuejs#7279
1 parent2e0f6d5 commit01c0750

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

‎src/core/util/options.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,6 @@ function normalizeProps (options: Object, vm: ?Component) {
292292
for(constkeyinprops){
293293
val=props[key]
294294
name=camelize(key)
295-
if(process.env.NODE_ENV!=='production'&&isPlainObject(val)){
296-
validatePropObject(name,val,vm)
297-
}
298295
res[name]=isPlainObject(val)
299296
?val
300297
:{type:val}
@@ -309,26 +306,6 @@ function normalizeProps (options: Object, vm: ?Component) {
309306
options.props=res
310307
}
311308

312-
/**
313-
* Validate whether a prop object keys are valid.
314-
*/
315-
constpropOptionsRE=/^(type|default|required|validator)$/
316-
317-
functionvalidatePropObject(
318-
propName:string,
319-
prop:Object,
320-
vm: ?Component
321-
){
322-
for(constkeyinprop){
323-
if(!propOptionsRE.test(key)){
324-
warn(
325-
`Invalid key "${key}" in validation rules object for prop "${propName}".`,
326-
vm
327-
)
328-
}
329-
}
330-
}
331-
332309
/**
333310
* Normalize all injections into Object-based format
334311
*/

‎test/unit/features/options/props.spec.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -513,23 +513,6 @@ describe('Options props', () => {
513513
})
514514
})
515515

516-
it('should warn about misspelled keys in prop validation object',()=>{
517-
newVue({
518-
template:'<test></test>',
519-
components:{
520-
test:{
521-
template:'<div></div>',
522-
props:{
523-
value:{reqquired:true},
524-
count:{deafult:1}
525-
}
526-
}
527-
}
528-
}).$mount()
529-
expect(`Invalid key "reqquired" in validation rules object for prop "value".`).toHaveBeenWarned()
530-
expect(`Invalid key "deafult" in validation rules object for prop "count".`).toHaveBeenWarned()
531-
})
532-
533516
it('should not trigger re-render on non-changed inline literals',done=>{
534517
constupdated=jasmine.createSpy('updated')
535518
constvm=newVue({

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp