[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
+35
View File
@@ -0,0 +1,35 @@
import { createNamespace } from '../utils';
const [createComponent, bem] = createNamespace('swipe-item');
export default createComponent({
data() {
return {
offset: 0
};
},
beforeCreate() {
this.$parent.swipes.push(this);
},
destroyed() {
this.$parent.swipes.splice(this.$parent.swipes.indexOf(this), 1);
},
render(h) {
const { vertical, computedWidth, computedHeight } = this.$parent;
const style = {
width: computedWidth + 'px',
height: vertical ? computedHeight + 'px' : '100%',
transform: `translate${vertical ? 'Y' : 'X'}(${this.offset}px)`
};
return (
<div class={bem()} style={style} {...{ on: this.$listeners }}>
{this.slots()}
</div>
);
}
});
+6
View File
@@ -0,0 +1,6 @@
@import '../style/var';
.van-swipe-item {
float: left;
height: 100%;
}