2016-11-07 01:34:58 +00:00
|
|
|
<template>
|
2016-11-11 00:11:21 +00:00
|
|
|
<div id="__nuxt">
|
2016-11-09 14:55:02 +00:00
|
|
|
<% if (loading) { %><nuxt-loading ref="loading"></nuxt-loading><% } %>
|
2016-11-07 01:34:58 +00:00
|
|
|
<router-view v-if="!err"></router-view>
|
2016-11-09 14:55:02 +00:00
|
|
|
<nuxt-error v-if="err" :error="err"></nuxt-error>
|
2016-11-07 01:34:58 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2016-11-09 14:55:02 +00:00
|
|
|
import NuxtError from '<%= components.ErrorPage %>'
|
2016-11-10 20:52:27 +00:00
|
|
|
<% if (loading) { %>import NuxtLoading from '<%= (typeof loading === "string" ? loading : "./components/nuxt-loading.vue") %>'<% } %>
|
2016-11-07 01:34:58 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
err: null
|
|
|
|
}
|
|
|
|
},
|
|
|
|
<% if (loading) { %>
|
2016-11-11 00:11:21 +00:00
|
|
|
created () {
|
|
|
|
this.$loading = {} // for NUXT.serverRendered = false
|
|
|
|
},
|
2016-11-07 01:34:58 +00:00
|
|
|
mounted () {
|
|
|
|
this.$loading = this.$refs.loading
|
|
|
|
},
|
|
|
|
<% } %>
|
|
|
|
methods: {
|
|
|
|
error (err) {
|
|
|
|
err = err || null
|
|
|
|
this.err = err || null
|
|
|
|
<% if (loading) { %>
|
2016-11-07 18:21:32 +00:00
|
|
|
if (this.err && this.$loading && this.$loading.fail) {
|
|
|
|
this.$loading.fail()
|
2016-11-07 01:34:58 +00:00
|
|
|
}
|
|
|
|
<% } %>
|
|
|
|
return this.err
|
|
|
|
}
|
|
|
|
},
|
|
|
|
components: {
|
2016-11-09 14:55:02 +00:00
|
|
|
NuxtError<%= (loading ? ',\n\t\tNuxtLoading' : '') %>
|
2016-11-14 22:59:54 +00:00
|
|
|
},
|
|
|
|
head: <%= JSON.stringify(head) %>
|
2016-11-07 01:34:58 +00:00
|
|
|
}
|
|
|
|
</script>
|
2016-11-07 22:26:53 +00:00
|
|
|
|
|
|
|
<% css.forEach(function (c) { %>
|
|
|
|
<style src="<%= (typeof c === 'string' ? c : c.src) %>" lang="<%= (c.lang ? c.lang : 'css') %>"></style>
|
|
|
|
<% }) %>
|