mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-06 21:10:38 +00:00
Fix Maximum Call Size Stack
This commit is contained in:
parent
db118f1b65
commit
b49713a096
@ -11,16 +11,16 @@ if (process.browser) {
|
||||
}
|
||||
}
|
||||
|
||||
export function applyAsyncData (Component, asyncData = {}) {
|
||||
export function applyAsyncData (Component, asyncData) {
|
||||
const ComponentData = Component.options.data || noopData
|
||||
// Prevent calling this method for each request on SSR context
|
||||
if(!asyncData && Component.options.hasAsyncData) {
|
||||
if (!asyncData && Component.options.hasAsyncData) {
|
||||
return
|
||||
}
|
||||
Component.options.hasAsyncData = true
|
||||
Component.options.data = function () {
|
||||
const data = ComponentData.call(this)
|
||||
if(this.$ssrContext) {
|
||||
if (this.$ssrContext) {
|
||||
asyncData = this.$ssrContext.asyncData[Component.cid]
|
||||
}
|
||||
return { ...data, ...asyncData }
|
||||
|
Loading…
Reference in New Issue
Block a user