1
0

feat: unify modal view

fix: List.vue
This commit is contained in:
Dominik Pschenitschni
2021-11-01 18:19:59 +01:00
parent 281c922de1
commit c70211ad32
13 changed files with 314 additions and 411 deletions

View File

@ -22,12 +22,9 @@
<router-view :route="routeWithModal"/>
<!-- TODO: is this still used? -->
<router-view name="popup" v-slot="{ Component }">
<transition name="modal">
<component :is="Component" />
</transition>
</router-view>
<transition name="modal">
<component v-if="currentModal" :is="currentModal" />
</transition>
<a
class="keyboard-shortcuts-button"
@ -42,7 +39,7 @@
</template>
<script lang="ts" setup>
import {watch, computed} from 'vue'
import {watch, computed, shallowRef, watchEffect} from 'vue'
import {useStore} from 'vuex'
import {useRoute, useRouter} from 'vue-router'
import {useEventListener} from '@vueuse/core'
@ -64,7 +61,16 @@ function useRouteWithModal() {
}
})
return { routeWithModal }
const currentModal = shallowRef(null)
watchEffect(() => {
currentModal.value = historyState.value.backgroundView
? route.matched[0]?.components.default
: null
})
return { routeWithModal, currentModal }
}
useRouteWithModal()