浏览代码

chore: taro doc

richard1015 3 年之前
父节点
当前提交
2e7312d716
共有 1 个文件被更改,包括 2 次插入25 次删除
  1. 2 25
      src/sites/doc/views/Index.vue

+ 2 - 25
src/sites/doc/views/Index.vue

@@ -10,7 +10,7 @@
         </div>
       </div>
       <div class="doc-content-document isComponent">
-        <div class="doc-content-tabs" v-if="isShowTaroDoc">
+        <div class="doc-content-tabs">
           <div
             class="tab-item"
             :class="{ cur: curKey === item.key }"
@@ -20,9 +20,6 @@
             >{{ item.text }}</div
           >
         </div>
-        <div class="doc-content-tabs single" v-if="!isShowTaroDoc">
-          <div class="tab-item cur">vue / taro</div>
-        </div>
         <router-view />
       </div>
       <doc-demo-preview :url="demoUrl" :class="{ fixed: fixed }"></doc-demo-preview>
@@ -76,29 +73,10 @@ export default defineComponent({
       ]
     });
 
-    const configNav = computed(() => {
-      let tarodocs = [] as string[];
-      nav.map((item) => {
-        item.packages.forEach((element) => {
-          let { tarodoc, name } = element;
-          if (tarodoc) {
-            tarodocs.push(name.toLowerCase());
-            tarodocs.push(`${name.toLowerCase()}-taro`);
-          }
-        });
-      });
-      return tarodocs;
-    });
-
     const isTaro = (router: RouteLocationNormalized) => {
       return router.path.indexOf('taro') > -1;
     };
 
-    const isShowTaroDoc = computed(() => {
-      let routename = route.path.toLocaleLowerCase().split('/').pop() || '';
-      return configNav.value.findIndex((item) => item === routename) > -1;
-    });
-
     const watchDemoUrl = (router: RouteLocationNormalized) => {
       const { origin, pathname } = window.location;
       RefData.getInstance().currentRoute.value = router.path as string;
@@ -179,8 +157,7 @@ export default defineComponent({
     return {
       ...toRefs(state),
       ...toRefs(data),
-      handleTabs,
-      isShowTaroDoc
+      handleTabs
     };
   }
 });