Vue template section should be divided into Block and element. #7551
Replies: 4 comments 3 replies
-
Thanks for this contribute, I really think that from now on I will use this technique. |
Beta Was this translation helpful? Give feedback.
-
@yyx990803 |
Beta Was this translation helpful? Give feedback.
-
Not everything is a section. A navbar should probably use the Your proposal seem highly situational and unnecessarily adds more ways to do the same thing. Adding your named section inside the template tag should do the trick. |
Beta Was this translation helpful? Give feedback.
-
In my past experience I have seen developers confusing how to divide the complex webpage into components. The situation varies but one thing is permanent, |
Beta Was this translation helpful? Give feedback.
-
As per standard approach of BEM, when dividing a webpage into Vue components it feels right to think of them as Block and Element.
It gives clear idea of dividing and reusing vue components.
Instead of manually defining in HTML, what if we put whole template section of component inside
with name attribute as component's name.
For e.g.
Post.vue and Navbar.vue can be represented in HTML as
And can be represented as
This feature will give 4 main benefits.
Thank you and have a nice day!
Beta Was this translation helpful? Give feedback.
All reactions