xyyd-fatfox/src/layout/grid/DockSetting.tsx

62 lines
1.9 KiB
TypeScript
Raw Normal View History

2024-10-30 19:07:10 +08:00
import SettingItem from '@/settings/SettingItem'
import useSettingsStore from '@/settings/useSettingsStore'
import { Select, Switch } from 'ant-design-vue'
import clsx from 'clsx'
import { defineComponent } from 'vue'
import useLayoutStore from '../useLayoutStore'
export default defineComponent({
name: 'SiderSetting',
props: {},
setup() {
const settings = useSettingsStore()
const layout = useLayoutStore()
return () => (
<div class="p-4 flex flex-col gap-y-1 ">
<SettingItem
v-slots={{
label: () => <div></div>
}}
>
<Switch
checked={settings.state.showDock === ''}
onUpdate:checked={(e) => {
if (e) settings.state.showDock = ''
else settings.state.showDock = 'show'
}}
/>
</SettingItem>{' '}
<SettingItem
v-slots={{
label: () => <div></div>
}}
>
<Switch
checked={settings.state.showDock === 'auto'}
onUpdate:checked={(e) => {
if (e) settings.state.showDock = 'auto'
else settings.state.showDock = 'show'
}}
/>
</SettingItem>{' '}
<div class={'flex flex-col text-[#333]'}>
<span class={'font-bold'}></span>
<p class={'text-[12px] text-[#999]'}></p>
<div class={'w-full h-[1px] bg-[#ddd] mt-2'}></div>
<div class={'w-full grid grid-rows-5 grid-cols-2 gap-2 p-2'}>
{layout.state.dockLabels.split('').map((val, idx) => (
<div class="w-full flex gap-x-4">
<span>{idx + 1}</span>
<div class={'flex-1 bg-slate-50 rounded'}>
</div>
</div>
))}
</div>
</div>
</div>
)
}
})