MCPcopy Create free account
hub / github.com/ygs-code/vue / mustUseProp

Function mustUseProp

vue.js:7433–7447  ·  view source on GitHub ↗
(tag, type, attr)

Source from the content-addressed store, hash-verified

7431 var acceptValue = makeMap('input,textarea,option,select,progress');
7432 //校验属性
7433 var mustUseProp = function (tag, type, attr) {
7434 /*
7435 * 1. attr === 'value', tag 必须是 'input,textarea,option,select,progress' 其中一个 type !== 'button'
7436 * 2. attr === 'selected' && tag === 'option'
7437 * 3. attr === 'checked' && tag === 'input'
7438 * 4. attr === 'muted' && tag === 'video'
7439 * 的情况下为真
7440 * */
7441 return (
7442 (attr === 'value' && acceptValue(tag)) && type !== 'button' || //
7443 (attr === 'selected' && tag === 'option') ||
7444 (attr === 'checked' && tag === 'input') ||
7445 (attr === 'muted' && tag === 'video')
7446 )
7447 };
7448
7449 //contenteditable 是否可以编辑属性
7450 //draggable html5设置是否可以拖动

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected