feat: track current tab in batches and courses page
This commit is contained in:
@@ -105,6 +105,7 @@ import {
|
|||||||
Select,
|
Select,
|
||||||
TabButtons,
|
TabButtons,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
|
import { useRouteQuery } from '@vueuse/router'
|
||||||
import { computed, inject, onMounted, ref, watch } from 'vue'
|
import { computed, inject, onMounted, ref, watch } from 'vue'
|
||||||
import { BookOpen, Plus } from 'lucide-vue-next'
|
import { BookOpen, Plus } from 'lucide-vue-next'
|
||||||
import { updateDocumentTitle } from '@/utils'
|
import { updateDocumentTitle } from '@/utils'
|
||||||
@@ -119,7 +120,7 @@ const currentCategory = ref(null)
|
|||||||
const title = ref('')
|
const title = ref('')
|
||||||
const certification = ref(false)
|
const certification = ref(false)
|
||||||
const filters = ref({})
|
const filters = ref({})
|
||||||
const currentTab = ref(user.data?.is_student ? 'All' : 'Upcoming')
|
const currentTab = useRouteQuery('tab', user.data?.is_student ? 'All' : 'Upcoming')
|
||||||
const orderBy = ref('start_date')
|
const orderBy = ref('start_date')
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ import {
|
|||||||
Select,
|
Select,
|
||||||
TabButtons,
|
TabButtons,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
|
import { useRouteQuery } from '@vueuse/router'
|
||||||
import { computed, inject, onMounted, ref, watch } from 'vue'
|
import { computed, inject, onMounted, ref, watch } from 'vue'
|
||||||
import { BookOpen, Plus } from 'lucide-vue-next'
|
import { BookOpen, Plus } from 'lucide-vue-next'
|
||||||
import { updateDocumentTitle } from '@/utils'
|
import { updateDocumentTitle } from '@/utils'
|
||||||
@@ -119,7 +120,7 @@ const currentCategory = ref(null)
|
|||||||
const title = ref('')
|
const title = ref('')
|
||||||
const certification = ref(false)
|
const certification = ref(false)
|
||||||
const filters = ref({})
|
const filters = ref({})
|
||||||
const currentTab = ref('Live')
|
const currentTab = useRouteQuery('tab', 'Live')
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
setFiltersFromQuery()
|
setFiltersFromQuery()
|
||||||
|
|||||||
Reference in New Issue
Block a user