mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
* [Document] add english document of Checkbox * [Document] add english document of Field * [Document] add english document of NumberKeyboard * [bugfix] NumberKeyboard should not dispaly title when title is empty * [Document] add english document of PasswordInput * [Document] add english document of Radio * [document] add english document of Switch * [bugfix] remove redundent styles in english document * [Document] fix details * fix Switch test cases * [bugfix] Swipe shouid reinitialize when item changes * [new feature] ImagePreview reconstruct * [new feature] add Tabbar component
35 lines
530 B
Vue
35 lines
530 B
Vue
<template>
|
|
<div class="van-swipe-item" :style="style">
|
|
<slot></slot>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'van-swipe-item',
|
|
|
|
data() {
|
|
return {
|
|
offset: 0
|
|
};
|
|
},
|
|
|
|
computed: {
|
|
style() {
|
|
return {
|
|
width: this.$parent.width + 'px',
|
|
transform: `translate3d(${this.offset}px, 0, 0)`
|
|
};
|
|
}
|
|
},
|
|
|
|
beforeCreate() {
|
|
this.$parent.swipes.push(this);
|
|
},
|
|
|
|
destroyed() {
|
|
this.$parent.swipes.splice(this.$parent.swipes.indexOf(this), 1);
|
|
}
|
|
};
|
|
</script>
|