Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maxprog committed Aug 28, 2017
0 parents commit e9ab9e0
Show file tree
Hide file tree
Showing 32,595 changed files with 4,209,952 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
90 changes: 90 additions & 0 deletions .nuxt/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<template>
<div id="__nuxt">
<nuxt-loading ref="loading"></nuxt-loading>
<component v-if="layout" :is="nuxt.err ? 'nuxt' : layout"></component>
</div>
</template>

<script>
import Vue from 'vue'
import NuxtLoading from './components/nuxt-loading.vue'
import '../vue/assets/app.styl'
let layouts = {
"_default": () => import('../vue/layouts/default.vue' /* webpackChunkName: "layouts/default" */).then(m => m.default || m)
}
let resolvedLayouts = {}
export default {
head: {"link":[{"rel":"stylesheet","type":"text/css","href":"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons"}],"meta":[],"style":[],"script":[]},
data: () => ({
layout: null,
layoutName: ''
}),
beforeCreate () {
Vue.util.defineReactive(this, 'nuxt', this.$options._nuxt)
},
created () {
// Add this.$nuxt in child instances
Vue.prototype.$nuxt = this
// add to window so we can listen when ready
if (typeof window !== 'undefined') {
window.$nuxt = this
}
// Add $nuxt.error()
this.error = this.nuxt.error
},
mounted () {
this.$loading = this.$refs.loading
},
watch: {
'nuxt.err': 'errorChanged'
},
methods: {
errorChanged () {
if (this.nuxt.err && this.$loading) {
if (this.$loading.fail) this.$loading.fail()
if (this.$loading.finish) this.$loading.finish()
}
},
setLayout (layout) {
if (!layout || !resolvedLayouts['_' + layout]) layout = 'default'
this.layoutName = layout
let _layout = '_' + layout
this.layout = resolvedLayouts[_layout]
return this.layout
},
loadLayout (layout) {
if (!layout || !(layouts['_' + layout] || resolvedLayouts['_' + layout])) layout = 'default'
let _layout = '_' + layout
if (resolvedLayouts[_layout]) {
return Promise.resolve(resolvedLayouts[_layout])
}
return layouts[_layout]()
.then((Component) => {
resolvedLayouts[_layout] = Component
delete layouts[_layout]
return resolvedLayouts[_layout]
})
.catch((e) => {
if (this.$nuxt) {
return this.$nuxt.error({ statusCode: 500, message: e.message })
}
})
}
},
components: {
NuxtLoading
}
}
</script>

Loading

0 comments on commit e9ab9e0

Please sign in to comment.