Skip to content

Commit

Permalink
fix: 🐛 修复Swiper在小程序里手动滑动时报错的和没有清除定时器的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaSearl committed Nov 17, 2020
1 parent 7f70782 commit 748ef45
Show file tree
Hide file tree
Showing 68 changed files with 11 additions and 14 deletions.
6 changes: 3 additions & 3 deletions components/swiper/swiper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ const InternalSwiper: React.FC<SwiperProps> = (props: SwiperProps) => {
};
getSwiperWidth();
return () => {
clearInterval(intervalId.current);
}
clearInterval(intervalId.current);
};
}, []);

// Seamless switching
Expand Down Expand Up @@ -283,7 +283,7 @@ const InternalSwiper: React.FC<SwiperProps> = (props: SwiperProps) => {
if (childrenArray.length <= 1) {
return;
}
const touch = e.changedTouches[0];
const touch = e.changedTouches[0] || e.nativeEvent.changedTouches[0];
const diff = (vertical ? touch.pageY : touch.pageX) - startPoint.current;
const speed = diff / (Date.now() - startTime.current);
const harfSideLength = sideLength.current / 2;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "annar",
"version": "2.0.5",
"version": "2.0.6",
"description": "优雅、简洁的 Remax 组件库",
"main": "web/index.js",
"esnext": "esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion site/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
window.routerBase = "/annar";
</script>
<script>
//! umi version: 3.2.3
//! umi version: 3.2.24
</script>
<title>Annar</title>
</head>
Expand Down
2 changes: 1 addition & 1 deletion site/_demos/:uuid/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
window.routerBase = "/annar";
</script>
<script>
//! umi version: 3.2.3
//! umi version: 3.2.24
</script>
<title>Annar</title>
</head>
Expand Down
7 changes: 2 additions & 5 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,9 @@
window.routerBase = "/annar";
</script>
<script>
//! umi version: 3.2.3
//! umi version: 3.2.24
</script>
<title>
Annar - &#x4F18;&#x96C5;&#x3001;&#x7B80;&#x6D01;&#x7684; Remax
&#x7EC4;&#x4EF6;&#x5E93;
</title>
<title>Annar - 优雅、简洁的 Remax 组件库</title>
</head>
<body>
<div id="root"></div>
Expand Down
Binary file removed site/static/KaTeX_AMS-Regular.b1489df1.woff
Binary file not shown.
Binary file removed site/static/KaTeX_AMS-Regular.d4531cf7.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_AMS-Regular.f80d9eaf.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Caligraphic-Bold.0c96bc8f.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Caligraphic-Bold.7ce7636b.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Caligraphic-Bold.f046a374.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Caligraphic-Regular.35f3c951.ttf
Binary file not shown.
Binary file not shown.
Binary file removed site/static/KaTeX_Caligraphic-Regular.4a559f36.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Fraktur-Bold.069514d4.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Fraktur-Bold.2ea3916b.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Fraktur-Bold.5b8749ee.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Fraktur-Regular.0d90113d.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Fraktur-Regular.2c629b06.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Fraktur-Regular.96556db6.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Main-Bold.07e762d0.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Main-Bold.20b90c20.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Main-Bold.a9cdbc85.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Main-BoldItalic.7649d52f.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Main-BoldItalic.b345de5b.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Main-BoldItalic.bc8d96e9.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Main-Italic.44a32ae6.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Main-Italic.ab751a9e.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Main-Italic.e3954fe9.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Main-Regular.13b3f852.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Main-Regular.9e75cd60.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Main-Regular.af7fc7b3.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Math-BoldItalic.4d6241be.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Math-BoldItalic.94810ff6.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Math-BoldItalic.d5d35e84.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Math-Italic.11278d36.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Math-Italic.cae7ea26.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Math-Italic.ffda8803.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_SansSerif-Bold.2946bdb5.woff
Binary file not shown.
Binary file removed site/static/KaTeX_SansSerif-Bold.5a20a475.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_SansSerif-Bold.f0ad0abc.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_SansSerif-Italic.c7feacd5.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_SansSerif-Italic.c834ba6d.woff
Binary file not shown.
Binary file removed site/static/KaTeX_SansSerif-Italic.e5fc2aef.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_SansSerif-Regular.5af9e1cf.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_SansSerif-Regular.5bf28900.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_SansSerif-Regular.a4fd0563.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Script-Regular.a1c15978.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Script-Regular.cd3b0634.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Script-Regular.dd0db7ae.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Size1-Regular.1876361f.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Size1-Regular.bbd9552c.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Size1-Regular.c4ae0d25.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Size2-Regular.635e9324.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Size2-Regular.d1e8ff17.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Size2-Regular.f516b73c.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Size3-Regular.1ef7adae.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Size3-Regular.5d632274.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Size3-Regular.f32a9fde.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Size4-Regular.1d132596.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Size4-Regular.4f012d6a.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Size4-Regular.f668d566.woff
Binary file not shown.
Binary file removed site/static/KaTeX_Typewriter-Regular.4f31d033.woff2
Binary file not shown.
Binary file removed site/static/KaTeX_Typewriter-Regular.b1d1af1a.ttf
Binary file not shown.
Binary file removed site/static/KaTeX_Typewriter-Regular.d3c8e68f.woff
Binary file not shown.
2 changes: 1 addition & 1 deletion site/umi.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion site/umi.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion site/~demos/:uuid/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
window.routerBase = "/annar";
</script>
<script>
//! umi version: 3.2.3
//! umi version: 3.2.24
</script>
<title>Annar</title>
</head>
Expand Down

0 comments on commit 748ef45

Please sign in to comment.