'Where do I put these props for this component?
The answers say the same as what I've tried, so the answer is the component doesn't work.
I'm trying to use this component https://www.npmjs.com/package/@mtcmedia/vue-tabs-accordion
It's working but I want to add props that it suggests
Props The component accepts these props:
mode: String. Default: 'accordion' Can be set as 'tabs ' responsive: Object. Define mode for certain window widths This component is mobile first.
{ 640: { mode: 'tabs' }, 1200: { mode: 'accordion' } }
however it doesn't say where to put them. I have tried various things in main.js such as
Vue.component('MtcTabsAccordion', props: [
responsive:{
640: {
mode: 'tabs'
},
1200: {
mode: 'accordion'
}
}
]);
I tried adding them as MtcTabsAccordionProps in the export default data, and adding :responsive="MtcTabsAccordionProps" in the component 's attributes but it just outputted in the HTML as responsive="[Object]".
I've tried adding them to the export default props, but I can't imagine they should be there are the keys "responsive" and "mode" are too non-specific and would clash with others.
Where am I supposed to add the props?
Solution 1:[1]
These are the props it accepts when using it:
<mtc-tabs-accordion:mode="mode" :responsive="responsive">
...
</mtc-tabs-accordion>
you can define mode and responsive in data or setup if you are using Vue3.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mirko t. |
