@slidev/client 0.43.0-beta.2 → 0.43.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/internals/SlidesShow.vue +8 -2
- package/package.json +3 -3
package/internals/SlidesShow.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, shallowRef, watch } from 'vue'
|
|
3
|
-
import { clicks, currentRoute, isPresenter, nextRoute, rawRoutes, transition } from '../logic/nav'
|
|
3
|
+
import { clicks, currentRoute, isPresenter, nextRoute, rawRoutes, router, transition } from '../logic/nav'
|
|
4
4
|
import { getSlideClass } from '../utils'
|
|
5
5
|
import SlideWrapper from './SlideWrapper'
|
|
6
6
|
|
|
@@ -21,6 +21,12 @@ watch(currentRoute, () => {
|
|
|
21
21
|
nextRoute.value.meta.__preloaded = true
|
|
22
22
|
}, { immediate: true })
|
|
23
23
|
|
|
24
|
+
// preserve the clicks count for previous slide to avoid flash on transition
|
|
25
|
+
let previousClicks: [string | undefined, number] = [] as any
|
|
26
|
+
router.beforeEach(() => {
|
|
27
|
+
previousClicks = [currentRoute.value?.path, clicks.value]
|
|
28
|
+
})
|
|
29
|
+
|
|
24
30
|
const DrawingLayer = shallowRef<any>()
|
|
25
31
|
if (__SLIDEV_FEATURE_DRAWINGS__ || __SLIDEV_FEATURE_DRAWINGS_PERSIST__)
|
|
26
32
|
import('./DrawingLayer.vue').then(v => DrawingLayer.value = v.default)
|
|
@@ -38,7 +44,7 @@ const loadedRoutes = computed(() => rawRoutes.filter(r => r.meta?.__preloaded ||
|
|
|
38
44
|
<SlideWrapper
|
|
39
45
|
:is="route?.component as any"
|
|
40
46
|
v-show="route === currentRoute"
|
|
41
|
-
:clicks="route === currentRoute ? clicks : 0"
|
|
47
|
+
:clicks="route === currentRoute ? clicks : route.path === previousClicks[0] ? previousClicks[1] : 0"
|
|
42
48
|
:clicks-elements="route.meta?.__clicksElements || []"
|
|
43
49
|
:clicks-disabled="false"
|
|
44
50
|
:class="getSlideClass(route)"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/client",
|
|
3
|
-
"version": "0.43.0-beta.
|
|
3
|
+
"version": "0.43.0-beta.3",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"vue-router": "^4.2.4",
|
|
42
42
|
"vue-starport": "^0.3.0",
|
|
43
43
|
"windicss": "^3.5.6",
|
|
44
|
-
"@slidev/parser": "0.43.0-beta.
|
|
45
|
-
"@slidev/types": "0.43.0-beta.
|
|
44
|
+
"@slidev/parser": "0.43.0-beta.3",
|
|
45
|
+
"@slidev/types": "0.43.0-beta.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"vite": "^4.4.9"
|