chore(Swipe): use relation mixin
This commit is contained in:
@@ -1,24 +1,19 @@
|
||||
import { createNamespace } from '../utils';
|
||||
import { ChildrenMixin } from '../mixins/relation';
|
||||
|
||||
const [createComponent, bem] = createNamespace('swipe-item');
|
||||
|
||||
export default createComponent({
|
||||
mixins: [ChildrenMixin('vanSwipe')],
|
||||
|
||||
data() {
|
||||
return {
|
||||
offset: 0,
|
||||
};
|
||||
},
|
||||
|
||||
beforeCreate() {
|
||||
this.$parent.swipes.push(this);
|
||||
},
|
||||
|
||||
destroyed() {
|
||||
this.$parent.swipes.splice(this.$parent.swipes.indexOf(this), 1);
|
||||
},
|
||||
|
||||
render() {
|
||||
const { vertical, computedWidth, computedHeight } = this.$parent;
|
||||
const { vertical, computedWidth, computedHeight } = this.parent;
|
||||
|
||||
const style = {
|
||||
width: computedWidth + 'px',
|
||||
|
||||
Reference in New Issue
Block a user