Switch SPA navigation to history paths
This commit is contained in:
@@ -585,7 +585,7 @@ function getOverview(item: MediaItem): string | null {
|
||||
}
|
||||
|
||||
function getItemHref(item: MediaItem): string {
|
||||
return `#/${item.type}/${item.id}`
|
||||
return `/${item.type}/${item.id}`
|
||||
}
|
||||
|
||||
function activateItem(item: MediaItem) {
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
class="cast-card media-card"
|
||||
data-nav-cast-item="true"
|
||||
v-bind="navAttrs(2 + movieVersions.length, castIndex)"
|
||||
:href="`#/?q=${encodeURIComponent(castMember.name)}`"
|
||||
:href="`/search/${encodeURIComponent(castMember.name)}`"
|
||||
:title="`Search for ${castMember.name}`"
|
||||
@click.prevent="handleCastSelect(castMember.name)"
|
||||
>
|
||||
|
||||
@@ -33,8 +33,8 @@ defineEmits<{
|
||||
function getItemHref(item: MediaItem): string | undefined {
|
||||
if (item.type === "episode") {
|
||||
const epData = item.data as EpisodeWithSeries
|
||||
return `#/series/${epData.series.id}`
|
||||
return `/series/${epData.series.id}`
|
||||
}
|
||||
return `#/${item.type}/${item.id}`
|
||||
return `/${item.type}/${item.id}`
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createRouter, createWebHashHistory } from "vue-router"
|
||||
import { createRouter, createWebHistory } from "vue-router"
|
||||
import { defineComponent, h } from "vue"
|
||||
|
||||
// Empty component - App.vue handles all rendering based on route meta
|
||||
@@ -9,7 +9,7 @@ const EmptyRouteComponent = defineComponent({
|
||||
})
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
history: createWebHistory(),
|
||||
scrollBehavior() {
|
||||
// Always scroll to top on navigation
|
||||
return { top: 0 }
|
||||
|
||||
Reference in New Issue
Block a user