import { defineComponent, ref, watch } from 'vue' import useLayoutStore from '../useLayoutStore' import { OhVueIcon, addIcons } from 'oh-vue-icons' import { MdVideogameassetTwotone, MdWorkhistoryTwotone, MdStarsTwotone } from 'oh-vue-icons/icons' import useSettingsStore from '@/settings/useSettingsStore' import clsx from 'clsx' addIcons(MdVideogameassetTwotone, MdWorkhistoryTwotone, MdStarsTwotone) export default defineComponent(() => { const hover = ref(false) const settings = useSettingsStore() const selected = ref<0 | 1 | 2>(0) const layout = useLayoutStore() watch( () => layout.state.current, (val) => { selected.value = val }, { immediate: true } ) return () => (
(hover.value = true)} onMouseleave={() => (hover.value = false)} > {layout.state.current === 0 ? '游戏' : layout.state.current === 1 ? '工作' : '休闲'} 模式 {/* 转盘 */}
游戏
工作
休闲
{/* 判定区块,无颜色 */} { selected.value = 0 }} /> { selected.value = 1 }} /> { selected.value = 2 }} /> { layout.state.current = selected.value }} style="transform-origin: 50% 50%;" fill="url(#mode-switch-selected)" d="M154.46,95.56c2.19-2.22,56.63-42.87,56.63-42.87,0,0,22.04,26.2,22,64.39,1.48,38.81-20.93,68.85-20.93,68.85,0,0-55.81-40.54-57.3-42.91,2.37-2.59,16.11-22.46-.41-47.46Z" />
) })