Pattern: Use of window/document
in created/beforeCreate
Issue: -
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'
}
}