[improvement] rename packages dir to src (#3659)

This commit is contained in:
neverland
2019-06-27 11:25:57 +08:00
committed by GitHub
parent 8489918dca
commit 75c79b7044
619 changed files with 21 additions and 21 deletions

37
src/collapse/index.js Normal file
View File

@@ -0,0 +1,37 @@
import { createNamespace } from '../utils';
import { ParentMixin } from '../mixins/relation';
const [createComponent, bem] = createNamespace('collapse');
export default createComponent({
mixins: [ParentMixin('vanCollapse')],
props: {
accordion: Boolean,
value: [String, Number, Array],
border: {
type: Boolean,
default: true
}
},
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.border }]}>
{this.slots()}
</div>
);
}
});