[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
+43
View File
@@ -0,0 +1,43 @@
import { createNamespace } from '../utils';
import Info from '../info';
import { ChildrenMixin } from '../mixins/relation';
const [createComponent, bem] = createNamespace('sidebar-item');
export default createComponent({
mixins: [ChildrenMixin('vanSidebar')],
props: {
url: String,
info: [String, Number],
title: String
},
computed: {
select() {
return this.index === +this.parent.activeKey;
}
},
methods: {
onClick() {
this.$emit('click', this.index);
this.parent.$emit('change', this.index);
}
},
render(h) {
return (
<a
href={this.url}
class={[bem({ select: this.select }), 'van-hairline']}
onClick={this.onClick}
>
<div class={bem('text')}>
{this.title}
<Info info={this.info} class={bem('info')} />
</div>
</a>
);
}
});