change
This commit is contained in:
parent
24adb4d996
commit
5e145b83ad
|
@ -21,7 +21,6 @@ export default defineComponent(() => {
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
watch(() => layout.state.content[selected.value].background, console.log, { immediate: true })
|
|
||||||
const resource = useResource(
|
const resource = useResource(
|
||||||
computed(() => layout.state.content[selected.value].background),
|
computed(() => layout.state.content[selected.value].background),
|
||||||
'background'
|
'background'
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { ossCdnBase, videoArr } from '@/config'
|
import { ossCdnBase, videoArr } from '@/config'
|
||||||
import db from '@/db'
|
import db from '@/db'
|
||||||
|
import useSettingsStore from '@/settings/useSettingsStore'
|
||||||
import { reactive, watch, type Ref } from 'vue'
|
import { reactive, watch, type Ref } from 'vue'
|
||||||
|
|
||||||
const defaultBackground =
|
const defaultBackground =
|
||||||
|
@ -13,15 +14,17 @@ const defaultResource = {
|
||||||
}
|
}
|
||||||
export default function useResource(tag: Ref<string>, type: string) {
|
export default function useResource(tag: Ref<string>, type: string) {
|
||||||
const resource = reactive(defaultResource)
|
const resource = reactive(defaultResource)
|
||||||
|
const settings = useSettingsStore()
|
||||||
watch(
|
watch(
|
||||||
tag,
|
tag,
|
||||||
(val) => {
|
(val) => {
|
||||||
// '' 表示使用默认,如果是背景,使用默认背景图片
|
// '' 表示使用默认,如果是背景,使用默认背景图片
|
||||||
if (!val) {
|
if (!val) {
|
||||||
Object.assign(resource, {
|
if (type === 'background' && !settings.state.used) {
|
||||||
...defaultResource,
|
Object.assign(resource, { ...defaultResource, image: defaultBackground })
|
||||||
image: type === 'background' ? defaultBackground : ''
|
} else {
|
||||||
})
|
Object.assign(resource, defaultResource)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (val.startsWith('http')) {
|
if (val.startsWith('http')) {
|
||||||
|
|
|
@ -7,6 +7,8 @@ export default defineStore(
|
||||||
'settings',
|
'settings',
|
||||||
() => {
|
() => {
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
// 是否用过
|
||||||
|
used: false,
|
||||||
maskOpacity: 0,
|
maskOpacity: 0,
|
||||||
maskFilter: 0,
|
maskFilter: 0,
|
||||||
// 显示隐藏
|
// 显示隐藏
|
||||||
|
|
Loading…
Reference in New Issue