From 06c4f2a75e39921313da0af0e700b7fdd6af90c3 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 13 Dec 2016 12:22:27 -0500 Subject: [PATCH] [build] 2.1.6 --- dist/vue.common.js | 16 ++++++++++------ dist/vue.js | 16 ++++++++++------ dist/vue.min.js | 8 ++++---- dist/vue.runtime.common.js | 8 ++++---- dist/vue.runtime.js | 8 ++++---- dist/vue.runtime.min.js | 6 +++--- examples/svg/index.html | 2 +- packages/vue-server-renderer/build.js | 12 ++++++++---- packages/vue-server-renderer/package.json | 2 +- packages/vue-template-compiler/build.js | 12 ++++++++---- packages/vue-template-compiler/package.json | 2 +- 11 files changed, 54 insertions(+), 38 deletions(-) diff --git a/dist/vue.common.js b/dist/vue.common.js index 6c89462f..e29106ed 100644 --- a/dist/vue.common.js +++ b/dist/vue.common.js @@ -1,5 +1,5 @@ /*! - * Vue.js v2.1.5 + * Vue.js v2.1.6 * (c) 2014-2016 Evan You * Released under the MIT License. */ @@ -2764,7 +2764,7 @@ function normalizeArrayChildren (children, nestedIndex) { var i, c, last; for (i = 0; i < children.length; i++) { c = children[i]; - if (c == null) { continue } + if (c == null || typeof c === 'boolean') { continue } last = res[res.length - 1]; // nested if (Array.isArray(c)) { @@ -3587,7 +3587,7 @@ Object.defineProperty(Vue$3.prototype, '$isServer', { get: isServerRendering }); -Vue$3.version = '2.1.5'; +Vue$3.version = '2.1.6'; /* */ @@ -3724,7 +3724,7 @@ var isHTMLTag = makeMap( // this map is intentionally selective, only covering SVG elements that may // contain child elements. var isSVG = makeMap( - 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font,' + + 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,' + 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true @@ -7698,14 +7698,18 @@ function genChildren (el, checkSkip) { function canSkipNormalization (children) { for (var i = 0; i < children.length; i++) { var el = children[i]; - if (el.for || el.tag === 'template' || el.tag === 'slot' || - (el.if && el.ifConditions.some(function (c) { return c.tag === 'template'; }))) { + if (needsNormalization(el) || + (el.if && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) { return false } } return true } +function needsNormalization (el) { + return el.for || el.tag === 'template' || el.tag === 'slot' +} + function genNode (node) { if (node.type === 1) { return genElement(node) diff --git a/dist/vue.js b/dist/vue.js index 35873500..fc56a7a2 100644 --- a/dist/vue.js +++ b/dist/vue.js @@ -1,5 +1,5 @@ /*! - * Vue.js v2.1.5 + * Vue.js v2.1.6 * (c) 2014-2016 Evan You * Released under the MIT License. */ @@ -2766,7 +2766,7 @@ function normalizeArrayChildren (children, nestedIndex) { var i, c, last; for (i = 0; i < children.length; i++) { c = children[i]; - if (c == null) { continue } + if (c == null || typeof c === 'boolean') { continue } last = res[res.length - 1]; // nested if (Array.isArray(c)) { @@ -3587,7 +3587,7 @@ Object.defineProperty(Vue$3.prototype, '$isServer', { get: isServerRendering }); -Vue$3.version = '2.1.5'; +Vue$3.version = '2.1.6'; /* */ @@ -3724,7 +3724,7 @@ var isHTMLTag = makeMap( // this map is intentionally selective, only covering SVG elements that may // contain child elements. var isSVG = makeMap( - 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font,' + + 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,' + 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true @@ -7698,14 +7698,18 @@ function genChildren (el, checkSkip) { function canSkipNormalization (children) { for (var i = 0; i < children.length; i++) { var el = children[i]; - if (el.for || el.tag === 'template' || el.tag === 'slot' || - (el.if && el.ifConditions.some(function (c) { return c.tag === 'template'; }))) { + if (needsNormalization(el) || + (el.if && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) { return false } } return true } +function needsNormalization (el) { + return el.for || el.tag === 'template' || el.tag === 'slot' +} + function genNode (node) { if (node.type === 1) { return genElement(node) diff --git a/dist/vue.min.js b/dist/vue.min.js index 9cc44cec..b876cb92 100644 --- a/dist/vue.min.js +++ b/dist/vue.min.js @@ -1,8 +1,8 @@ /*! - * Vue.js v2.1.5 + * Vue.js v2.1.6 * (c) 2014-2016 Evan You * 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.Vue=t()}(this,function(){"use strict";function e(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function t(e){var t=parseFloat(e,10);return t||0===t?t:e}function n(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}function i(e,t){return qr.call(e,t)}function a(e){return"string"==typeof e||"number"==typeof e}function o(e){var t=Object.create(null);return function(n){var r=t[n];return r||(t[n]=e(n))}}function s(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function c(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function l(e,t){for(var n in t)e[n]=t[n];return e}function u(e){return null!==e&&"object"==typeof e}function f(e){return Xr.call(e)===ei}function d(e){for(var t={},n=0;n=0&&Ti[n].id>e.id;)n--;Ti.splice(Math.max(n,Li)+1,0,e)}else Ti.push(e);ji||(ji=!0,hi(B))}}function z(e){Pi.clear(),J(e,Pi)}function J(e,t){var n,r,i=Array.isArray(e);if((i||u(e))&&Object.isExtensible(e)){if(e.__ob__){var a=e.__ob__.dep.id;if(t.has(a))return;t.add(a)}if(i)for(n=e.length;n--;)J(e[n],t);else for(r=Object.keys(e),n=r.length;n--;)J(e[r[n]],t)}}function K(e){e._watchers=[],q(e),Y(e),W(e),Z(e),Q(e)}function q(e){var t=e.$options.props;if(t){var n=e.$options.propsData||{},r=e.$options._propKeys=Object.keys(t),i=!e.$parent;Ci.shouldConvert=i;for(var a=function(i){var a=r[i];A(e,a,R(a,t,n,e))},o=0;o1?c(n):n;for(var r=c(arguments,1),i=0,a=n.length;i-1:e.test(t)}function ze(e){var t={};t.get=function(){return ri},Object.defineProperty(e,"config",t),e.util=Si,e.set=O,e.delete=S,e.nextTick=hi,e.options=Object.create(null),ri._assetTypes.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,l(e.options.components,Ki),Fe(e),Ue(e),He(e),Be(e)}function Je(e){for(var t=e.data,n=e,r=e;r.child;)r=r.child._vnode,r.data&&(t=Ke(r.data,t));for(;n=n.parent;)n.data&&(t=Ke(t,n.data));return qe(t)}function Ke(e,t){return{staticClass:We(e.staticClass,t.staticClass),class:e.class?[e.class,t.class]:t.class}}function qe(e){var t=e.class,n=e.staticClass;return n||t?We(n,Ze(t)):""}function We(e,t){return e?t?e+" "+t:e:t||""}function Ze(e){var t="";if(!e)return t;if("string"==typeof e)return e;if(Array.isArray(e)){for(var n,r=0,i=e.length;r-1?ca[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:ca[e]=/HTMLUnknownElement/.test(t.toString())}function Qe(e){if("string"==typeof e){if(e=document.querySelector(e),!e)return document.createElement("div")}return e}function Xe(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&"multiple"in t.data.attrs&&n.setAttribute("multiple","multiple"),n)}function et(e,t){return document.createElementNS(ra[e],t)}function tt(e){return document.createTextNode(e)}function nt(e){return document.createComment(e)}function rt(e,t,n){e.insertBefore(t,n)}function it(e,t){e.removeChild(t)}function at(e,t){e.appendChild(t)}function ot(e){return e.parentNode}function st(e){return e.nextSibling}function ct(e){return e.tagName}function lt(e,t){e.textContent=t}function ut(e,t,n){e.setAttribute(t,n)}function ft(e,t){var n=e.data.ref;if(n){var i=e.context,a=e.child||e.elm,o=i.$refs;t?Array.isArray(o[n])?r(o[n],a):o[n]===a&&(o[n]=void 0):e.data.refInFor?Array.isArray(o[n])&&o[n].indexOf(a)<0?o[n].push(a):o[n]=[a]:o[n]=a}}function dt(e){return null==e}function pt(e){return null!=e}function vt(e,t){return e.key===t.key&&e.tag===t.tag&&e.isComment===t.isComment&&!e.data==!t.data}function ht(e,t,n){var r,i,a={};for(r=t;r<=n;++r)i=e[r].key,pt(i)&&(a[i]=r);return a}function mt(e){function t(e){return new Ii(O.tagName(e).toLowerCase(),{},[],void 0,e)}function r(e,t){function n(){0===--n.listeners&&i(e)}return n.listeners=t,n}function i(e){var t=O.parentNode(e);t&&O.removeChild(t,e)}function o(e,t,n,r,i){if(e.isRootInsert=!i,!s(e,t,n,r)){var a=e.data,o=e.children,c=e.tag;pt(c)?(e.elm=e.ns?O.createElementNS(e.ns,c):O.createElement(c,e),v(e),u(e,o,t),pt(a)&&d(e,t),l(n,e.elm,r)):e.isComment?(e.elm=O.createComment(e.text),l(n,e.elm,r)):(e.elm=O.createTextNode(e.text),l(n,e.elm,r))}}function s(e,t,n,r){var i=e.data;if(pt(i)){var a=pt(e.child)&&i.keepAlive;if(pt(i=i.hook)&&pt(i=i.init)&&i(e,!1,n,r),pt(e.child))return p(e,t),a&&c(e,t,n,r),!0}}function c(e,t,n,r){for(var i,a=e;a.child;)if(a=a.child._vnode,pt(i=a.data)&&pt(i=i.transition)){for(i=0;id?(l=dt(n[m+1])?null:n[m+1].elm,h(e,l,n,f,m,r)):f>m&&g(e,t,u,d)}function b(e,t,n,r){if(e!==t){if(t.isStatic&&e.isStatic&&t.key===e.key&&(t.isCloned||t.isOnce))return t.elm=e.elm,void(t.child=e.child);var i,a=t.data,o=pt(a);o&&pt(i=a.hook)&&pt(i=i.prepatch)&&i(e,t);var s=t.elm=e.elm,c=e.children,l=t.children;if(o&&f(t)){for(i=0;i-1?t.split(/\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+e.getAttribute("class")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Mt(e,t){if(t&&t.trim())if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t);else{for(var n=" "+e.getAttribute("class")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");e.setAttribute("class",n.trim())}}function Pt(e){Da(function(){Da(e)})}function Rt(e,t){(e._transitionClasses||(e._transitionClasses=[])).push(t),Dt(e,t)}function It(e,t){e._transitionClasses&&r(e._transitionClasses,t),Mt(e,t)}function Ft(e,t,n){var r=Ut(e,t),i=r.type,a=r.timeout,o=r.propCount;if(!i)return n();var s=i===Sa?ja:La,c=0,l=function(){e.removeEventListener(s,u),n()},u=function(t){t.target===e&&++c>=o&&l()};setTimeout(function(){c0&&(n=Sa,u=o,f=a.length):t===Ta?l>0&&(n=Ta,u=l,f=c.length):(u=Math.max(o,l),n=u>0?o>l?Sa:Ta:null,f=n?n===Sa?a.length:c.length:0);var d=n===Sa&&Ma.test(r[Ea+"Property"]);return{type:n,timeout:u,propCount:f,hasTransform:d}}function Ht(e,t){for(;e.length1,T=n._enterCb=Kt(function(){O&&It(n,w),T.cancelled?(O&&It(n,$),A&&A(n)):k&&k(n),n._enterCb=null});e.data.show||be(e.data.hook||(e.data.hook={}),"insert",function(){ -var t=n.parentNode,r=t&&t._pending&&t._pending[e.key];r&&r.context===e.context&&r.tag===e.tag&&r.elm._leaveCb&&r.elm._leaveCb(),C&&C(n,T)},"transition-insert"),x&&x(n),O&&(Rt(n,$),Rt(n,w),Pt(function(){It(n,$),T.cancelled||S||Ft(n,a,T)})),e.data.show&&(t&&t(),C&&C(n,T)),O||S||T()}}}function zt(e,t){function n(){m.cancelled||(e.data.show||((r.parentNode._pending||(r.parentNode._pending={}))[e.key]=e),l&&l(r),v&&(Rt(r,s),Rt(r,c),Pt(function(){It(r,s),m.cancelled||h||Ft(r,o,m)})),u&&u(r,m),v||h||m())}var r=e.elm;r._enterCb&&(r._enterCb.cancelled=!0,r._enterCb());var i=Jt(e.data.transition);if(!i)return t();if(!r._leaveCb&&1===r.nodeType){var a=i.css,o=i.type,s=i.leaveClass,c=i.leaveActiveClass,l=i.beforeLeave,u=i.leave,f=i.afterLeave,d=i.leaveCancelled,p=i.delayLeave,v=a!==!1&&!li,h=u&&(u._length||u.length)>1,m=r._leaveCb=Kt(function(){r.parentNode&&r.parentNode._pending&&(r.parentNode._pending[e.key]=null),v&&It(r,c),m.cancelled?(v&&It(r,s),d&&d(r)):(t(),f&&f(r)),r._leaveCb=null});p?p(n):n()}}function Jt(e){if(e){if("object"==typeof e){var t={};return e.css!==!1&&l(t,Pa(e.name||"v")),l(t,e),t}return"string"==typeof e?Pa(e):void 0}}function Kt(e){var t=!1;return function(){t||(t=!0,e())}}function qt(e,t){t.data.show||Vt(t)}function Wt(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var a,o,s=0,c=e.options.length;s-1,o.selected!==a&&(o.selected=a);else if(h(Gt(o),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Zt(e,t){for(var n=0,r=t.length;n',n.innerHTML.indexOf(t)>0}function un(e){return Za=Za||document.createElement("div"),Za.innerHTML=e,Za.textContent}function fn(e,t){return t&&(e=e.replace(zo,"\n")),e.replace(Bo,"<").replace(Vo,">").replace(Jo,"&").replace(Ko,'"')}function dn(e,t){function n(t){f+=t,e=e.substring(t)}function r(){var t=e.match(oo);if(t){var r={tagName:t[1],attrs:[],start:f};n(t[0].length);for(var i,a;!(i=e.match(so))&&(a=e.match(ro));)n(a[0].length),r.attrs.push(a);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=f,r}}function i(e){var n=e.tagName,r=e.unarySlash;l&&("p"===s&&Xa(n)&&a("",s),Qa(n)&&s===n&&a("",n));for(var i=u(n)||"html"===n&&"head"===s||!!r,o=e.attrs.length,f=new Array(o),d=0;d=0&&c[a].tag.toLowerCase()!==o;a--);}else a=0;if(a>=0){for(var l=c.length-1;l>=a;l--)t.end&&t.end(c[l].tag,r,i);c.length=a,s=a&&c[a-1].tag}else"br"===n.toLowerCase()?t.start&&t.start(n,[],!0,r,i):"p"===n.toLowerCase()&&(t.start&&t.start(n,[],!1,r,i),t.end&&t.end(n,r,i))}for(var o,s,c=[],l=t.expectHTML,u=t.isUnaryTag||ti,f=0;e;){if(o=e,s&&Uo(s,t.sfc,c)){var d=s.toLowerCase(),p=Ho[d]||(Ho[d]=new RegExp("([\\s\\S]*?)(]*>)","i")),v=0,h=e.replace(p,function(e,n,r){return v=r.length,"script"!==d&&"style"!==d&&"noscript"!==d&&(n=n.replace(//g,"$1").replace(//g,"$1")),t.chars&&t.chars(n),""});f+=e.length-h.length,e=h,a("",d,f-v,f)}else{var m=e.indexOf("<");if(0===m){if(uo.test(e)){var g=e.indexOf("-->");if(g>=0){n(g+3);continue}}if(fo.test(e)){var y=e.indexOf("]>");if(y>=0){n(y+2);continue}}var _=e.match(lo);if(_){n(_[0].length);continue}var b=e.match(co);if(b){var $=f;n(b[0].length),a(b[0],b[1],$,f);continue}var w=r();if(w){i(w);continue}}var x=void 0,C=void 0,k=void 0;if(m>0){for(C=e.slice(m);!(co.test(C)||oo.test(C)||uo.test(C)||fo.test(C)||(k=C.indexOf("<",1),k<0));)m+=k,C=e.slice(m);x=e.substring(0,m),n(m)}m<0&&(x=e,e=""),t.chars&&x&&t.chars(x)}if(e===o&&t.chars){t.chars(e);break}}a()}function pn(e){function t(){(o||(o=[])).push(e.slice(v,i).trim()),v=i+1}var n,r,i,a,o,s=!1,c=!1,l=!1,u=!1,f=0,d=0,p=0,v=0;for(i=0;i=0&&(m=e.charAt(h)," "===m);h--);m&&/[\w$]/.test(m)||(u=!0)}}else void 0===a?(v=i+1,a=e.slice(0,i).trim()):t();if(void 0===a?a=e.slice(0,i).trim():0!==v&&t(),o)for(i=0;io&&a.push(JSON.stringify(e.slice(o,i)));var s=pn(r[1].trim());a.push("_s("+s+")"),o=i+r[0].length}return o=vo}function On(e){return 34===e||39===e}function Sn(e){var t=1;for(yo=go;!An();)if(e=kn(),On(e))Tn(e);else if(91===e&&t++,93===e&&t--,0===t){_o=go;break}}function Tn(e){for(var t=e;!An()&&(e=kn(),e!==t););}function En(e,t){bo=t.warn||mn,$o=t.getTagNamespace||ti,wo=t.mustUseProp||ti,xo=t.isPreTag||ti,Co=gn(t.modules,"preTransformNode"),ko=gn(t.modules,"transformNode"),Ao=gn(t.modules,"postTransformNode"),Oo=t.delimiters;var n,r,i=[],a=t.preserveWhitespace!==!1,o=!1,s=!1;return dn(e,{expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,shouldDecodeNewlines:t.shouldDecodeNewlines,start:function(e,a,c){function l(e){}var u=r&&r.ns||$o(e);ci&&"svg"===u&&(a=Wn(a));var f={type:1,tag:e,attrsList:a,attrsMap:Jn(a),parent:r,children:[]};u&&(f.ns=u),qn(f)&&!pi()&&(f.forbidden=!0);for(var d=0;d-1:_q("+t+","+a+")"),$n(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+a+"):("+o+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$c){$$i<0&&("+t+"=$$a.concat($$v))}else{$$i>-1&&("+t+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+t+"=$$c}",null,!0)}function Dr(e,t,n){var r=n&&n.number,i=wn(e,"value")||"null";i=r?"_n("+i+")":i,yn(e,"checked","_q("+t+","+i+")"),$n(e,"change",Rr(t,i),null,!0)}function Mr(e,t,n){var r=e.attrsMap.type,i=n||{},a=i.lazy,o=i.number,s=i.trim,c=a||ci&&"range"===r?"change":"input",l=!a&&"range"!==r,u="input"===e.tag||"textarea"===e.tag,f=u?"$event.target.value"+(s?".trim()":""):s?"(typeof $event === 'string' ? $event.trim() : $event)":"$event";f=o||"number"===r?"_n("+f+")":f;var d=Rr(t,f);u&&l&&(d="if($event.target.composing)return;"+d),yn(e,"value",u?"_s("+t+")":"("+t+")"),$n(e,c,d,null,!0),(s||o||"number"===r)&&$n(e,"blur","$forceUpdate()")}function Pr(e,t,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})"+(null==e.attrsMap.multiple?"[0]":""),a=Rr(t,i);$n(e,"change",a,null,!0)}function Rr(e,t){var n=Cn(e);return null===n.idx?e+"="+t:"var $$exp = "+n.exp+", $$idx = "+n.idx+";if (!Array.isArray($$exp)){"+e+"="+t+"}else{$$exp.splice($$idx, 1, "+t+")}"}function Ir(e,t){t.value&&yn(e,"textContent","_s("+t.value+")")}function Fr(e,t){t.value&&yn(e,"innerHTML","_s("+t.value+")")}function Ur(e,t){return t=t?l(l({},gs),t):gs,Or(e,t)}function Hr(e,t,n){var r=(t&&t.warn||gi,t&&t.delimiters?String(t.delimiters)+e:e);if(ms[r])return ms[r];var i={},a=Ur(e,t);i.render=Br(a.render);var o=a.staticRenderFns.length;i.staticRenderFns=new Array(o);for(var s=0;s0,ui=si&&si.indexOf("edge/")>0,fi=si&&si.indexOf("android")>0,di=si&&/iphone|ipad|ipod|ios/.test(si),pi=function(){return void 0===zr&&(zr=!oi&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),zr},vi=oi&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,hi=function(){function e(){r=!1;var e=n.slice(0);n.length=0;for(var t=0;t1&&(t[n[0].trim()]=n[1].trim())}}),t}),$a=/^--/,wa=/\s*!important$/,xa=function(e,t,n){$a.test(t)?e.style.setProperty(t,n):wa.test(n)?e.style.setProperty(t,n.replace(wa,""),"important"):e.style[ka(t)]=n},Ca=["Webkit","Moz","ms"],ka=o(function(e){if(Wi=Wi||document.createElement("div"),e=Zr(e),"filter"!==e&&e in Wi.style)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n\/=]+)/,to=/(?:=)/,no=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^\s"'=<>`]+)/.source],ro=new RegExp("^\\s*"+eo.source+"(?:\\s*("+to.source+")\\s*(?:"+no.join("|")+"))?"),io="[a-zA-Z_][\\w\\-\\.]*",ao="((?:"+io+"\\:)?"+io+")",oo=new RegExp("^<"+ao),so=/^\s*(\/?)>/,co=new RegExp("^<\\/"+ao+"[^>]*>"),lo=/^]+>/i,uo=/^/g,"$1").replace(//g,"$1")),t.chars&&t.chars(n),""});f+=e.length-h.length,e=h,a("",d,f-v,f)}else{var m=e.indexOf("<");if(0===m){if(fo.test(e)){var g=e.indexOf("-->");if(g>=0){n(g+3);continue}}if(po.test(e)){var y=e.indexOf("]>");if(y>=0){n(y+2);continue}}var _=e.match(uo);if(_){n(_[0].length);continue}var b=e.match(lo);if(b){var $=f;n(b[0].length),a(b[0],b[1],$,f);continue}var w=r();if(w){i(w);continue}}var x=void 0,C=void 0,k=void 0;if(m>0){for(C=e.slice(m);!(lo.test(C)||so.test(C)||fo.test(C)||po.test(C)||(k=C.indexOf("<",1),k<0));)m+=k,C=e.slice(m);x=e.substring(0,m),n(m)}m<0&&(x=e,e=""),t.chars&&x&&t.chars(x)}if(e===o&&t.chars){t.chars(e);break}}a()}function pn(e){function t(){(o||(o=[])).push(e.slice(v,i).trim()),v=i+1}var n,r,i,a,o,s=!1,c=!1,l=!1,u=!1,f=0,d=0,p=0,v=0;for(i=0;i=0&&(m=e.charAt(h)," "===m);h--);m&&/[\w$]/.test(m)||(u=!0)}}else void 0===a?(v=i+1,a=e.slice(0,i).trim()):t();if(void 0===a?a=e.slice(0,i).trim():0!==v&&t(),o)for(i=0;io&&a.push(JSON.stringify(e.slice(o,i)));var s=pn(r[1].trim());a.push("_s("+s+")"),o=i+r[0].length}return o=ho}function On(e){return 34===e||39===e}function Sn(e){var t=1;for(_o=yo;!An();)if(e=kn(),On(e))Tn(e);else if(91===e&&t++,93===e&&t--,0===t){bo=yo;break}}function Tn(e){for(var t=e;!An()&&(e=kn(),e!==t););}function En(e,t){$o=t.warn||mn,wo=t.getTagNamespace||ni,xo=t.mustUseProp||ni,Co=t.isPreTag||ni,ko=gn(t.modules,"preTransformNode"),Ao=gn(t.modules,"transformNode"),Oo=gn(t.modules,"postTransformNode"),So=t.delimiters;var n,r,i=[],a=t.preserveWhitespace!==!1,o=!1,s=!1;return dn(e,{expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,shouldDecodeNewlines:t.shouldDecodeNewlines,start:function(e,a,c){function l(e){}var u=r&&r.ns||wo(e);li&&"svg"===u&&(a=Wn(a));var f={type:1,tag:e,attrsList:a,attrsMap:Jn(a),parent:r,children:[]};u&&(f.ns=u),qn(f)&&!vi()&&(f.forbidden=!0);for(var d=0;d-1:_q("+t+","+a+")"),$n(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+a+"):("+o+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$c){$$i<0&&("+t+"=$$a.concat($$v))}else{$$i>-1&&("+t+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+t+"=$$c}",null,!0)}function Mr(e,t,n){var r=n&&n.number,i=wn(e,"value")||"null";i=r?"_n("+i+")":i,yn(e,"checked","_q("+t+","+i+")"),$n(e,"change",Ir(t,i),null,!0)}function Pr(e,t,n){var r=e.attrsMap.type,i=n||{},a=i.lazy,o=i.number,s=i.trim,c=a||li&&"range"===r?"change":"input",l=!a&&"range"!==r,u="input"===e.tag||"textarea"===e.tag,f=u?"$event.target.value"+(s?".trim()":""):s?"(typeof $event === 'string' ? $event.trim() : $event)":"$event";f=o||"number"===r?"_n("+f+")":f;var d=Ir(t,f);u&&l&&(d="if($event.target.composing)return;"+d),yn(e,"value",u?"_s("+t+")":"("+t+")"),$n(e,c,d,null,!0),(s||o||"number"===r)&&$n(e,"blur","$forceUpdate()")}function Rr(e,t,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})"+(null==e.attrsMap.multiple?"[0]":""),a=Ir(t,i);$n(e,"change",a,null,!0)}function Ir(e,t){var n=Cn(e);return null===n.idx?e+"="+t:"var $$exp = "+n.exp+", $$idx = "+n.idx+";if (!Array.isArray($$exp)){"+e+"="+t+"}else{$$exp.splice($$idx, 1, "+t+")}"}function Fr(e,t){t.value&&yn(e,"textContent","_s("+t.value+")")}function Ur(e,t){t.value&&yn(e,"innerHTML","_s("+t.value+")")}function Hr(e,t){return t=t?l(l({},ys),t):ys,Sr(e,t)}function Br(e,t,n){var r=(t&&t.warn||yi,t&&t.delimiters?String(t.delimiters)+e:e);if(gs[r])return gs[r];var i={},a=Hr(e,t);i.render=Vr(a.render);var o=a.staticRenderFns.length;i.staticRenderFns=new Array(o);for(var s=0;s0,fi=ci&&ci.indexOf("edge/")>0,di=ci&&ci.indexOf("android")>0,pi=ci&&/iphone|ipad|ipod|ios/.test(ci),vi=function(){return void 0===Jr&&(Jr=!si&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),Jr},hi=si&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,mi=function(){function e(){r=!1;var e=n.slice(0);n.length=0;for(var t=0;t1&&(t[n[0].trim()]=n[1].trim())}}),t}),wa=/^--/,xa=/\s*!important$/,Ca=function(e,t,n){wa.test(t)?e.style.setProperty(t,n):xa.test(n)?e.style.setProperty(t,n.replace(xa,""),"important"):e.style[Aa(t)]=n},ka=["Webkit","Moz","ms"],Aa=o(function(e){if(Zi=Zi||document.createElement("div"),e=Gr(e),"filter"!==e&&e in Zi.style)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n\/=]+)/,no=/(?:=)/,ro=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^\s"'=<>`]+)/.source],io=new RegExp("^\\s*"+to.source+"(?:\\s*("+no.source+")\\s*(?:"+ro.join("|")+"))?"),ao="[a-zA-Z_][\\w\\-\\.]*",oo="((?:"+ao+"\\:)?"+ao+")",so=new RegExp("^<"+oo),co=/^\s*(\/?)>/,lo=new RegExp("^<\\/"+oo+"[^>]*>"),uo=/^]+>/i,fo=/^ - + diff --git a/packages/vue-server-renderer/build.js b/packages/vue-server-renderer/build.js index ddf1fcae..8c218918 100644 --- a/packages/vue-server-renderer/build.js +++ b/packages/vue-server-renderer/build.js @@ -2308,14 +2308,18 @@ function genChildren (el, checkSkip) { function canSkipNormalization (children) { for (var i = 0; i < children.length; i++) { var el = children[i]; - if (el.for || el.tag === 'template' || el.tag === 'slot' || - (el.if && el.ifConditions.some(function (c) { return c.tag === 'template'; }))) { + if (needsNormalization(el) || + (el.if && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) { return false } } return true } +function needsNormalization (el) { + return el.for || el.tag === 'template' || el.tag === 'slot' +} + function genNode (node) { if (node.type === 1) { return genElement(node) @@ -4532,7 +4536,7 @@ function normalizeArrayChildren (children, nestedIndex) { var i, c, last; for (i = 0; i < children.length; i++) { c = children[i]; - if (c == null) { continue } + if (c == null || typeof c === 'boolean') { continue } last = res[res.length - 1]; // nested if (Array.isArray(c)) { @@ -5734,7 +5738,7 @@ var isHTMLTag = makeMap( // this map is intentionally selective, only covering SVG elements that may // contain child elements. var isSVG = makeMap( - 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font,' + + 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,' + 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true diff --git a/packages/vue-server-renderer/package.json b/packages/vue-server-renderer/package.json index 639d3e02..5a5d2ef5 100644 --- a/packages/vue-server-renderer/package.json +++ b/packages/vue-server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "vue-server-renderer", - "version": "2.1.5", + "version": "2.1.6", "description": "server renderer for Vue 2.0", "main": "index.js", "repository": { diff --git a/packages/vue-template-compiler/build.js b/packages/vue-template-compiler/build.js index e33d0929..5a7abef4 100644 --- a/packages/vue-template-compiler/build.js +++ b/packages/vue-template-compiler/build.js @@ -2183,14 +2183,18 @@ function genChildren (el, checkSkip) { function canSkipNormalization (children) { for (var i = 0; i < children.length; i++) { var el = children[i]; - if (el.for || el.tag === 'template' || el.tag === 'slot' || - (el.if && el.ifConditions.some(function (c) { return c.tag === 'template'; }))) { + if (needsNormalization(el) || + (el.if && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) { return false } } return true } +function needsNormalization (el) { + return el.for || el.tag === 'template' || el.tag === 'slot' +} + function genNode (node) { if (node.type === 1) { return genElement(node) @@ -4381,7 +4385,7 @@ function normalizeArrayChildren (children, nestedIndex) { var i, c, last; for (i = 0; i < children.length; i++) { c = children[i]; - if (c == null) { continue } + if (c == null || typeof c === 'boolean') { continue } last = res[res.length - 1]; // nested if (Array.isArray(c)) { @@ -5557,7 +5561,7 @@ var isHTMLTag = makeMap( // this map is intentionally selective, only covering SVG elements that may // contain child elements. var isSVG = makeMap( - 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font,' + + 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,' + 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true diff --git a/packages/vue-template-compiler/package.json b/packages/vue-template-compiler/package.json index 44720402..ab92d2a9 100644 --- a/packages/vue-template-compiler/package.json +++ b/packages/vue-template-compiler/package.json @@ -1,6 +1,6 @@ { "name": "vue-template-compiler", - "version": "2.1.5", + "version": "2.1.6", "description": "template compiler for Vue 2.0", "main": "index.js", "repository": {