2017-08-10 10:37:23 +00:00
|
|
|
import Vue from 'vue'
|
2021-02-02 12:38:54 +00:00
|
|
|
import { parsePath, withoutTrailingSlash, normalizeURL } from 'ufo'
|
2020-04-24 16:05:55 +00:00
|
|
|
<% utilsImports = [
|
|
|
|
...(features.asyncData || features.fetch) ? [
|
|
|
|
'getMatchedComponentsInstances',
|
|
|
|
'getChildrenComponentInstancesUsingFetch',
|
|
|
|
'promisify',
|
2020-05-07 19:08:01 +00:00
|
|
|
'globalHandleError',
|
|
|
|
'urlJoin'
|
2020-04-24 16:05:55 +00:00
|
|
|
] : [],
|
|
|
|
...features.layouts ? [
|
|
|
|
'sanitizeComponent'
|
|
|
|
]: []
|
|
|
|
] %>
|
|
|
|
<% if (utilsImports.length) { %>import { <%= utilsImports.join(', ') %> } from './utils'<% } %>
|
2020-09-15 16:33:26 +00:00
|
|
|
import NuxtError from '<%= components.ErrorPage ? components.ErrorPage : "./components/nuxt-error.vue" %>'
|
2017-01-30 10:20:20 +00:00
|
|
|
<% if (loading) { %>import NuxtLoading from '<%= (typeof loading === "string" ? loading : "./components/nuxt-loading.vue") %>'<% } %>
|
2019-09-05 15:15:27 +00:00
|
|
|
<% if (buildIndicator) { %>import NuxtBuildIndicator from './components/nuxt-build-indicator'<% } %>
|
2018-08-15 13:23:03 +00:00
|
|
|
<% css.forEach((c) => { %>
|
2019-01-02 21:30:19 +00:00
|
|
|
import '<%= relativeToBuild(resolvePath(c.src || c, { isStyle: true })) %>'
|
2017-05-05 14:10:12 +00:00
|
|
|
<% }) %>
|
2017-01-30 10:20:20 +00:00
|
|
|
|
2019-09-05 15:15:27 +00:00
|
|
|
<% if (features.layouts) { %>
|
2018-08-06 00:12:44 +00:00
|
|
|
<%= Object.keys(layouts).map((key) => {
|
2018-03-19 18:40:33 +00:00
|
|
|
if (splitChunks.layouts) {
|
2020-03-27 13:08:48 +00:00
|
|
|
return `const _${hash(key)} = () => import('${layouts[key]}' /* webpackChunkName: "${wChunk('layouts/' + key)}" */).then(m => sanitizeComponent(m.default || m))`
|
2018-03-13 14:36:49 +00:00
|
|
|
} else {
|
2018-03-13 16:41:20 +00:00
|
|
|
return `import _${hash(key)} from '${layouts[key]}'`
|
2018-03-13 14:36:49 +00:00
|
|
|
}
|
|
|
|
}).join('\n') %>
|
2016-12-24 00:55:32 +00:00
|
|
|
|
2020-03-27 13:08:48 +00:00
|
|
|
<% if (splitChunks.layouts) { %>
|
|
|
|
let resolvedLayouts = {}
|
|
|
|
const layouts = { <%= Object.keys(layouts).map(key => `"_${key}": _${hash(key)}`).join(',') %> }<%= isTest ? '// eslint-disable-line' : '' %>
|
|
|
|
<% } else { %>
|
2020-03-25 18:14:17 +00:00
|
|
|
const layouts = { <%= Object.keys(layouts).map(key => `"_${key}": sanitizeComponent(_${hash(key)})`).join(',') %> }<%= isTest ? '// eslint-disable-line' : '' %>
|
2020-03-27 13:08:48 +00:00
|
|
|
<% } %>
|
2018-03-13 14:36:49 +00:00
|
|
|
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } %>
|
2017-08-07 06:21:03 +00:00
|
|
|
|
2016-12-24 00:55:32 +00:00
|
|
|
export default {
|
2019-09-10 09:51:14 +00:00
|
|
|
render (h, props) {
|
2018-11-24 18:49:19 +00:00
|
|
|
<% if (loading) { %>const loadingEl = h('NuxtLoading', { ref: 'loading' })<% } %>
|
2019-09-05 15:15:27 +00:00
|
|
|
<% if (features.layouts) { %>
|
2017-11-06 17:30:15 +00:00
|
|
|
const layoutEl = h(this.layout || 'nuxt')
|
|
|
|
const templateEl = h('div', {
|
|
|
|
domProps: {
|
|
|
|
id: '__layout'
|
|
|
|
},
|
2020-06-25 13:23:06 +00:00
|
|
|
key: this.layoutName
|
2019-11-26 22:42:39 +00:00
|
|
|
}, [layoutEl])
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } else { %>
|
|
|
|
const templateEl = h('nuxt')
|
|
|
|
<% } %>
|
2017-10-07 09:43:09 +00:00
|
|
|
|
2019-09-05 15:15:27 +00:00
|
|
|
<% if (features.transitions) { %>
|
2017-10-07 09:43:09 +00:00
|
|
|
const transitionEl = h('transition', {
|
|
|
|
props: {
|
|
|
|
name: '<%= layoutTransition.name %>',
|
|
|
|
mode: '<%= layoutTransition.mode %>'
|
2018-11-24 21:35:43 +00:00
|
|
|
},
|
|
|
|
on: {
|
2019-09-10 09:51:14 +00:00
|
|
|
beforeEnter (el) {
|
2018-11-24 21:35:43 +00:00
|
|
|
// Ensure to trigger scroll event after calling scrollBehavior
|
|
|
|
window.<%= globals.nuxt %>.$nextTick(() => {
|
|
|
|
window.<%= globals.nuxt %>.$emit('triggerScroll')
|
|
|
|
})
|
|
|
|
}
|
2017-10-07 09:43:09 +00:00
|
|
|
}
|
2019-11-26 22:42:39 +00:00
|
|
|
}, [templateEl])
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } %>
|
2017-10-07 09:43:09 +00:00
|
|
|
|
2018-10-24 13:46:06 +00:00
|
|
|
return h('div', {
|
2017-10-07 09:49:30 +00:00
|
|
|
domProps: {
|
2018-10-09 12:07:23 +00:00
|
|
|
id: '<%= globals.id %>'
|
2017-10-07 09:49:30 +00:00
|
|
|
}
|
2019-09-05 15:15:27 +00:00
|
|
|
}, [
|
|
|
|
<% if (loading) { %>loadingEl, <% } %>
|
|
|
|
<% if (buildIndicator) { %>h(NuxtBuildIndicator), <% } %>
|
|
|
|
<% if (features.transitions) { %>transitionEl<% } else { %>templateEl<% } %>
|
|
|
|
])
|
2017-10-07 09:43:09 +00:00
|
|
|
},
|
2019-09-05 15:15:27 +00:00
|
|
|
<% if (features.clientOnline || features.layouts) { %>
|
2016-12-24 13:15:00 +00:00
|
|
|
data: () => ({
|
2019-09-05 15:15:27 +00:00
|
|
|
<% if (features.clientOnline) { %>
|
2018-12-28 16:27:03 +00:00
|
|
|
isOnline: true,
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } %>
|
|
|
|
<% if (features.layouts) { %>
|
2016-12-24 13:15:00 +00:00
|
|
|
layout: null,
|
2020-02-04 18:36:22 +00:00
|
|
|
layoutName: '',
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } %>
|
2020-02-04 18:36:22 +00:00
|
|
|
<% if (features.fetch) { %>
|
|
|
|
nbFetching: 0
|
|
|
|
<% } %>
|
|
|
|
}),
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } %>
|
2019-09-10 09:51:14 +00:00
|
|
|
beforeCreate () {
|
2017-10-13 21:53:04 +00:00
|
|
|
Vue.util.defineReactive(this, 'nuxt', this.$options.nuxt)
|
2017-08-14 22:58:45 +00:00
|
|
|
},
|
2019-09-10 09:51:14 +00:00
|
|
|
created () {
|
2017-08-14 22:58:45 +00:00
|
|
|
// Add this.$nuxt in child instances
|
2020-10-13 10:19:08 +00:00
|
|
|
this.$root.$options.<%= globals.nuxt %> = this
|
|
|
|
|
2018-12-28 16:27:03 +00:00
|
|
|
if (process.client) {
|
2020-05-07 19:08:01 +00:00
|
|
|
// add to window so we can listen when ready
|
2018-12-19 17:29:45 +00:00
|
|
|
window.<%= globals.nuxt %> = <%= (globals.nuxt !== '$nuxt' ? 'window.$nuxt = ' : '') %>this
|
2019-09-05 15:15:27 +00:00
|
|
|
<% if (features.clientOnline) { %>
|
2018-12-28 16:27:03 +00:00
|
|
|
this.refreshOnlineStatus()
|
|
|
|
// Setup the listeners
|
|
|
|
window.addEventListener('online', this.refreshOnlineStatus)
|
|
|
|
window.addEventListener('offline', this.refreshOnlineStatus)
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } %>
|
2017-08-14 22:58:45 +00:00
|
|
|
}
|
|
|
|
// Add $nuxt.error()
|
|
|
|
this.error = this.nuxt.error
|
2019-08-07 13:12:02 +00:00
|
|
|
// Add $nuxt.context
|
|
|
|
this.context = this.$options.context
|
2017-08-14 22:58:45 +00:00
|
|
|
},
|
2020-05-07 19:08:01 +00:00
|
|
|
<% if (loading || isFullStatic) { %>
|
|
|
|
async mounted () {
|
|
|
|
<% if (loading) { %>this.$loading = this.$refs.loading<% } %>
|
|
|
|
<% if (isFullStatic) {%>
|
|
|
|
if (this.isPreview) {
|
|
|
|
if (this.$store && this.$store._actions.nuxtServerInit) {
|
|
|
|
<% if (loading) { %>this.$loading.start()<% } %>
|
2020-06-12 17:41:41 +00:00
|
|
|
await this.$store.dispatch('nuxtServerInit', this.context)
|
2020-05-07 19:08:01 +00:00
|
|
|
}
|
|
|
|
await this.refresh()
|
|
|
|
<% if (loading) { %>this.$loading.finish()<% } %>
|
|
|
|
}
|
|
|
|
<% } %>
|
2017-01-30 10:20:20 +00:00
|
|
|
},
|
2020-05-07 19:08:01 +00:00
|
|
|
<% } %>
|
2017-08-14 22:58:45 +00:00
|
|
|
watch: {
|
|
|
|
'nuxt.err': 'errorChanged'
|
2017-08-10 10:37:23 +00:00
|
|
|
},
|
2019-09-05 15:15:27 +00:00
|
|
|
<% if (features.clientOnline) { %>
|
2018-12-28 16:27:03 +00:00
|
|
|
computed: {
|
2019-09-10 09:51:14 +00:00
|
|
|
isOffline () {
|
2018-12-28 16:27:03 +00:00
|
|
|
return !this.isOnline
|
2020-02-04 18:36:22 +00:00
|
|
|
},
|
|
|
|
<% if (features.fetch) { %>
|
2020-05-07 19:08:01 +00:00
|
|
|
isFetching () {
|
2020-02-04 18:36:22 +00:00
|
|
|
return this.nbFetching > 0
|
2020-05-07 19:08:01 +00:00
|
|
|
},<% } %>
|
|
|
|
<% if (nuxtOptions.target === 'static') { %>
|
|
|
|
isPreview () {
|
|
|
|
return Boolean(this.$options.previewData)
|
|
|
|
},<% } %>
|
2018-12-28 16:27:03 +00:00
|
|
|
},
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } %>
|
2016-12-24 00:55:32 +00:00
|
|
|
methods: {
|
2019-09-10 09:51:14 +00:00
|
|
|
<%= isTest ? '/* eslint-disable comma-dangle */' : '' %>
|
2019-09-05 15:15:27 +00:00
|
|
|
<% if (features.clientOnline) { %>
|
2019-09-10 09:51:14 +00:00
|
|
|
refreshOnlineStatus () {
|
2018-12-28 16:27:03 +00:00
|
|
|
if (process.client) {
|
|
|
|
if (typeof window.navigator.onLine === 'undefined') {
|
|
|
|
// If the browser doesn't support connection status reports
|
|
|
|
// assume that we are online because most apps' only react
|
|
|
|
// when they now that the connection has been interrupted
|
|
|
|
this.isOnline = true
|
|
|
|
} else {
|
|
|
|
this.isOnline = window.navigator.onLine
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } %>
|
2019-09-10 09:51:14 +00:00
|
|
|
async refresh () {
|
2019-09-05 15:15:27 +00:00
|
|
|
<% if (features.asyncData || features.fetch) { %>
|
2019-08-07 13:12:02 +00:00
|
|
|
const pages = getMatchedComponentsInstances(this.$route)
|
|
|
|
|
|
|
|
if (!pages.length) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
<% if (loading) { %>this.$loading.start()<% } %>
|
2019-09-05 15:15:27 +00:00
|
|
|
|
2019-09-10 09:51:14 +00:00
|
|
|
const promises = pages.map((page) => {
|
2019-08-07 13:12:02 +00:00
|
|
|
const p = []
|
|
|
|
|
2019-09-05 15:15:27 +00:00
|
|
|
<% if (features.fetch) { %>
|
2020-02-04 18:36:22 +00:00
|
|
|
// Old fetch
|
|
|
|
if (page.$options.fetch && page.$options.fetch.length) {
|
2019-08-07 13:12:02 +00:00
|
|
|
p.push(promisify(page.$options.fetch, this.context))
|
|
|
|
}
|
2020-02-04 18:36:22 +00:00
|
|
|
if (page.$fetch) {
|
|
|
|
p.push(page.$fetch())
|
|
|
|
} else {
|
|
|
|
// Get all component instance to call $fetch
|
|
|
|
for (const component of getChildrenComponentInstancesUsingFetch(page.$vnode.componentInstance)) {
|
|
|
|
p.push(component.$fetch())
|
|
|
|
}
|
|
|
|
}
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } %>
|
|
|
|
<% if (features.asyncData) { %>
|
2019-08-07 13:12:02 +00:00
|
|
|
if (page.$options.asyncData) {
|
|
|
|
p.push(
|
|
|
|
promisify(page.$options.asyncData, this.context)
|
|
|
|
.then((newData) => {
|
|
|
|
for (const key in newData) {
|
|
|
|
Vue.set(page.$data, key, newData[key])
|
|
|
|
}
|
|
|
|
})
|
|
|
|
)
|
|
|
|
}
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } %>
|
2019-08-07 13:12:02 +00:00
|
|
|
return Promise.all(p)
|
|
|
|
})
|
|
|
|
try {
|
|
|
|
await Promise.all(promises)
|
|
|
|
} catch (error) {
|
2020-02-03 15:41:37 +00:00
|
|
|
<% if (loading) { %>this.$loading.fail(error)<% } %>
|
2019-08-07 13:12:02 +00:00
|
|
|
globalHandleError(error)
|
|
|
|
this.error(error)
|
|
|
|
}
|
|
|
|
<% if (loading) { %>this.$loading.finish()<% } %>
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } %>
|
2019-08-07 13:12:02 +00:00
|
|
|
},
|
2020-09-09 10:32:10 +00:00
|
|
|
<% if (splitChunks.layouts) { %>async <% } %>errorChanged () {
|
|
|
|
if (this.nuxt.err) {
|
|
|
|
<% if (loading) { %>
|
|
|
|
if (this.$loading) {
|
|
|
|
if (this.$loading.fail) {
|
|
|
|
this.$loading.fail(this.nuxt.err)
|
|
|
|
}
|
|
|
|
if (this.$loading.finish) {
|
|
|
|
this.$loading.finish()
|
|
|
|
}
|
2019-09-10 09:51:14 +00:00
|
|
|
}
|
2020-09-09 10:32:10 +00:00
|
|
|
<% } %>
|
|
|
|
let errorLayout = (NuxtError.options || NuxtError).layout;
|
|
|
|
|
|
|
|
if (typeof errorLayout === 'function') {
|
|
|
|
errorLayout = errorLayout(this.context)
|
2019-09-10 09:51:14 +00:00
|
|
|
}
|
2020-09-09 10:32:10 +00:00
|
|
|
<% if (splitChunks.layouts) { %>
|
|
|
|
await this.loadLayout(errorLayout)
|
|
|
|
<% } %>
|
|
|
|
this.setLayout(errorLayout)
|
2017-08-14 22:58:45 +00:00
|
|
|
}
|
|
|
|
},
|
2019-09-05 15:15:27 +00:00
|
|
|
<% if (features.layouts) { %>
|
2018-03-19 18:40:33 +00:00
|
|
|
<% if (splitChunks.layouts) { %>
|
2019-09-10 09:51:14 +00:00
|
|
|
setLayout (layout) {
|
2018-10-20 19:47:47 +00:00
|
|
|
<% if (debug) { %>
|
2019-09-10 09:51:14 +00:00
|
|
|
if(layout && typeof layout !== 'string') {
|
|
|
|
throw new Error('[nuxt] Avoid using non-string value as layout property.')
|
|
|
|
}
|
2018-10-20 19:47:47 +00:00
|
|
|
<% } %>
|
2019-09-10 09:51:14 +00:00
|
|
|
if (!layout || !resolvedLayouts['_' + layout]) {
|
|
|
|
layout = 'default'
|
|
|
|
}
|
2016-12-24 13:15:00 +00:00
|
|
|
this.layoutName = layout
|
2016-12-24 11:34:41 +00:00
|
|
|
let _layout = '_' + layout
|
2017-08-07 07:11:47 +00:00
|
|
|
this.layout = resolvedLayouts[_layout]
|
2017-02-20 22:11:34 +00:00
|
|
|
return this.layout
|
2016-12-24 11:34:41 +00:00
|
|
|
},
|
2019-09-10 09:51:14 +00:00
|
|
|
loadLayout (layout) {
|
2018-08-06 00:12:44 +00:00
|
|
|
const undef = !layout
|
2018-12-12 06:31:49 +00:00
|
|
|
const nonexistent = !(layouts['_' + layout] || resolvedLayouts['_' + layout])
|
|
|
|
let _layout = '_' + ((undef || nonexistent) ? 'default' : layout)
|
2017-08-07 06:21:03 +00:00
|
|
|
if (resolvedLayouts[_layout]) {
|
|
|
|
return Promise.resolve(resolvedLayouts[_layout])
|
2017-02-20 22:11:34 +00:00
|
|
|
}
|
2016-12-24 11:34:41 +00:00
|
|
|
return layouts[_layout]()
|
2018-03-13 14:36:49 +00:00
|
|
|
.then((Component) => {
|
|
|
|
resolvedLayouts[_layout] = Component
|
|
|
|
delete layouts[_layout]
|
|
|
|
return resolvedLayouts[_layout]
|
|
|
|
})
|
|
|
|
.catch((e) => {
|
2018-10-09 12:07:23 +00:00
|
|
|
if (this.<%= globals.nuxt %>) {
|
|
|
|
return this.<%= globals.nuxt %>.error({ statusCode: 500, message: e.message })
|
2018-03-13 14:36:49 +00:00
|
|
|
}
|
|
|
|
})
|
2020-05-07 19:08:01 +00:00
|
|
|
},
|
2018-03-13 14:36:49 +00:00
|
|
|
<% } else { %>
|
2019-09-10 09:51:14 +00:00
|
|
|
setLayout (layout) {
|
2018-10-20 19:47:47 +00:00
|
|
|
<% if (debug) { %>
|
2019-09-10 09:51:14 +00:00
|
|
|
if(layout && typeof layout !== 'string') {
|
|
|
|
throw new Error('[nuxt] Avoid using non-string value as layout property.')
|
|
|
|
}
|
2018-10-20 19:47:47 +00:00
|
|
|
<% } %>
|
2018-08-06 00:12:44 +00:00
|
|
|
if (!layout || !layouts['_' + layout]) {
|
|
|
|
layout = 'default'
|
|
|
|
}
|
2018-03-13 14:36:49 +00:00
|
|
|
this.layoutName = layout
|
|
|
|
this.layout = layouts['_' + layout]
|
|
|
|
return this.layout
|
|
|
|
},
|
2019-09-10 09:51:14 +00:00
|
|
|
loadLayout (layout) {
|
2018-08-06 00:12:44 +00:00
|
|
|
if (!layout || !layouts['_' + layout]) {
|
|
|
|
layout = 'default'
|
|
|
|
}
|
2018-03-13 14:36:49 +00:00
|
|
|
return Promise.resolve(layouts['_' + layout])
|
2020-05-07 19:08:01 +00:00
|
|
|
},
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } /* splitChunks.layouts */ %>
|
|
|
|
<% } /* features.layouts */ %>
|
2020-05-07 19:08:01 +00:00
|
|
|
<% if (isFullStatic) { %>
|
2020-11-25 14:19:29 +00:00
|
|
|
getRouterBase() {
|
2020-12-17 11:51:14 +00:00
|
|
|
return withoutTrailingSlash(this.$router.options.base)
|
2020-11-25 14:19:29 +00:00
|
|
|
},
|
|
|
|
getRoutePath(route = '/') {
|
|
|
|
const base = this.getRouterBase()
|
|
|
|
if (base && route.startsWith(base)) {
|
|
|
|
route = route.substr(base.length)
|
|
|
|
}
|
2020-12-17 11:51:14 +00:00
|
|
|
let path = parsePath(route).pathname
|
|
|
|
<% if (!nuxtOptions.router.trailingSlash) { %>
|
|
|
|
path = withoutTrailingSlash(path)
|
|
|
|
<% } %>
|
|
|
|
return path || '/'
|
2020-11-25 14:19:29 +00:00
|
|
|
},
|
|
|
|
getStaticAssetsPath(route = '/') {
|
|
|
|
const { staticAssetsBase } = window.<%= globals.context %>
|
|
|
|
|
2020-12-17 11:51:14 +00:00
|
|
|
return urlJoin(staticAssetsBase, withoutTrailingSlash(this.getRoutePath(route)))
|
2020-11-25 14:19:29 +00:00
|
|
|
},
|
|
|
|
<% if (nuxtOptions.generate.manifest) { %>
|
|
|
|
async fetchStaticManifest() {
|
2021-02-02 12:38:54 +00:00
|
|
|
return window.__NUXT_IMPORT__('manifest.js', normalizeURL(urlJoin(this.getStaticAssetsPath(), 'manifest.js')))
|
2020-11-25 14:19:29 +00:00
|
|
|
},
|
|
|
|
<% } %>
|
2020-05-07 19:08:01 +00:00
|
|
|
setPagePayload(payload) {
|
|
|
|
this._pagePayload = payload
|
2020-12-17 11:49:59 +00:00
|
|
|
this._fetchCounters = {}
|
2020-05-07 19:08:01 +00:00
|
|
|
},
|
2021-01-27 10:26:34 +00:00
|
|
|
async fetchPayload(route, prefetch) {
|
2020-11-25 14:19:29 +00:00
|
|
|
<% if (nuxtOptions.generate.manifest) { %>
|
|
|
|
const manifest = await this.fetchStaticManifest()
|
|
|
|
const path = this.getRoutePath(route)
|
2021-02-02 12:38:54 +00:00
|
|
|
if (!manifest.routes.includes(decodeURI(path))) {
|
2021-01-27 10:26:34 +00:00
|
|
|
if (!prefetch) { this.setPagePayload(false) }
|
2020-11-25 14:19:29 +00:00
|
|
|
throw new Error(`Route ${path} is not pre-rendered`)
|
2020-06-10 07:51:29 +00:00
|
|
|
}
|
2020-11-25 14:19:29 +00:00
|
|
|
<% } %>
|
|
|
|
const src = urlJoin(this.getStaticAssetsPath(route), 'payload.js')
|
2020-05-07 19:08:01 +00:00
|
|
|
try {
|
2021-02-02 12:38:54 +00:00
|
|
|
const payload = await window.__NUXT_IMPORT__(decodeURI(route), normalizeURL(src))
|
2021-01-27 10:26:34 +00:00
|
|
|
if (!prefetch) { this.setPagePayload(payload) }
|
2020-05-07 19:08:01 +00:00
|
|
|
return payload
|
|
|
|
} catch (err) {
|
2021-01-27 10:26:34 +00:00
|
|
|
if (!prefetch) { this.setPagePayload(false) }
|
2020-05-07 19:08:01 +00:00
|
|
|
throw err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<% } %>
|
2017-01-30 10:20:20 +00:00
|
|
|
},
|
2019-09-05 15:15:27 +00:00
|
|
|
<% if (loading) { %>
|
2017-01-30 10:20:20 +00:00
|
|
|
components: {
|
2019-09-05 15:15:27 +00:00
|
|
|
NuxtLoading
|
2016-12-24 00:55:32 +00:00
|
|
|
}
|
2019-09-05 15:15:27 +00:00
|
|
|
<% } %>
|
2019-09-10 09:51:14 +00:00
|
|
|
<%= isTest ? '/* eslint-enable comma-dangle */' : '' %>
|
2016-12-24 00:55:32 +00:00
|
|
|
}
|