mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-09-08 17:06:21 +08:00
parent
ee3bf31ff2
commit
b7296af46f
@ -3,6 +3,7 @@ import { touch } from '../mixins/touch';
|
|||||||
import { Weapp } from 'definitions/weapp';
|
import { Weapp } from 'definitions/weapp';
|
||||||
|
|
||||||
const THRESHOLD = 0.3;
|
const THRESHOLD = 0.3;
|
||||||
|
let ARRAY: WechatMiniprogram.Component.TrivialInstance[] = [];
|
||||||
|
|
||||||
VantComponent({
|
VantComponent({
|
||||||
props: {
|
props: {
|
||||||
@ -30,6 +31,11 @@ VantComponent({
|
|||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.offset = 0;
|
this.offset = 0;
|
||||||
|
ARRAY.push(this);
|
||||||
|
},
|
||||||
|
|
||||||
|
destroyed() {
|
||||||
|
ARRAY = ARRAY.filter(item => item !== this);
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -80,6 +86,12 @@ VantComponent({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ARRAY.forEach(item => {
|
||||||
|
if (item !== this) {
|
||||||
|
item.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.draging = true;
|
this.draging = true;
|
||||||
this.startOffset = this.offset;
|
this.startOffset = this.offset;
|
||||||
this.firstDirection = '';
|
this.firstDirection = '';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user