瀏覽代碼

feat(home): viewMap keys

lind 3 年之前
父節點
當前提交
acd98a0263
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/pages/home/index.tsx

+ 3 - 1
src/pages/home/index.tsx

@@ -11,8 +11,10 @@ const ViewMap = {
   ops: <Ops />,
   ops: <Ops />,
 };
 };
 
 
+type ViewType = keyof typeof ViewMap;
+
 const Home = () => {
 const Home = () => {
-  const [current, setCurrent] = useState<'init' | 'device' | 'ops'>('init');
+  const [current, setCurrent] = useState<ViewType>('init');
 
 
   return (
   return (
     <PageContainer>
     <PageContainer>