Skip to content

Commit 27fc35c

Browse files
rchlota-meshi
authored andcommitted
chore: Keep Nuxt's 'asyncData' and 'fetch' with 'data' (#823)
* chore: Keep Nuxt's 'asyncData' and 'fetch' with 'data' Change the order of asyncData and fetch properties to be next to data property. All those are function-wise more or less equivalent so IMO it makes sense to keep them together. asyncData and fetch are primarily for setting up component's data. * Update order per review * Add also 'head' property * Change order of 'head'
1 parent d822a03 commit 27fc35c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: docs/rules/order-in-components.md

+3
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,14 @@ export default {
7474
"inheritAttrs",
7575
"model",
7676
["props", "propsData"],
77+
"fetch",
78+
"asyncData",
7779
"data",
7880
"computed",
7981
"watch",
8082
"LIFECYCLE_HOOKS",
8183
"methods",
84+
"head",
8285
["template", "render"],
8386
"renderError"
8487
]

Diff for: lib/rules/order-in-components.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ const defaultOrder = [
1919
'inheritAttrs',
2020
'model',
2121
['props', 'propsData'],
22+
'fetch',
23+
'asyncData',
2224
'data',
2325
'computed',
2426
'watch',
25-
'asyncData',
26-
'fetch',
2727
'LIFECYCLE_HOOKS',
2828
'methods',
29+
'head',
2930
['template', 'render'],
3031
'renderError'
3132
]

0 commit comments

Comments
 (0)