refactor: save

This commit is contained in:
zyronon 2024-04-16 23:26:14 +08:00
parent 5439b0f43b
commit 6ce731447a
2 changed files with 6 additions and 5 deletions

View File

@ -35,7 +35,8 @@ const state = reactive({
next: false, next: false,
start: { x: 0, y: 0, time: 0 }, start: { x: 0, y: 0, time: 0 },
move: { x: 0, y: 0 }, move: { x: 0, y: 0 },
wrapper: { width: 0, height: 0, childrenLength: 0 } wrapper: { width: 0, height: 0, childrenLength: 0 },
isDown: false
}) })
watch( watch(
@ -85,9 +86,9 @@ function canNext(isNext) {
<div <div
class="slide-list flex-direction-column" class="slide-list flex-direction-column"
ref="wrapperEl" ref="wrapperEl"
@touchstart="touchStart" @pointerdown="touchStart"
@touchmove="touchMove" @pointermove="touchMove"
@touchend="touchEnd" @pointerup="touchEnd"
> >
<slot></slot> <slot></slot>
</div> </div>

View File

@ -6,7 +6,7 @@ export function useNav() {
const router = useRouter() const router = useRouter()
const store = useBaseStore() const store = useBaseStore()
return (path, query = {}, data) => { return (path, query = {}, data?: any) => {
if (data) { if (data) {
store.routeData = cloneDeep(data) store.routeData = cloneDeep(data)
} }