Name for component?
See original GitHub issueNot sure if we are doing something wrong or is a bug on vue, let me explain:
When we create a component we usually add ‘Component’ to the name, for example:
export class SwitchButtonBoxComponent extends SwitchButtonComponent {}
When we add this component to his parent the only way that we’ve found to change his tag name is:
@Component({
components: {
'switch-button-box': SwitchButtonBoxComponent
}
})
We have to do that because we don’t want the ‘Component’ word on the tag name (I think is a normal thing)
But this is not the best scenario, we’ve tried that:
export class SwitchButtonBoxComponent extends SwitchButtonComponent {
name: 'switch-button-box'
}
and on the other side
@Component({
components: {
SwitchButtonBoxComponent
}
})
But is not working, is there any alternative or suggestion?
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
25 Synonyms & Antonyms for COMPONENT - Thesaurus.com
synonyms for component · basic · composing · fundamental · integral · elemental · inherent · intrinsic · part and parcel of ...
Read more >What is another word for component? - WordHippo
What is another word for component? ; offshoot · rudiment ; parameter · article ; slab · clause ; criterion · constraint ;...
Read more >Best 47 synonyms for component - Thesaurus - YourDictionary
Synonyms for COMPONENT: element, basic, composing, segment, unit, constituent, ingredient, regenerator, resistor, elemental, building block, piece, portion, ...
Read more >Name and organize components - Figma Help Center
We recommend defining and documenting a component structure within your team or company. This will make it easier to find components in the...
Read more >Component names - Striim
Components cannot be renamed. In the Flow Designer, you can copy a component and give it a new name.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Why can’t we use this approach? (taken from “vue-class-component”)
import Vue from “vue”; import Component from “vue-class-component”; @Component({ name: “AnotherName” }) export default class YourName extends Vue { }
@CKGrafico
Hi.
Here is an explanation of
name
option. https://vuejs.org/v2/api/#nameVue components don’t use it for defining their tag name, whereas Angular components do so.
Therefore, I recommend you to do like this below.