Vue components should be divided into Block and Element. #484
Replies: 3 comments 6 replies
-
What will this actually achieve? What will Vue do differently for the two different types? |
Beta Was this translation helpful? Give feedback.
-
@ahku
My personal belief is that a simple naming convention or Standarization could take the technology to new heights, |
Beta Was this translation helpful? Give feedback.
-
At least this naming convention should be used in docs to suggest, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What problem does this feature solve?
It is very difficult to find and debug block components when using framework like bootstrap-vue.
Also, some developers couldn't figure out basic strategy for separating webpage into components.
To solve this problem Vue components can follow standard BEM (Block, Element and Modifier) approach.
While Modifiers are already denoted by props,
Block and Element needs clear mention or declaration in Vue.
It will provide following benefits:
What does the proposed API look like?
The Vue component template should always accompanied by attribute "block" or "element".
If a Vue component has template section without any declaration,
Then it would be considered as block type by default.
Block type component
Element type component
Beta Was this translation helpful? Give feedback.
All reactions