wip: 迁移 v3-admin v3.1.3 版本代码
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
defineProps<{ msg: string }>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h1>{{ msg }}</h1>
|
||||
|
||||
<p>
|
||||
Recommended IDE setup:
|
||||
<a href="https://code.visualstudio.com/" target="_blank">VS Code</a>
|
||||
+
|
||||
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
|
||||
</p>
|
||||
|
||||
<p>See <code>README.md</code> for more information.</p>
|
||||
|
||||
<p>
|
||||
<a href="https://vitejs.dev/guide/features.html" target="_blank"> Vite Docs </a>
|
||||
|
|
||||
<a href="https://v3.vuejs.org/" target="_blank">Vue 3 Docs</a>
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
a {
|
||||
color: #42b983;
|
||||
}
|
||||
|
||||
label {
|
||||
margin: 0 0.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
code {
|
||||
background-color: #eee;
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px;
|
||||
color: #304455;
|
||||
}
|
||||
</style>
|
||||
23
src/components/Screenfull/index.vue
Normal file
23
src/components/Screenfull/index.vue
Normal file
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<div @click="click">
|
||||
<el-tooltip effect="dark" content="全屏" placement="bottom">
|
||||
<el-icon :size="20">
|
||||
<full-screen />
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { FullScreen } from '@element-plus/icons-vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import screenfull from 'screenfull'
|
||||
|
||||
const click = () => {
|
||||
if (!screenfull.isEnabled) {
|
||||
ElMessage.warning('您的浏览器无法工作')
|
||||
return
|
||||
}
|
||||
screenfull.toggle()
|
||||
}
|
||||
</script>
|
||||
38
src/components/ThemeSwitch/index.vue
Normal file
38
src/components/ThemeSwitch/index.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<el-dropdown trigger="click" @command="handleSetTheme">
|
||||
<el-tooltip effect="dark" content="主题模式" placement="bottom">
|
||||
<el-icon :size="20">
|
||||
<magic-stick />
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item
|
||||
v-for="(theme, index) in themeList"
|
||||
:key="index"
|
||||
:disabled="activeThemeName === theme.name"
|
||||
:command="theme.name"
|
||||
>
|
||||
<span>{{ theme.title }}</span>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { MagicStick } from '@element-plus/icons-vue'
|
||||
import { computed } from 'vue'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
|
||||
const appStore = useAppStore()
|
||||
const themeList = computed(() => {
|
||||
return appStore.themeList
|
||||
})
|
||||
const activeThemeName = computed(() => {
|
||||
return appStore.activeThemeName
|
||||
})
|
||||
const handleSetTheme = (name: string) => {
|
||||
appStore.setTheme(name)
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user