fix(Swipe): active may outrange when initialize (#8061)

This commit is contained in:
neverland
2021-02-02 19:58:15 +08:00
committed by GitHub
parent 1644fc1338
commit 8ac3f43189
2 changed files with 4 additions and 5 deletions
+1 -3
View File
@@ -81,12 +81,10 @@ export default createComponent({
const resize = () => {
if (swipeRef.value) {
const { startPosition } = props;
swipeRef.value.state.active = +startPosition;
swipeRef.value.resize();
const rect = swipeRef.value.$el.getBoundingClientRect();
state.rootWidth = rect.width;
state.rootHeight = rect.height;
swipeRef.value.resize();
}
};