- 所有主题的 avue-logo 背景改为白色,并添加 0 2px 8px rgba(0,0,0,0.06) 阴影效果 - 各主题顶部栏背景及文字颜色调整,提升整体对比度与视觉统一性 - 统一调整下拉菜单、面包屑、图标等元素颜色为 rgba(0,0,0,0.85) 或 0.65,增强易读性 - 修正部分输入框和色彩选择器的边框及背景颜色,增强一致性 - index.html 添加 favicon.ico 作为页面图标 - 新增图标悬停显示浅灰圆形背景效果示例页面 icon-hover-demo.html - icon-hover-demo.html 包含核心 CSS 代码和 Element Plus 的示例用法,方便复用和参考
162 lines
3.3 KiB
Vue
162 lines
3.3 KiB
Vue
<template>
|
|
<div>
|
|
<el-dialog title="选择" v-model="box" width="50%">
|
|
<el-radio-group v-model="text" class="list">
|
|
<el-row :span="24">
|
|
<el-col v-for="(item, index) in list" :key="index" :md="4" :xs="12" :sm="4">
|
|
<el-radio :label="item.value">{{ item.name }}</el-radio>
|
|
</el-col>
|
|
</el-row>
|
|
</el-radio-group>
|
|
</el-dialog>
|
|
|
|
<span class="top-theme-icon" @click="open">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M7 3l3 3h4l3-3 4 4-3 2v11a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V9L3 7l4-4z" />
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { setTheme } from 'utils/util';
|
|
import { mapGetters } from 'vuex';
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
box: false,
|
|
text: '',
|
|
list: [
|
|
{
|
|
name: '默认主题',
|
|
value: 'default',
|
|
},
|
|
{
|
|
name: '白色主题',
|
|
value: 'theme-white',
|
|
},
|
|
{
|
|
name: '黑色主题',
|
|
value: 'theme-dark',
|
|
},
|
|
{
|
|
name: 'go主题',
|
|
value: 'theme-go',
|
|
},
|
|
{
|
|
name: 'hey主题',
|
|
value: 'theme-hey',
|
|
},
|
|
{
|
|
name: '炫彩主题',
|
|
value: 'theme-star',
|
|
},
|
|
{
|
|
name: 'vip主题',
|
|
value: 'theme-vip',
|
|
},
|
|
{
|
|
name: '智能工厂主题',
|
|
value: 'theme-bule',
|
|
},
|
|
{
|
|
name: 'iview主题',
|
|
value: 'theme-iview',
|
|
},
|
|
{
|
|
name: 'cool主题',
|
|
value: 'theme-cool',
|
|
},
|
|
{
|
|
name: 'd2主题',
|
|
value: 'theme-d2',
|
|
},
|
|
{
|
|
name: 'lte主题',
|
|
value: 'theme-lte',
|
|
},
|
|
{
|
|
name: 'beautiful主题',
|
|
value: 'theme-beautiful',
|
|
},
|
|
{
|
|
name: 'Mac OS主题',
|
|
value: 'mac-os',
|
|
},
|
|
],
|
|
};
|
|
},
|
|
watch: {
|
|
text: function (val) {
|
|
this.$store.commit('SET_THEME_NAME', val);
|
|
setTheme(val);
|
|
if (this.$store.getters.isMacOs) {
|
|
this.$router.push(this.tagWel);
|
|
setTimeout(() => location.reload());
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
...mapGetters(['themeName', 'tagWel']),
|
|
},
|
|
mounted() {
|
|
this.text = this.themeName;
|
|
if (!this.text) {
|
|
this.text = '';
|
|
}
|
|
},
|
|
methods: {
|
|
open() {
|
|
this.box = true;
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.list {
|
|
width: 100%;
|
|
}
|
|
|
|
.top-theme-icon {
|
|
position: relative;
|
|
display: inline-flex;
|
|
vertical-align: middle;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 36px;
|
|
height: 36px;
|
|
cursor: pointer;
|
|
color: rgba(0, 0, 0, 0.85);
|
|
|
|
&::before {
|
|
content: "";
|
|
position: absolute;
|
|
inset: 0;
|
|
margin: auto;
|
|
width: 36px;
|
|
height: 36px;
|
|
border-radius: 50%;
|
|
background: #f2f3f5;
|
|
transform: scale(0.6);
|
|
opacity: 0;
|
|
transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
|
|
}
|
|
|
|
&:hover::before,
|
|
&:focus-visible::before {
|
|
transform: scale(1);
|
|
opacity: 1;
|
|
}
|
|
|
|
svg {
|
|
position: relative;
|
|
z-index: 1;
|
|
width: 18px;
|
|
height: 18px;
|
|
pointer-events: none;
|
|
}
|
|
}
|
|
</style>
|