
Product
Introducing Socket MCP for Claude Desktop
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
vue-badger-accordion
Advanced tools
Badger-Accordion Component for Vue 2.0
This package is a wrapper for the badger-accordion made by Stuart Nelson
Badger-Accordion-Repository:
https://github.com/stuartjnelson/badger-accordion
npm install vue-badger-accordion --save
import { BadgerAccordion, BadgerAccordionItem } from 'vue-badger-accordion'
Vue.component('BadgerAccordion', BadgerAccordion)
Vue.component('BadgerAccordionItem', BadgerAccordionItem)
export default {
components: {
BadgerAccordion,
BadgerAccordionItem
}
}
<badger-accordion>
<badger-accordion-item>
<template slot="header">First Accordion Header</template>
<template slot="content">First Accordion Content</template>
</badger-accordion-item>
<badger-accordion-item>
<template slot="header">Second Accordion Header</template>
<template slot="content">Second Accordion Content</template>
</badger-accordion-item>
</badger-accordion>
Note: You can replace the template-tag with all regular html-tags, just remember to add the slot-parameter.
Options can be implemented by component property "option".
<badger-accordion :options="{...}">
...
</badger-accordion>
A list of available options could be found in the badger-accordion repository
https://github.com/stuartjnelson/badger-accordion#options
You can handle open/close-Events for each AccordionItem
<badger-accordion>
<badger-accordion-item @open="onOpenItem" @close="onCloseItem">
<template slot="header">First Accordion Header</template>
<template slot="content">First Accordion Content</template>
</badger-accordion-item>
</badger-accordion>
methods: {
...
onOpenItem() {
// Item opened
},
onCloseItem() {
// Item closed
}
}
Thanks to elbojoloco for that change.
By default the Accordion-Header shows an state-indicator (+/-). You can easily disable or replace them with images or your favorite icon-font by set the icon-property.
with font-library e.g. font-awesome
<badger-accordion :icons="{opened: '<i class="fas fa-chevron-down"></i>',
closed: '<i class="fas fa-chevron-up"></i>'}">
with images
<badger-accordion :icons="{opened: '<img src="opened.png" />', closed: '<img
src="closed.png"
/>'}">
Sometimes you may want greater control of your the state icon renders. In this case you can pass a vue component in directly to the badger accordion:
const MyComponent = {
template: `
<span class="my-icon">{{ opened ? 'I am open' : ' I am closed' }}</span>
`,
props: {
opened: {
type: Boolean,
default: false
}
}
}
export default {
components: {
BadgerAccodion,
BadgerAccordionItem
},
data() {
return {
iconComponent: MyComponent
}
}
}
<badger-accordion iconComponent="iconComponent"></badger-accordion>
<badger-accordion :icons="false"></badger-accordion>
All Methods of badger-accordion are also available. Just add a ref to you accordion and you can access them.
<badger-accordion ref="myAccordion"></badger-accordion>
this.$refs.myAccordion.open(0)
A list of available methods could be found in the badger-accordion repository
FAQs
Badger-Accordion Component for Vue
The npm package vue-badger-accordion receives a total of 406 weekly downloads. As such, vue-badger-accordion popularity was classified as not popular.
We found that vue-badger-accordion demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.