diff --git a/src/GlobalModal.tsx b/src/GlobalModal.tsx index 55239d6..8db28a9 100644 --- a/src/GlobalModal.tsx +++ b/src/GlobalModal.tsx @@ -43,7 +43,7 @@ export default defineComponent(() => {
{ const layout = useLayoutStore() + const router = useRouterStore() const isGame = computed(() => layout.state.current === 0) const selectType = ref('') const addTo = ref(layout.state.currentPage) const typeList = ref([]) + const wallpaperList = ref([]) + const selectAttr = ref(0) + const userStore = useUserStore() + const backgroundStore = useBackgroundStore() const sortBy = ref<'hotNum' | 'time'>('hotNum') onMounted(() => { request("GET", "/api/backgroundTypes").then(res => { @@ -52,13 +73,18 @@ export default defineComponent(() => { }) }) watch(() => [selectType.value, sortBy.value], (e) => { - request("GET", `/api/backgrounds?typeId=${e}&sort=${sortBy.value}`).then(res => { + wallpaperList.value = [] + request("GET", `/api/backgrounds?typeId=${e[0]}&sort=${sortBy.value}`).then(res => { console.log(res); - + wallpaperList.value = res }) }, { immediate: true }) + watch(selectAttr, (e) => { + + selectType.value = typeList.value.filter(val => val.attr === e)[0].id || '' + }) return () => (
{ backgroundImage: `url('/bg/gameModel.png')`, backgroundSize: '100% 100%', } : null}> -
+
壁纸库
-