UNPKG

vue-merge-data

Version:

Intelligently merge data for Vue render functions.

7 lines (6 loc) 976 B
/*! * vue-merge-data v0.2.1 * (c) 2018-present fjc0k <fjc0kb@gmail.com> (https://github.com/fjc0k) * Released under the MIT License. */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.VueMergeData=t()}(this,function(){"use strict";var e=function(e,t,a){var c=Object.keys(t);for(var s in c){var n=c[s];null!=t[n]&&(a?a(n,e,t):e[n]=t[n])}return e};return function(){var t=[].slice.call(arguments),a=e({},t[0]),c=t.slice(1),s=function(t){var s=c[t];e(a,s,function(t){var c=a[t],n=s[t];if(c)switch(t){case"staticClass":a[t]=(c+" "+n).trim();break;case"attrs":case"domProps":case"scopedSlots":case"staticStyle":case"props":case"hook":case"transition":e(c,n);break;case"class":case"style":case"directives":a[t]=[].concat(n,c);break;case"on":case"nativeOn":e(c,n,function(e){c[e]?c[e]=[].concat(n[e],c[e]):c[e]=n[e]});break;default:a[t]=s[t]}else a[t]=n})};for(var n in c)s(n);return a}});