Files
aurora-admin/site/sources/themeswitcher/vue2.txt
T
aurora-admin c65a69c34e
Deploy to GitHub Pages / deploy (push) Failing after 16s
Regression / regression (push) Failing after 15m2s
feat(P4): precompute移植+app.js sources双向回填+回归1003/1003+验收体积/文件/data.json
2026-09-12 14:18:41 +08:00

46 lines
1.1 KiB
Plaintext

<template>
<div class="aa-themesw">
<div
v-for="m in modes"
:key="m.value"
class="aa-themesw-opt"
:class="{ 'is-active': mode === m.value }"
@click="$emit('update:mode', m.value)"
>
<span class="aa-themesw-dot" :class="m.value"></span>{{ m.label }}
</div>
<div class="aa-themesw-colors">
<span
v-for="c in brands"
:key="c"
class="aa-themesw-color"
:class="{ 'is-active': brand === c }"
:style="{ background: c }"
@click="$emit('update:brand', c)"
></span>
</div>
<div class="aa-themesw-label">品牌色:{{ brand }}(应用于 CSS 变量 --brand 实时预览)</div>
</div>
</template>
<script>
export default {
name: 'AaThemeSwitcher',
props: {
mode: { type: String, default: 'light' },
brand: { type: String, default: '#2F54EB' }
},
data() {
return {
modes: [
{ value: 'light', label: '浅色' },
{ value: 'dark', label: '深色' }
],
brands: ['#2F54EB', '#1677FF', '#722ED1', '#13C2C2', '#FA541C', '#EB2F96']
};
}
};
</script>
<style src="./ThemeSwitcher.css"></style>