diff --git a/docs/rules/order-in-components.md b/docs/rules/order-in-components.md index 4c9d4b2a1..81708c9f1 100644 --- a/docs/rules/order-in-components.md +++ b/docs/rules/order-in-components.md @@ -74,8 +74,12 @@ export default { "mixins", ["provide", "inject"], "ROUTER_GUARDS", + "layout", "middleware", "validate", + "scrollToTop", + "transition", + "loading", "inheritAttrs", "model", ["props", "propsData"], @@ -84,18 +88,14 @@ export default { "fetch", "asyncData", "data", + "head", "computed", "watch", "watchQuery", "LIFECYCLE_HOOKS", "methods", - "head", - "layout", ["template", "render"], - "renderError", - "transition", - "loading", - "scrollToTop" + "renderError" ] }] } diff --git a/lib/rules/order-in-components.js b/lib/rules/order-in-components.js index 36bc6a62e..29c34f26d 100644 --- a/lib/rules/order-in-components.js +++ b/lib/rules/order-in-components.js @@ -30,10 +30,14 @@ const defaultOrder = [ 'mixins', ['provide', 'inject'], // for Vue.js 2.2.0+ - // Page Validation (determines if the router request is suitable) + // Page Options (component rendered as a router page) 'ROUTER_GUARDS', // for Vue Router + 'layout', // for Nuxt 'middleware', // for Nuxt 'validate', // for Nuxt + 'scrollToTop', // for Nuxt + 'transition', // for Nuxt + 'loading', // for Nuxt // Interface (the interface to the component) 'inheritAttrs', @@ -51,6 +55,7 @@ const defaultOrder = [ 'fetch', // for Nuxt 'asyncData', // for Nuxt 'data', + 'head', // for Nuxt 'computed', // Events (callbacks triggered by reactive events) @@ -62,13 +67,8 @@ const defaultOrder = [ 'methods', // Rendering (the declarative description of the component output) - 'head', // for Nuxt - 'layout', // for Nuxt ['template', 'render'], - 'renderError', - 'transition', // for Nuxt - 'loading', // for Nuxt - 'scrollToTop' // for Nuxt + 'renderError' ] const groups = {