-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.vue
More file actions
34 lines (30 loc) · 986 Bytes
/
App.vue
File metadata and controls
34 lines (30 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<template>
<div class="container">
<!-- <div class="topContainer">-->
<!-- <Toolbar />-->
<!-- <el-switch @change="handleToggleDark" v-model="theme" active-text="light" inactive-text="dark"></el-switch>-->
<!-- </div>-->
<!-- <SideMenu v-if="!isShow" />-->
<div class="topContainer">
<Toolbar />
<el-switch @change="handleToggleDark" v-model="theme" active-text="light" inactive-text="dark"></el-switch>
</div>
<router-view></router-view>
</div>
</template>
<script setup lang="ts">
import { useDark, useToggle } from '@vueuse/core';
import { ref } from 'vue';
import Toolbar from './components/toolbar/toolbar.vue';
let theme = ref<boolean>(false);
const isDark = useDark();
const toggleDark = useToggle(isDark);
// 定义一个事件处理函数,内部调用 toggleDark
const handleToggleDark = () => {
theme.value = isDark.value;
toggleDark();
};
</script>
<style>
@import './styles/_style.scss';
</style>