You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
7 lines
47 KiB
7 lines
47 KiB
/*!
|
|
* Vue.js v2.0.0-pre-alpha
|
|
* (c) 2014-2016 Evan You
|
|
* Released under the MIT License.
|
|
*/
|
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Vue=e()}(this,function(){"use strict";function t(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function e(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}function n(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}function r(t,e){return Hn.call(t,e)}function i(t){return"string"==typeof t||"number"==typeof t}function o(t){var e=Object.create(null);return function(n){var r=e[n];return r||(e[n]=t(n))}}function a(t,e){return e?e.toUpperCase():""}function s(t,e){return function(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}}function u(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function c(t,e){for(var n in e)t[n]=e[n];return t}function l(t){return null!==t&&"object"==typeof t}function f(t){return Jn.call(t)===Wn}function d(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function v(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function p(t){return Gn.test(t)?void 0:(t=t.split("."),function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e})}function h(){this.id=ir++,this.subs=[]}function m(){ar=[],sr=[],ur={},cr={},lr=fr=!1}function g(){ar.sort(y),_(ar),fr=!0,_(sr),m()}function y(t,e){return t.id-e.id}function _(t){for(or=0;or<t.length;or++){var e=t[or],n=e.id;ur[n]=null,e.run()}}function b(t){var e=t.id;if(null==ur[e])if(fr&&!t.user)sr.splice(or+1,0,t);else{var n=t.user?sr:ar;ur[e]=n.length,n.push(t),lr||(lr=!0,nr(g))}}function w(t,e,n,r){r&&c(this,r);var i="function"==typeof e;this.vm=t,t._watchers.push(this),this.expression=e,this.cb=n,this.id=++dr,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new rr,this.newDepIds=new rr,i?this.getter=e:(this.getter=p(e),this.getter||(this.getter=function(){})),this.value=this.lazy?void 0:this.get(),this.queued=this.shallow=!1}function $(t,e){var n=void 0,r=void 0,i=void 0,o=void 0;if(e||(e=pr,e.clear()),i=Zn(t),o=l(t),i||o){if(t.__ob__){var a=t.__ob__.dep.id;if(e.has(a))return;e.add(a)}if(i)for(n=t.length;n--;)$(t[n],e);else if(o)for(r=Object.keys(t),n=r.length;n--;)$(t[r[n]],e)}}function x(t){if(this.value=t,this.dep=new h,v(t,"__ob__",this),Zn(t)){var e=Kn?C:k;e(t,mr,gr),this.observeArray(t)}else this.walk(t)}function C(t,e){t.__proto__=e}function k(t,e,n){for(var r=0,i=n.length;i>r;r++){var o=n[r];v(t,o,e[o])}}function O(t,e){if(l(t)){var n;return r(t,"__ob__")&&t.__ob__ instanceof x?n=t.__ob__:yr.shouldConvert&&(Zn(t)||f(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new x(t)),n&&e&&n.addVm(e),n}}function A(t,e,n){var r=new h,i=Object.getOwnPropertyDescriptor(t,e);if(!i||i.configurable!==!1){var o=i&&i.get,a=i&&i.set,s=O(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=o?o.call(t):n;if(h.target&&(r.depend(),s&&s.dep.depend(),Zn(e)))for(var i,a=0,u=e.length;u>a;a++)i=e[a],i&&i.__ob__&&i.__ob__.dep.depend();return e},set:function(e){var i=o?o.call(t):n;e!==i&&(a?a.call(t,e):n=e,s=O(e),r.notify())}})}}function T(t,e,n){if(Zn(t))return t.splice(e,1,n);if(r(t,e))return void(t[e]=n);if(t._isVue)return void T(t._data,e,n);var i=t.__ob__;if(!i)return void(t[e]=n);if(i.convert(e,n),i.dep.notify(),i.vms)for(var o=i.vms.length;o--;){var a=i.vms[o];j(a,e),a.$forceUpdate()}return n}function L(t,e){if(r(t,e)){delete t[e];var n=t.__ob__;if(!n)return void(t._isVue&&(delete t._data[e],t.$forceUpdate()));if(n.dep.notify(),n.vms)for(var i=n.vms.length;i--;){var o=n.vms[i];E(o,e),o.$forceUpdate()}}}function j(t,e){d(e)||Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return t._data[e]},set:function(n){t._data[e]=n}})}function E(t,e){d(e)||delete t[e]}function S(t){t._watchers=[],M(t),N(t),R(t),U(t),P(t)}function M(t){var e=t.$options.props,n=t.$options.propsData;if(e){var r=t.$options.propKeys=Object.keys(e),i=!t.$parent;yr.shouldConvert=i;for(var o=0;o<r.length;o++){var a=r[o];A(t,a,$t(t,a,n))}yr.shouldConvert=!0}}function N(t){var e=t.$options.data;e=t._data="function"==typeof e?e():e||{},f(e)||(e={});for(var n=Object.keys(e),r=n.length;r--;)j(t,n[r]);O(e,t)}function D(){}function R(t){var e=t.$options.computed;if(e)for(var n in e){var r=e[n],i={enumerable:!0,configurable:!0};"function"==typeof r?(i.get=B(r,t),i.set=D):(i.get=r.get?r.cache!==!1?B(r.get,t):s(r.get,t):D,i.set=r.set?s(r.set,t):D),Object.defineProperty(t,n,i)}}function B(t,e){var n=new w(e,t,null,{lazy:!0});return function(){return n.dirty&&n.evaluate(),h.target&&n.depend(),n.value}}function U(t){var e=t.$options.methods;if(e)for(var n in e)t[n]=s(e[n],t)}function P(t){var e=t.$options.watch;if(e)for(var n in e){var r=e[n];if(Zn(r))for(var i=0;i<r.length;i++)I(t,n,r[i]);else I(t,n,r)}}function I(t,e,n){var r=void 0;f(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}function H(t){Object.defineProperty(t.prototype,"$data",{get:function(){return this._data},set:function(t){t!==this._data&&V(this,t)}}),t.prototype.$watch=function(t,e,n){n=n||{},n.user=!0;var r=new w(this,t,e,n);return n.immediate&&e.call(this,r.value),function(){r.teardown()}}}function V(t,e){e=e||{};var n=t._data;t._data=e;var i,o,a;for(i=Object.keys(n),a=i.length;a--;)o=i[a],o in e||E(t,o);for(i=Object.keys(e),a=i.length;a--;)o=i[a],r(t,o)||j(t,o);n.__ob__.removeVm(t),O(e,t),t.$forceUpdate()}function z(t,e,n,r,i,o,a){return{tag:t,data:e,children:n,text:r,elm:i,ns:o,context:a,key:e&&e.key}}function F(t){if("string"==typeof t)return[z(void 0,void 0,void 0,t)];if(Zn(t)){for(var e=[],n=0,r=t.length;r>n;n++){var o=t[n];Zn(o)?e.push.apply(e,F(o)):i(o)?e.push(z(void 0,void 0,void 0,o)):o&&e.push(o)}return e}}function q(t,e,n){var r=void 0,i=void 0,o=void 0,a=void 0,s=void 0;for(r in t)if(i=t[r],o=e[r],void 0===o)s="!"===r.charAt(0),a=s?r.slice(1):r,Zn(i)?n(a,J(i),s):(i={fn:i},t[r]=i,n(a,W(i),s));else if(Zn(o)){o.length=i.length;for(var u=0;u<o.length;u++)o[u]=i[u];t[r]=o}else o.fn=i,t[r]=o}function J(t){return function(e){for(var n=0;n<t.length;n++)t[n](e)}}function W(t){return function(e){t.fn(e)}}function Z(t){var e=t.$options;t.$parent=e.parent,t.$root=t.$parent?t.$parent.$root:t,t.$parent&&t.$parent.$children.push(t),t.$children=[],t.$refs={},t._isDestroyed=!1,t._isBeingDestroyed=!1}function G(t){t.prototype._mount=function(){var t=this;this.$options.render||(this.$options.render=function(){return t.$createElement("div")});var e=this.$options.staticRenderFns;if(e){this._staticTrees=new Array(e.length);for(var n=0;n<e.length;n++)this._staticTrees[n]=e[n].call(this._renderProxy)}return this._watcher=new w(this,this._render,this._update),this._update(this._watcher.value),this._mounted=!0,this.$root===this&&K(this,"ready"),this},t.prototype._update=function(t){this._mounted&&K(this,"beforeUpdate");var e=this.$options._parentVnode;t.parent=e,this._vnode?this.$el=this.__patch__(this._vnode,t):this.$el=this.__patch__(this.$el,t),this._vnode=t,e&&(e.elm=this.$el),this._mounted&&K(this,"updated")},t.prototype._updateFromParent=function(t,e,n,r){var i=this;if(this.$options._parentVnode=n,this.$options._renderChildren=r,t&&this.$options.props){yr.shouldConvert=!1;for(var o=this.$options.propKeys,a=0;a<o.length;a++){var s=o[a];this[s]=$t(this,s,t)}yr.shouldConvert=!0}if(e){var u=this.$options._parentListeners;this.$options._parentListeners=e,q(e,u||{},function(t,e){i.$on(t,e)})}},t.prototype.$forceUpdate=function(){this._watcher.update()},t.prototype.$destroy=function(){if(!this._isDestroyed){K(this,"beforeDestroy"),this._isBeingDestroyed=!0;var t=this.$parent;t&&!t._isBeingDestroyed&&n(t.$children,this),this._ref&&(this._context.$refs[this._ref]=void 0);for(var e=this._watchers.length;e--;)this._watchers[e].teardown();this._data.__ob__&&this._data.__ob__.removeVm(this),this._isDestroyed=!0,K(this,"destroyed"),this.$off()}}}function K(t,e){t.$emit("pre-hook:"+e);var n=t.$options[e];if(n)for(var r=0,i=n.length;i>r;r++)n[r].call(t);t.$emit("hook:"+e)}function Y(t,e,n,r,i){if(t){if(l(t)&&(t=vt.extend(t)),!t.cid){if(!t.resolved)return void nt(t,function(){n.$forceUpdate()});t=t.resolved}e=e||{},ot(e);var o=rt(e,t),a=e.on;a&&(e.on=null);var s=t.options.name?"-"+t.options.name:"",u=z("vue-component-"+t.cid+s,e,void 0,void 0,void 0,void 0,i);return u.componentOptions={Ctor:t,propsData:o,listeners:a,parent:n,children:r},u}}function Q(t){var e=t.componentOptions,n=e.Ctor,r=e.propsData,i=e.listeners,o=e.parent,a=e.children,s=new n({parent:o,propsData:r,_parentVnode:t,_parentListeners:i,_renderChildren:a});s.$mount(t.elm),t.child=s}function X(t,e){var n=e.componentOptions,r=n.listeners,i=n.propsData,o=n.children;e.child=t.child,e.child._updateFromParent(i,r,e,o)}function tt(t){K(t.child,"ready")}function et(t){t.child.$destroy()}function nt(t,e){t.resolved?e(t.resolved):t.requested?t.pendingCallbacks.push(e):!function(){t.requested=!0;var n=t.pendingCallbacks=[e];t(function(e){l(e)&&(e=vt.extend(e)),t.resolved=e;for(var r=0,i=n.length;i>r;r++)n[r](e)},function(t){})}()}function rt(t,e){var n=e.options.props;if(n){var r={},i=t.attrs,o=t.props,a=t.staticAttrs;if(!i&&!o)return r;for(var s in n){var u=qn(s);it(r,i,s,u)||it(r,o,s,u)||it(r,a,s,u)}return r}}function it(t,e,n,i){if(e){if(r(e,n))return t[n]=e[n],delete e[n],!0;if(r(e,i))return t[n]=e[i],delete e[i],!0}}function ot(t){if(t.hook)for(var e=0;e<br.length;e++){var n=br[e],r=t.hook[n],i=_r[n];t.hook[n]=r?at(i,r):i}else t.hook=_r}function at(t,e){return function(n,r){t(n,r),e(n,r)}}function st(t,e,n,r){var i=this,o=wr.activeInstance;if("string"==typeof t){var a=void 0;return Pn.isReservedTag(t)?z(t,e,F(n),void 0,void 0,r,i):(a=wt(i.$options,"components",t))?Y(a,e,o,n,i):z(t,e,F(n&&n()),void 0,void 0,r,i)}return Y(t,e,o,n,i)}function ut(t){t._vnode=null,t._mounted=!1,t._staticTrees=null,t.$slots={},t.$createElement=s(st,t),t.$options.el&&t.$mount(t.$options.el)}function ct(e){e.prototype._render=function(){var t=wr.activeInstance;wr.activeInstance=this;var e=this.$options,n=e.render,r=e._renderChildren;r&<(this,r);var i=n.call(this._renderProxy);return wr.activeInstance=t,i},e.prototype.__h__=st,e.prototype.__toString__=t,e.prototype.__renderList__=function(t,e){var n=void 0,r=void 0,i=void 0,o=void 0,a=void 0;if(Zn(t))for(n=new Array(t.length),r=0,i=t.length;i>r;r++)n[r]=e(t[r],r,r);else if("number"==typeof t)for(n=new Array(t),r=0;t>r;r++)n[r]=e(r+1,r,r);else if(l(t))for(o=Object.keys(t),n=new Array(o.length),r=0,i=o.length;i>r;r++)a=o[r],n[r]=e(t[a],r,a);return n},e.prototype.__registerRef__=function(t,e,n,r){var i=this.$refs;r?n?r(i[t],e):i[t]=void 0:n?i[t]?i[t].push(e):i[t]=[e]:i[t]=e}}function lt(t,e){if(e){e=F(Zn(e)?e:e());for(var n={"default":e},r=e.length,i=void 0,o=void 0;r--;)if(o=e[r],i=o.data&&o.data.slot){var a=n[i]||(n[i]=[]);"template"===o.tag?a.push.apply(a,o.children):a.push(o),e.splice(r,1)}t.$slots=n}}function ft(t){t._events=Object.create(null);var e=t.$options._parentListeners;e&&q(e,{},function(e,n){t.$on(e,n)})}function dt(t){t.prototype.$on=function(t,e){return(this._events[t]||(this._events[t]=[])).push(e),this},t.prototype.$once=function(t,e){function n(){r.$off(t,n),e.apply(this,arguments)}var r=this;return n.fn=e,this.$on(t,n),this},t.prototype.$off=function(t,e){var n;if(!arguments.length)return this._events=Object.create(null),this;if(n=this._events[t],!n)return this;if(1===arguments.length)return this._events[t]=null,this;for(var r,i=n.length;i--;)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return this},t.prototype.$emit=function(t){var e=this._events[t];if(e){e=e.length>1?u(e):e;for(var n=u(arguments,1),r=0,i=e.length;i>r;r++)e[r].apply(this,n)}}}function vt(t){this._init(t)}function pt(t,e){var n,i,o;for(n in e)i=t[n],o=e[n],r(t,n)?l(i)&&l(o)&&pt(i,o):T(t,n,o);return t}function ht(t,e){return e?t?t.concat(e):Zn(e)?e:[e]:t}function mt(t,e){var n=Object.create(t);return e?c(n,e):n}function gt(t){if(t.components){var e,n=t.components;for(var r in n)In(r)||Pn.isReservedTag(r)||(e=n[r],f(e)&&(n[r]=vt.extend(e)))}}function yt(t){var e=t.props;if(e){var n={},r=void 0,i=void 0,o=void 0;if(Zn(e))for(r=e.length;r--;)i=e[r],"string"==typeof i&&(o=zn(i),n[o]={type:null});else if(f(e))for(var a in e)i=e[a],o=zn(a),n[o]=f(i)?i:{type:i};t.props=n}}function _t(t){var e=t.directives;if(e)for(var n in e)"function"==typeof e[n]&&(e[n]={update:e[n]})}function bt(t,e,n){function i(r){var i=Cr[r]||kr;a[r]=i(t[r],e[r],n,r)}gt(e),yt(e),_t(e);var o,a={};if(e.mixins)for(var s=0,u=e.mixins.length;u>s;s++)t=bt(t,e.mixins[s],n);for(o in t)i(o);for(o in e)r(t,o)||i(o);return a}function wt(t,e,n,r){if("string"==typeof n){var i,o=t[e],a=o[n]||o[i=zn(n)]||o[i.charAt(0).toUpperCase()+i.slice(1)];return a}}function $t(t,e,n){if(n){var i=t.$options.props[e],o=(r(n,e),n[e]);return void 0===o&&(o=xt(t,i,e),yr.shouldConvert=!0,O(o),yr.shouldConvert=!1),o}}function xt(t,e,n){if(!r(e,"default"))return e.type===Boolean?!1:void 0;var i=e["default"];return l(i),"function"==typeof i&&e.type!==Function?i.call(t):i}function Ct(t){var e=t.data,n=void 0;return(n=t.child)&&(n=n._vnode.data)&&(e=kt(n,e)),(n=t.parent)&&(n=n.data)&&(e=kt(e,n)),Ot(e)}function kt(t,e){return{staticClass:At(t.staticClass,e.staticClass),"class":t["class"]?c(t["class"],e["class"]):e["class"]}}function Ot(t){var e=t["class"],n=t.staticClass;return n||e?At(n,Tt(e)):void 0}function At(t,e){return t?e?t+" "+e:t:e||""}function Tt(t){if(!t)return"";if("string"==typeof t)return t;if(Zn(t)){for(var e="",n=0,r=t.length;r>n;n++)t[n]&&(e+=Tt(t[n])+" ");return e.slice(0,-1)}if(l(t)){var i="";for(var o in t)t[o]&&(i+=o+" ");return i.slice(0,-1)}}function Lt(t){return Br(t)?"svg":"math"===t?"math":void 0}function jt(t){if(!Yn)return!0;if(t=t.toLowerCase(),null!=Ur[t])return Ur[t];var e=document.createElement(t);return t.indexOf("-")>-1?Ur[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Ur[t]=/HTMLUnknownElement/.test(e.toString())&&!/^(data|time|rtc|rb)$/.test(t)}function Et(t){if("string"==typeof t){t=document.querySelector(t)}return t}function St(t){t.use=function(t){if(!t.installed){var e=u(arguments,1);return e.unshift(this),"function"==typeof t.install?t.install.apply(t,e):t.apply(null,e),t.installed=!0,this}}}function Mt(t){t.mixin=function(e){t.options=bt(t.options,e)}}function Nt(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=0===n.cid;if(r&&t._Ctor)return t._Ctor;var i=t.name||n.options.name,o=function(t){this._init(t)};return o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.cid=e++,o.options=bt(n.options,t),o["super"]=n,o.extend=n.extend,Pn._assetTypes.forEach(function(t){o[t]=n[t]}),i&&(o.options.components[i]=o),r&&(t._Ctor=o),o}}function Dt(t){Pn._assetTypes.forEach(function(e){t[e]=function(n,r){return r?("component"===e&&f(r)&&(r.name=n,r=t.extend(r)),this.options[e+"s"][n]=r,r):this.options[e+"s"][n]}})}function Rt(t){t.config=Pn,t.util=Or,t.set=T,t["delete"]=L,t.nextTick=nr,t.options={directives:Object.create(null),filters:Object.create(null),components:Object.create(null),transitions:Object.create(null)},St(t),Mt(t),Nt(t),Dt(t)}function Bt(t){return void 0===t}function Ut(t){return void 0!==t}function Pt(t,e){return t.key===e.key&&t.tag===e.tag}function It(t,e,n){var r=void 0,i=void 0,o={};for(r=e;n>=r;++r)i=t[r].key,Ut(i)&&(o[i]=r);return o}function Ht(t){function e(t){return z(_.tagName(t).toLowerCase(),{},[],void 0,t)}function n(t,e){function n(){0===--n.listeners&&r(t)}return n.listeners=e,n}function r(t){var e=_.parentNode(t);_. |