[new feature] Swipe: support custom item width & height (#1664)

This commit is contained in:
xliez
2018-08-22 16:03:49 +08:00
committed by neverland
parent c96ef7cc47
commit ed2911f667
6 changed files with 65 additions and 8 deletions

View File

@@ -18,10 +18,11 @@ export default create({
computed: {
style() {
const { vertical, width, height } = this.$parent;
const { vertical, computedWidth, computedHeight } = this.$parent;
return {
width: width + 'px',
height: vertical ? height + 'px' : '100%',
width: computedWidth + 'px',
height: vertical ? computedHeight + 'px' : '100%',
transform: `translate${vertical ? 'Y' : 'X'}(${this.offset}px)`
};
}