mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
fix 初始化时主题背景色的显示问题
This commit is contained in:
@@ -26,6 +26,8 @@ function changeTheme() {
|
|||||||
globalTheme.name.value = nextTheme
|
globalTheme.name.value = nextTheme
|
||||||
savedTheme.value = nextTheme
|
savedTheme.value = nextTheme
|
||||||
localStorage.setItem('theme', nextTheme)
|
localStorage.setItem('theme', nextTheme)
|
||||||
|
// 修改载入时背景色
|
||||||
|
localStorage.setItem('materio-initial-loader-bg', globalTheme.current.value.colors.background)
|
||||||
|
|
||||||
themeTransition()
|
themeTransition()
|
||||||
}
|
}
|
||||||
@@ -39,9 +41,9 @@ watch(
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Apply saved theme on page load
|
// Apply saved theme on page load
|
||||||
onMounted(() => {
|
// onMounted(() => {
|
||||||
globalTheme.name.value = savedTheme.value
|
// globalTheme.name.value = savedTheme.value
|
||||||
})
|
// })
|
||||||
|
|
||||||
function hasScrollbar(el?: Element | null) {
|
function hasScrollbar(el?: Element | null) {
|
||||||
if (!el || el.nodeType !== Node.ELEMENT_NODE)
|
if (!el || el.nodeType !== Node.ELEMENT_NODE)
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
|
import { useTheme } from 'vuetify'
|
||||||
import api from './api'
|
import api from './api'
|
||||||
import type { User } from './api/types'
|
import type { User } from './api/types'
|
||||||
import store from './store'
|
import store from './store'
|
||||||
import avatar1 from '@images/avatars/avatar-1.png'
|
import avatar1 from '@images/avatars/avatar-1.png'
|
||||||
|
|
||||||
|
// 第一时间应用主题
|
||||||
|
const { global: globalTheme } = useTheme()
|
||||||
|
globalTheme.name.value = localStorage.getItem('theme') || 'light'
|
||||||
|
|
||||||
// 提示框
|
// 提示框
|
||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user