disallow
window/document
increated/beforeCreate
- ⚙️ This rule is included in
"plugin:nuxt/base"
.
This rule is for preventing using window/document
in created/beforeCreate
, since created/beforeCreate
may be executed in server side in SSR.
Examples of incorrect code for this rule:
export default {
created() {
window.foo = 'bar'
}
}
Examples of correct code for this rule:
export default {
created() {
const foo = 'bar'
}
}