hldy_app/pages/somethingmove/index.vue

56 lines
1.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view :class="darkFans?`darkbackgroundContainer`:`backgroundContainer`" @click="goback">
1111111
</view>
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, computed, nextTick } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
// 暗黑模式
const darkFans = ref(false);
type darkFanstype = {
darkFans:boolean
}
// 生命周期钩子
onLoad((options:darkFanstype) => {
// 为啥这么写因为options给我返回的是字符串这个`false`,只能这么写,前端中`false`是true
if(options.darkFans === `false`){
darkFans.value = false
}else{
darkFans.value = true
}
});
const goback = () =>{
uni.navigateBack()
}
</script>
<style scoped lang="less">
.backgroundContainer {
display: flex;
position: relative;
width: 100%;
height: 100vh;
background-image: url('/static/index/lightbgcnew.png');
background-size: cover;
background-position: center center;
overflow: hidden;
}
//暗黑模式
.darkbackgroundContainer {
display: flex;
position: relative;
width: 100%;
height: 100vh;
background-image: url('/static/index/background.png');
background-size: cover;
background-position: center center;
overflow: hidden;
}
</style>