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

Function resolveModifiedOptions

vue.js:6894–6910  ·  view source on GitHub ↗
(Ctor)

Source from the content-addressed store, hash-verified

6892
6893 //解决修改options 转义数据 合并 数据
6894 function resolveModifiedOptions(Ctor) {
6895 var modified;
6896 var latest = Ctor.options; //获取选项
6897 var extended = Ctor.extendOptions; //获取拓展的选项
6898 var sealed = Ctor.sealedOptions; //获取子类选项
6899 for (var key in latest) { //遍历最新选项
6900 if (latest[key] !== sealed[key]) { //如果选项不等于子类选项
6901 if (!modified) {
6902 modified = {};
6903 }
6904 //合并参数
6905 modified[key] = dedupe(latest[key], extended[key], sealed[key]);
6906 }
6907 }
6908 //返回合并后的参数
6909 return modified
6910 }
6911
6912 //转换判断最新的选项是否是数组,如果是数组则将他们拓展和最新还有自选项 合并数组。如果是对象直接返回最新的对象
6913 function dedupe(

Callers 1

Calls 1

dedupeFunction · 0.85

Tested by

no test coverage detected