Node.js/nuxt/asyncData:修订间差异
来自康健生活
| 第1行: | 第1行: | ||
== 引用 == | == 引用 == | ||
asyncData 参数只在页面组件中有效。 | asyncData 参数只在页面组件中有效。 | ||
=== ctx === | |||
<syntaxhighlight lang="javascript"> | |||
asyncData (ctx) { | |||
// todo | |||
},</syntaxhighlight> | |||
* $axios: (...) | |||
* $config: (...) | |||
* $cookies: (...) | |||
* $errorHandler: (...) | |||
* app: (...) | |||
* base: (...) | |||
* env: (...) | |||
* error: (...) | |||
* from: (...) | |||
* isDev: (...) | |||
* isHMR: (...) | |||
* isStatic: (...) | |||
* next: (...) | |||
* nuxtState: (...) | |||
* params: (...) | |||
* payload: (...) | |||
* query: (...) | |||
* redirect: (...) | |||
* route: (...) | |||
* store: (...) | |||
* _errored: (...) | |||
* _redirected: (...) | |||
== data == | == data == | ||
在 asyncData 中获取数据,return 的数据,nuxt 会自动混入到 data 中。 | 在 asyncData 中获取数据,return 的数据,nuxt 会自动混入到 data 中。 | ||