UNPKG

lulouis-vant

Version:

Lightweight Mobile UI Components built on Vue

33 lines (27 loc) 647 B
import { use } from '../utils'; const [sfc, bem] = use('collapse'); export default sfc({ props: { accordion: Boolean, value: [String, Number, Array] }, data() { return { items: [] }; }, methods: { switch(name, expanded) { if (!this.accordion) { name = expanded ? this.value.concat(name) : this.value.filter(activeName => activeName !== name); } this.$emit('change', name); this.$emit('input', name); } }, render(h) { return <div class={[bem(), 'van-hairline--top-bottom']}>{this.$slots.default}</div>; } });