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

Function normalizeEvents

vue.js:10399–10419  ·  view source on GitHub ↗
(on)

Source from the content-addressed store, hash-verified

10397
10398 //为事件 多添加 change 或者input 事件加进去
10399 function normalizeEvents(on) {
10400 /* istanbul ignore if */
10401 if (isDef(on[RANGE_TOKEN])) {
10402 // IE input[type=range] only supports `change` event
10403 //
10404 var event = isIE ? 'change' : 'input'; //判断是否是ie 浏览器,如果是则选择 change 事件,如果不是则选择input事件
10405 on[event] = [].concat(on[RANGE_TOKEN], on[event] || []); //连接事件 把change或者input 事件添加进去
10406 delete on[RANGE_TOKEN]; //删除旧的事件
10407 }
10408 // This was originally intended to fix #4521 but no longer necessary
10409 // after 2.5. Keeping it for backwards compat with generated code from < 2.4
10410 /* istanbul ignore if */
10411 //最初的目的是修复#4521,但现在已经没有必要了
10412 // 2.5之后。保留它以便与< 2.4生成的代码进行反向比较
10413 //添加change事件
10414 if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
10415
10416 on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
10417 delete on[CHECKBOX_RADIO_TOKEN];
10418 }
10419 }
10420
10421 var target$1;
10422 //柯理化函数,返回一个直接调用函数的方法,调用完就删除事件

Callers 1

updateDOMListenersFunction · 0.85

Calls 1

isDefFunction · 0.85

Tested by

no test coverage detected