优化历史记录逻辑
This commit is contained in:
parent
beee25590d
commit
a22463fa9c
|
@ -43,6 +43,9 @@ export const actions: ActionTree<State, State> = {
|
|||
needDeleteKeys.push(allKeys[0])
|
||||
snapshotLength--
|
||||
}
|
||||
if(snapshotLength >= 2) {
|
||||
db.snapshots.update(allKeys[snapshotLength - 2] as number, { index: state.slideIndex })
|
||||
}
|
||||
|
||||
await db.snapshots.bulkDelete(needDeleteKeys)
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
'slide-item',
|
||||
`turning-mode-${slide.turningMode || 'slideY'}`,
|
||||
{
|
||||
'show': index === slideIndex,
|
||||
'prev': index < slideIndex,
|
||||
'next': index > slideIndex,
|
||||
'current': index === slideIndex,
|
||||
'before': index < slideIndex,
|
||||
'after': index > slideIndex,
|
||||
}
|
||||
]"
|
||||
v-for="(slide, index) in slides"
|
||||
|
@ -260,45 +260,44 @@ export default defineComponent({
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
&.show {
|
||||
&.current {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
&.turning-mode-no {
|
||||
&.prev {
|
||||
&.before {
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
&.next {
|
||||
&.after {
|
||||
transform: translateY(100%);
|
||||
}
|
||||
}
|
||||
&.turning-mode-fade {
|
||||
transition: opacity .75s;
|
||||
|
||||
&.prev {
|
||||
&.before {
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
}
|
||||
&.next {
|
||||
&.after {
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
&.turning-mode-slideX {
|
||||
transition: transform .35s;
|
||||
&.prev {
|
||||
&.before {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
&.next {
|
||||
&.after {
|
||||
transform: translateX(100%);
|
||||
}
|
||||
}
|
||||
&.turning-mode-slideY {
|
||||
transition: transform .35s;
|
||||
&.prev {
|
||||
&.before {
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
&.next {
|
||||
&.after {
|
||||
transform: translateY(100%);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue