import { NTabs, NTabPane, NCard, NIcon } from 'naive-ui' import { SettingOutlined, BellOutlined, InfoCircleOutlined } from '@vicons/antd' import { useStore } from './useStore' import { useController } from './useController' import BaseComponent from '@/components/baseComponent' import GeneralSettings from './components/generalSettings' import NotificationSettings from './components/notificationSettings' import AboutSettings from './components/aboutSettings' /** * 设置页面组件 */ export default defineComponent({ name: 'Settings', setup() { const { activeTab, tabOptions } = useStore() const { fetchAllSettings, isCutTab } = useController() // 渲染图标组件 const renderIcon = (iconName: string) => { const icons: Record = { SettingOutlined: , BellOutlined: , InfoCircleOutlined: , } return {icons[iconName]} } // 自定义Tab样式已移至全局reset.css onMounted(() => { isCutTab() fetchAllSettings() }) return () => (
(
{tabOptions.value.map((tab) => ( {{ tab: () => (
{renderIcon(tab.icon)} {tab.title}
), default: () => (
{/* 常用设置 */} {activeTab.value === 'general' && } {/* 告警通知 */} {activeTab.value === 'notification' && } {/* 关于我们 */} {activeTab.value === 'about' && }
), }}
))}
), }} />
) }, })