Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
falstack committed Dec 23, 2019
1 parent 6688b9d commit b4cc9a6
Show file tree
Hide file tree
Showing 371 changed files with 6,603 additions and 6,910 deletions.
19 changes: 11 additions & 8 deletions .nuxt/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ return (val ? `${val} - ${process.env.INJECT.title}` : `${process.env.INJECT.tit
render (h, props) {
const loadingEl = h('NuxtLoading', { ref: 'loading' })

if (this.nuxt.err && NuxtError.layout) {
this.setLayout(
typeof NuxtError.layout === 'function'
? NuxtError.layout(this.context)
: NuxtError.layout
)
if (this.nuxt.err && NuxtError) {
const errorLayout = (NuxtError.options || NuxtError).layout
if (errorLayout) {
this.setLayout(
typeof errorLayout === 'function'
? errorLayout.call(NuxtError, this.context)
: errorLayout
)
}
}

const layoutEl = h(this.layout || 'nuxt')
Expand All @@ -46,7 +49,7 @@ return (val ? `${val} - ${process.env.INJECT.title}` : `${process.env.INJECT.tit
id: '__layout'
},
key: this.layoutName
}, [ layoutEl ])
}, [layoutEl])

const transitionEl = h('transition', {
props: {
Expand All @@ -61,7 +64,7 @@ return (val ? `${val} - ${process.env.INJECT.title}` : `${process.env.INJECT.tit
})
}
}
}, [ templateEl ])
}, [templateEl])

return h('div', {
domProps: {
Expand Down
28 changes: 19 additions & 9 deletions .nuxt/axios.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Axios from 'axios'
import defu from 'defu'

// Axios.prototype cannot be modified
const axiosExtra = {
Expand Down Expand Up @@ -33,6 +34,9 @@ const axiosExtra = {
onError(fn) {
this.onRequestError(fn)
this.onResponseError(fn)
},
create(options) {
return createAxiosInstance(defu(options, this.defaults))
}
}

Expand All @@ -47,6 +51,20 @@ const extendAxiosInstance = axios => {
}
}

const createAxiosInstance = axiosOptions => {
// Create new axios instance
const axios = Axios.create(axiosOptions)
axios.CancelToken = Axios.CancelToken
axios.isCancel = Axios.isCancel

// Extend axios proto
extendAxiosInstance(axios)

// Setup interceptors

return axios
}

export default (ctx, inject) => {
// baseURL
const baseURL = process.browser
Expand Down Expand Up @@ -88,15 +106,7 @@ export default (ctx, inject) => {
axiosOptions.headers.common['accept-encoding'] = 'gzip, deflate'
}

// Create new axios instance
const axios = Axios.create(axiosOptions)
axios.CancelToken = Axios.CancelToken
axios.isCancel = Axios.isCancel

// Extend axios proto
extendAxiosInstance(axios)

// Setup interceptors
const axios = createAxiosInstance(axiosOptions)

// Inject axios to the context as $axios
ctx.$axios = axios
Expand Down
15 changes: 8 additions & 7 deletions .nuxt/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,11 @@ async function render (to, from, next) {
}

// Load layout for error page
const errorLayout = (NuxtError.options || NuxtError).layout
const layout = await this.loadLayout(
typeof NuxtError.layout === 'function'
? NuxtError.layout(app.context)
: NuxtError.layout
typeof errorLayout === 'function'
? errorLayout.call(NuxtError, app.context)
: errorLayout
)

await callMiddleware.call(this, Components, app.context, layout)
Expand All @@ -256,7 +257,7 @@ async function render (to, from, next) {
}

// Show error page
app.context.error({ statusCode: 404, message: `This page could not be found` })
app.context.error({ statusCode: 404, message: 'This page could not be found' })
return next()
}

Expand Down Expand Up @@ -322,7 +323,7 @@ async function render (to, from, next) {

// ...If .validate() returned false
if (!isValid) {
this.error({ statusCode: 404, message: `This page could not be found` })
this.error({ statusCode: 404, message: 'This page could not be found' })
return next()
}

Expand Down Expand Up @@ -415,7 +416,7 @@ async function render (to, from, next) {
globalHandleError(error)

// Load error layout
let layout = NuxtError.layout
let layout = (NuxtError.options || NuxtError).layout
if (typeof layout === 'function') {
layout = layout(app.context)
}
Expand Down Expand Up @@ -448,7 +449,7 @@ function showNextPage (to) {

// Set layout
let layout = this.$options.nuxt.err
? NuxtError.layout
? (NuxtError.options || NuxtError).layout
: to.matched[0].components.default.options.layout

if (typeof layout === 'function') {
Expand Down
2 changes: 1 addition & 1 deletion .nuxt/components/nuxt-build-indicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default {
computed: {
options: () => (false),
indicatorStyle () {
const [ d1, d2 ] = this.options.position.split('-')
const [d1, d2] = this.options.position.split('-')
return {
[d1]: '20px',
[d2]: '20px',
Expand Down
16 changes: 8 additions & 8 deletions .nuxt/components/nuxt-error.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ export default {
default: null
}
},
computed: {
statusCode () {
return (this.error && this.error.statusCode) || 500
},
message () {
return this.error.message || 'Error'
}
},
head () {
return {
title: this.message,
Expand All @@ -36,14 +44,6 @@ export default {
}
]
}
},
computed: {
statusCode () {
return (this.error && this.error.statusCode) || 500
},
message () {
return this.error.message || `Error`
}
}
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions .nuxt/components/nuxt-loading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ export default {
'nuxt-progress-failed': !this.canSucceed
},
style: {
'width': this.percent + '%',
'left': this.left
width: this.percent + '%',
left: this.left
}
})
}
Expand Down
Loading

0 comments on commit b4cc9a6

Please sign in to comment.