mirror of https://github.com/vuejs/vue.git
4 lines
29 KiB
JavaScript
4 lines
29 KiB
JavaScript
|
|
// Vue.js - v0.6.0
|
||
|
|
// (c) 2013 Evan You
|
||
|
|
// https://github.com/yyx990803/vue
|
||
|
|
!function(){function a(b,c,d){var e=a.resolve(b);if(null==e){d=d||b,c=c||"root";var f=new Error('Failed to require "'+d+'" from "'+c+'"');throw f.path=d,f.parent=c,f.require=!0,f}var g=a.modules[e];if(!g._resolving&&!g.exports){var h={};h.exports={},h.client=h.component=!0,g._resolving=!0,g.call(this,h.exports,a.relative(e),h),delete g._resolving,g.exports=h.exports}return g.exports}a.modules={},a.aliases={},a.resolve=function(b){"/"===b.charAt(0)&&(b=b.slice(1));for(var c=[b,b+".js",b+".json",b+"/index.js",b+"/index.json"],d=0;d<c.length;d++){var b=c[d];if(a.modules.hasOwnProperty(b))return b;if(a.aliases.hasOwnProperty(b))return a.aliases[b]}},a.normalize=function(a,b){var c=[];if("."!=b.charAt(0))return b;a=a.split("/"),b=b.split("/");for(var d=0;d<b.length;++d)".."==b[d]?a.pop():"."!=b[d]&&""!=b[d]&&c.push(b[d]);return a.concat(c).join("/")},a.register=function(b,c){a.modules[b]=c},a.alias=function(b,c){if(!a.modules.hasOwnProperty(b))throw new Error('Failed to alias "'+b+'", it does not exist');a.aliases[c]=b},a.relative=function(b){function c(a,b){for(var c=a.length;c--;)if(a[c]===b)return c;return-1}function d(c){var e=d.resolve(c);return a(e,b,c)}var e=a.normalize(b,"..");return d.resolve=function(d){var f=d.charAt(0);if("/"==f)return d.slice(1);if("."==f)return a.normalize(e,d);var g=b.split("/"),h=c(g,"deps")+1;return h||(h=0),d=g.slice(0,h+1).join("/")+"/deps/"+d},d.exists=function(b){return a.modules.hasOwnProperty(d.resolve(b))},d},a.register("component-indexof/index.js",function(a,b,c){c.exports=function(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0;c<a.length;++c)if(a[c]===b)return c;return-1}}),a.register("component-emitter/index.js",function(a,b,c){function d(a){return a?e(a):void 0}function e(a){for(var b in d.prototype)a[b]=d.prototype[b];return a}var f=b("indexof");c.exports=d,d.prototype.on=function(a,b){return this._callbacks=this._callbacks||{},(this._callbacks[a]=this._callbacks[a]||[]).push(b),this},d.prototype.once=function(a,b){function c(){d.off(a,c),b.apply(this,arguments)}var d=this;return this._callbacks=this._callbacks||{},b._off=c,this.on(a,c),this},d.prototype.off=d.prototype.removeListener=d.prototype.removeAllListeners=function(a,b){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var c=this._callbacks[a];if(!c)return this;if(1==arguments.length)return delete this._callbacks[a],this;var d=f(c,b._off||b);return~d&&c.splice(d,1),this},d.prototype.emit=function(a){this._callbacks=this._callbacks||{};var b=[].slice.call(arguments,1),c=this._callbacks[a];if(c){c=c.slice(0);for(var d=0,e=c.length;e>d;++d)c[d].apply(this,b)}return this},d.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},d.prototype.hasListeners=function(a){return!!this.listeners(a).length}}),a.register("vue/src/main.js",function(a,b,c){function d(a){var b=this;a=e(a,b.options,!0),l.processOptions(a);var c=function(c){c=e(c,a,!0),b.call(this,c)},f=c.prototype=Object.create(b.prototype);l.defProtected(f,"constructor",c);var g=a.proto;if(g)for(var h in g)h in i.prototype||(f[h]=g[h]);return c.extend=d,c.super=b,c.options=a,c}function e(a,b,c){if(a=a||l.hash(),!b)return a;for(var d in b)"el"!==d&&"proto"!==d&&(a[d]?c&&"Object"===l.typeOf(a[d])&&e(a[d],b[d],!1):a[d]=b[d]);return a}function f(){m.forEach(g)}function g(a){h.attrs[a]=h.prefix+"-"+a}var h=b("./config"),i=b("./viewmodel"),j=b("./directives"),k=b("./filters"),l=b("./utils");i.config=function(a){return a&&(l.extend(h,a),a.prefix&&f()),this},i.directive=function(a,b){return b?(j[a]=b,this):j[a]},i.filter=function(a,b){return b?(k[a]=b,this):k[a]},i.component=function(a,b){return b?(l.components[a]=l.toConstructor(b),this):l.components[a]},i.element=function(a,b){return b?(l.elements[a]=l.toConstructor(b),this):l.elements[a]},i.partial=function(a,b){return b?(l.partials[a]=l.toFragment(b),this):l.partials[a]},i.transition=function(a,b){return b?(l.transitions[a]=b,this):l.transitions[a]},i.extend=d;var m=["id","pre","text","repeat","partial","component","transition"];f(),c.expor
|