Nuxt/examples/hello-world/dist/_nuxt/nuxt.bundle.js
Alexandre Chopin 06694e32ce generator done
2016-11-10 13:24:20 +01:00

1 line
7.5 KiB
JavaScript

webpackJsonp([2],[,,,,,,function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.router=e.app=void 0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(0),a=(r(i),n(11)),s=r(a),u=n(14),c=r(u),f=o({router:s.default},c.default);e.app=f,e.router=s.default},function(t,e){"use strict";function n(t){return[].concat.apply([],t.matched.map(function(t){return Object.keys(t.components).map(function(e){return t.components[e]})}))}function r(t,e){return Array.prototype.concat.apply([],t.matched.map(function(t,n){return Object.keys(t.components).map(function(r){return e(t.components[r],t.instances[r],t,r,n)})}))}function o(t){var e={isServer:!!t.isServer,isClient:!!t.isClient,route:t.to?t.to:t.route};return e.params=e.route.params||{},e.query=e.route.query||{},t.req&&(e.req=t.req),t.res&&(e.res=t.res),e}function i(t){var e=window.location.pathname;return t&&0===e.indexOf(t)&&(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}Object.defineProperty(e,"__esModule",{value:!0}),e.getMatchedComponents=n,e.flatMapComponents=r,e.getContext=o,e.getLocation=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(16),i=r(o),a=n(15),s=r(a);e.default={data:function(){return{err:null}},mounted:function(){this.$loading=this.$refs.loading},methods:{error:function(t){return t=t||null,this.err=t||null,this.err&&this.$loading&&this.$loading.fail&&this.$loading.fail(),this.err}},components:{NuxtError:i.default,NuxtLoading:s.default}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0);e.default={data:function(){return{percent:0,show:!1,canSuccess:!0,duration:5e3,height:"2px",color:"black",failedColor:"red"}},methods:{start:function(){var t=this;return this.show=!0,this.canSuccess=!0,this._timer&&(clearInterval(this._timer),this.percent=0),this._cut=1e4/Math.floor(this.duration),this._timer=setInterval(function(){t.increase(t._cut*Math.random()),t.percent>95&&t.finish()},100),this},set:function(t){return this.show=!0,this.canSuccess=!0,this.percent=Math.floor(t),this},get:function(){return Math.floor(this.percent)},increase:function(t){return this.percent=this.percent+Math.floor(t),this},decrease:function(){return this.percent=this.percent-Math.floor(num),this},finish:function(){return this.percent=100,this.hide(),this},pause:function(){return clearInterval(this._timer),this},hide:function(){var t=this;return clearInterval(this._timer),this._timer=null,setTimeout(function(){t.show=!1,r.nextTick(function(){setTimeout(function(){t.percent=0},200)})},500),this},fail:function(){return this.canSuccess=!1,this.percent=100,this.hide(),this}}}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:["error"]}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=r(o),a=n(4),s=r(a),u=n(3),c=r(u);i.default.use(s.default),i.default.use(c.default);var f=function(){return n.e(0).then(n.bind(null,24))},d=function(){return n.e(1).then(n.bind(null,25))},l=function(t,e,n){if(n)return n;var r={x:0,y:0};return t.hash&&(r={selector:t.hash}),r};e.default=new s.default({mode:"history",scrollBehavior:l,routes:[{path:"/about",component:f},{path:"/",component:d}]})},function(t,e){},function(t,e){},function(t,e,n){var r,o;r=n(8);var i=n(19);o=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(o=r=r.default),"function"==typeof o&&(o=o.options),o.render=i.render,o.staticRenderFns=i.staticRenderFns,t.exports=r},function(t,e,n){var r,o;n(12),r=n(9);var i=n(17);o=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(o=r=r.default),"function"==typeof o&&(o=o.options),o.render=i.render,o.staticRenderFns=i.staticRenderFns,o._scopeId="data-v-3223f20f",t.exports=r},function(t,e,n){var r,o;n(13),r=n(10);var i=n(18);o=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(o=r=r.default),"function"==typeof o&&(o=o.options),o.render=i.render,o.staticRenderFns=i.staticRenderFns,o._scopeId="data-v-51a55454",t.exports=r},function(module,exports){module.exports={render:function(){with(this)return _h("div",{staticClass:"progress",style:{width:percent+"%",height:height,"background-color":canSuccess?color:failedColor,opacity:show?1:0}})},staticRenderFns:[]}},function(module,exports){module.exports={render:function(){with(this)return _h("div",{staticClass:"error-page"},[_h("div",[_h("h1",{staticClass:"error-code"},[_s(error.statusCode)])," ",_h("div",{staticClass:"error-wrapper-message"},[_h("h2",{staticClass:"error-message"},[_s(error.message)])])," ",404===error.statusCode?_h("p",[_h("router-link",{staticClass:"error-link",attrs:{to:"/"}},["Back to the home page"])]):_e()])])},staticRenderFns:[]}},function(module,exports){module.exports={render:function(){with(this)return _h("div",{attrs:{id:"app"}},[_h("nuxt-loading",{ref:"loading"})," ",err?_e():_h("router-view")," ",err?_h("nuxt-error",{attrs:{error:err}}):_e()])},staticRenderFns:[]}},,,function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){var r=this,o=(0,c.flatMapComponents)(t,function(t,e,n,r){return"function"!=typeof t||t.options?t:new Promise(function(e,o){var i=function(t){n.components[r]=t,e(t)};t().then(i).catch(o)})});this.$loading.start&&this.$loading.start(),Promise.all(o).then(function(){return n()}).catch(function(t){r.error({statusCode:500,message:t.message}),n(!1)})}function i(t,e,n){var r=this,o=(0,c.getMatchedComponents)(t);return o.length?(o.forEach(function(t){if(t._data||(t._data=t.data||f),t._Ctor&&t._Ctor.options){t.fetch=t._Ctor.options.fetch;var e=t._data.toString().replace(/\s/g,""),n=(t.data||f).toString().replace(/\s/g,""),r=(t._Ctor.options.data||f).toString().replace(/\s/g,"");r!==e&&r!==n&&(t._data=t._Ctor.options.data||f)}}),this.error(),void Promise.all(o.map(function(e){var n=[],o=(0,c.getContext)({to:t,isClient:!0});if(e._data&&"function"==typeof e._data){var i=e._data(o);i instanceof Promise||(i=Promise.resolve(i)),i.then(function(t){e.data=function(){return t},e._Ctor&&e._Ctor.options&&(e._Ctor.options.data=e.data),r.$loading.start&&r.$loading.increase(30)}),n.push(i)}if(e.fetch){var a=e.fetch(o);a instanceof Promise||(a=Promise.resolve(a)),a.then(function(){return r.$loading.increase&&r.$loading.increase(30)}),n.push(a)}return Promise.all(n)})).then(function(){r.$loading.finish&&r.$loading.finish(),n()}).catch(function(t){r.error(t),n(!1)})):(this.error({statusCode:404,message:"This page could not be found.",url:t.path}),n())}var a=n(0),s=r(a),u=n(6),c=n(7);n(2).polyfill(),n(1).polyfill();var f=function(){return{}},d=window.__NUXT__||{};if(!d)throw new Error("[nuxt.js] cannot find the global variable __NUXT__, make sure the server is working.");var l=(0,c.getLocation)(u.router.options.base),h=(0,c.flatMapComponents)(u.router.match(l),function(t,e,n,r,o){return"function"!=typeof t||t.options?t:new Promise(function(e,i){var a=function(t){t.data&&"function"==typeof t.data&&(t._data=t.data,t.data=function(){return d.data[o]},t._Ctor&&t._Ctor.options&&(t._Ctor.options.data=t.data)),n.components[r]=t,e(t)};t().then(a).catch(i)})});Promise.all(h).then(function(t){var e=new s.default(u.app);d.error&&e.error(d.error),e.$mount("#app"),u.router.beforeEach(o.bind(e)),u.router.beforeEach(i.bind(e)),"function"==typeof window.onNuxtReady&&window.onNuxtReady(e)}).catch(function(t){console.error("[nuxt.js] Cannot load components",t)})}],[22]);