import './index.scss' import { NDrawer, NDrawerContent, NDivider, NSpace, NSwitch, NColorPicker, NTooltip, NDescriptions, NDescriptionsItem, } from 'naive-ui' import RayIcon from '@/components/RayIcon/index' import { useSwatchesColorOptions } from './hook' import { useSetting } from '@/store' import type { PropType } from 'vue' const SettingDrawer = defineComponent({ name: 'SettingDrawer', props: { show: { type: Boolean, default: false, }, placement: { type: String as PropType, default: 'right', }, width: { type: Number, default: 280, }, }, emits: ['update:show'], setup(props, { emit }) { const { t } = useI18n() const settingStore = useSetting() const { changePrimaryColor, changeSwitcher } = settingStore const { themeValue, primaryColorOverride, menuTagLog } = storeToRefs(settingStore) const modelShow = computed({ get: () => props.show, set: (bool) => { emit('update:show', bool) }, }) const handleRailStyle = () => ({ backgroundColor: '#000000', }) return { modelShow, ray: t, handleRailStyle, changePrimaryColor, themeValue, primaryColorOverride, menuTagLog, changeSwitcher, } }, render() { return ( {this.ray('LayoutHeaderSettingOptions.ThemeOptions.Title')} {{ trigger: () => ( this.changeSwitcher(bool, 'themeValue') } > {{ 'checked-icon': () => h( RayIcon, { name: 'dark', }, {}, ), 'unchecked-icon': () => h( RayIcon, { name: 'light', }, {}, ), }} ), default: () => this.themeValue ? this.ray('LayoutHeaderSettingOptions.ThemeOptions.Dark') : this.ray( 'LayoutHeaderSettingOptions.ThemeOptions.Light', ), }} {this.ray( 'LayoutHeaderSettingOptions.ThemeOptions.PrimaryColorConfig', )} 界面显示 this.changeSwitcher(bool, 'menuTagLog') } /> ) }, }) export default SettingDrawer