56 lines
1.2 KiB
Vue
56 lines
1.2 KiB
Vue
<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> |