refactor: improve components load method, and improve provide app

This commit is contained in:
starknt
2024-01-11 16:38:11 +08:00
parent 9d00201bdf
commit c40fe57be0
2 changed files with 9 additions and 5 deletions

View File

@@ -259,11 +259,14 @@ function openVideoPageIfBvidExists() {
window.open(`https://www.bilibili.com/video/${bvid}`, '_self')
}
provide('handleBackToTop', handleBackToTop)
provide('handleRefresh', handleRefresh)
provide('activatedPage', activatedPage)
provide('scrollbarRef', scrollbarRef)
provide('mainAppRef', mainAppRef)
provide<BewlyAppProvider>('BEWLY_APP', {
activatedPage,
mainAppRef,
scrollbarRef,
handleBackToTop,
handlePageRefresh,
handleReachBottom,
})
</script>
<template>

View File

@@ -3,6 +3,7 @@ import { useDateFormat } from '@vueuse/core'
import { useI18n } from 'vue-i18n'
// import type { HistoryItem } from './types'
import type { Ref } from 'vue'
import { getCSRF, openLinkToNewTab, removeHttpFromUrl } from '~/utils/main'
import { calcCurrentTime } from '~/utils/dataFormatter'
import { Business } from '~/models/video/history'