What are the best practices / preferred structure of a Vue file? #9780
Unanswered
wsw70
asked this question in
Help/Questions
Replies: 1 comment
-
I always structure my Vue files as template - script - style, with styles at the end if they're included. btw.. even though template - script - style is common, there isn't a simple way to enforce this automatically. You might try some complex Prettier setups, but ESLint doesn’t directly support enforcing the order, at least as far as I know. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I used to structure my Vue file as "template - script - CSS". I noticed however that new bootstrapped projects now follow the structure "script - template - CSS".
Is there a convention (best practices, coding guide, ...) about the structure of the file?
Note: I know of course that it ultimately does not matter and that the code is not faster (or better compressed or whatever other idea someone may have) just because of the order. But since this does not require special accommodations, better follow the "standard".
Beta Was this translation helpful? Give feedback.
All reactions