chore: edit extend -> resources
This commit is contained in:
		
							parent
							
								
									3b06a2ec87
								
							
						
					
					
						commit
						4153a78043
					
				@ -26,8 +26,8 @@
 | 
			
		||||
            </router-link>
 | 
			
		||||
          </li>
 | 
			
		||||
          <li class="layui-nav-item">
 | 
			
		||||
            <router-link to="/zh-CN/extend">
 | 
			
		||||
              {{ t("nav.extend") }}
 | 
			
		||||
            <router-link to="/zh-CN/resources">
 | 
			
		||||
              {{ t("nav.resources") }}
 | 
			
		||||
            </router-link>
 | 
			
		||||
          </li>
 | 
			
		||||
          <li class="layui-nav-item">
 | 
			
		||||
 | 
			
		||||
@ -3,7 +3,7 @@ export default {
 | 
			
		||||
        home:"Home",
 | 
			
		||||
        guide: "Guide",
 | 
			
		||||
        components: "Components",
 | 
			
		||||
        extend: "Extend",
 | 
			
		||||
        resources: "Resources",
 | 
			
		||||
        material: "Material"
 | 
			
		||||
    },
 | 
			
		||||
    home: {
 | 
			
		||||
 | 
			
		||||
@ -3,7 +3,7 @@ export default {
 | 
			
		||||
        home:"首页",
 | 
			
		||||
        guide: "指南",
 | 
			
		||||
        components: "组件",
 | 
			
		||||
        extend: "生态",
 | 
			
		||||
        resources: "生态",
 | 
			
		||||
        material: "物料"
 | 
			
		||||
    },
 | 
			
		||||
    home: {
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,10 @@
 | 
			
		||||
import BaseLayout from "../layouts/Layout.vue";
 | 
			
		||||
import Component from "../view/component.vue";
 | 
			
		||||
import Hooks from "../view/hooks.vue";
 | 
			
		||||
import Guide from "../view/guide.vue";
 | 
			
		||||
import Index from "../view/index.vue";
 | 
			
		||||
import Extend from "../view/extend.vue";
 | 
			
		||||
import Resource from "../view/resource.vue";
 | 
			
		||||
import Material from "../view/material.vue";
 | 
			
		||||
import BaseLayout from "../layouts/Layout.vue";
 | 
			
		||||
import Component from "../view/component.vue";
 | 
			
		||||
 | 
			
		||||
const zhCN = [
 | 
			
		||||
  {
 | 
			
		||||
    path: "/",
 | 
			
		||||
@ -18,8 +18,8 @@ const zhCN = [
 | 
			
		||||
        meta: { title: "指南" },
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: "/zh-CN/extend",
 | 
			
		||||
        component: Extend,
 | 
			
		||||
        path: "/zh-CN/resources",
 | 
			
		||||
        component: Resource,
 | 
			
		||||
        meta: { title: "生态" },
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
 | 
			
		||||
@ -1,124 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <lay-layout>
 | 
			
		||||
    <lay-side>
 | 
			
		||||
      <lay-scroll style="overflow-y: scroll">
 | 
			
		||||
        <ul class="layui-menu layui-menu-lg layui-menu-docs">
 | 
			
		||||
          <li
 | 
			
		||||
            v-for="menu in menus"
 | 
			
		||||
            :key="menu"
 | 
			
		||||
            class="layui-menu-item-group"
 | 
			
		||||
            lay-options="{type: 'group', isAllowSpread: true}"
 | 
			
		||||
          >
 | 
			
		||||
            <div class="layui-menu-body-title">{{ menu.title }}</div>
 | 
			
		||||
            <hr />
 | 
			
		||||
            <ul>
 | 
			
		||||
              <li
 | 
			
		||||
                v-for="children in menu.children"
 | 
			
		||||
                :key="children"
 | 
			
		||||
                :class="[
 | 
			
		||||
                  currentPath === children.path
 | 
			
		||||
                    ? 'layui-menu-item-checked2'
 | 
			
		||||
                    : '',
 | 
			
		||||
                ]"
 | 
			
		||||
                @click="handleClick(children)"
 | 
			
		||||
              >
 | 
			
		||||
                <div class="layui-menu-body-title">
 | 
			
		||||
                  <router-link :to="children.path">
 | 
			
		||||
                    <span>{{ children.title }}</span>
 | 
			
		||||
                    <span class="layui-font-12 layui-font-gray">
 | 
			
		||||
                      {{ children.subTitle }}
 | 
			
		||||
                    </span>
 | 
			
		||||
                  </router-link>
 | 
			
		||||
                </div>
 | 
			
		||||
              </li>
 | 
			
		||||
            </ul>
 | 
			
		||||
          </li>
 | 
			
		||||
        </ul>
 | 
			
		||||
      </lay-scroll>
 | 
			
		||||
    </lay-side>
 | 
			
		||||
    <lay-body>
 | 
			
		||||
      <div style="padding: 20px">
 | 
			
		||||
        <router-view />
 | 
			
		||||
      </div>
 | 
			
		||||
    </lay-body>
 | 
			
		||||
  </lay-layout>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { ref, watch } from 'vue'
 | 
			
		||||
import { useRouter, useRoute } from 'vue-router'
 | 
			
		||||
export default {
 | 
			
		||||
  setup() {
 | 
			
		||||
    const route = useRoute()
 | 
			
		||||
    const router = useRouter()
 | 
			
		||||
    const currentPath = ref('/zh-CN/guide')
 | 
			
		||||
 | 
			
		||||
    watch(
 | 
			
		||||
      () => route.path,
 | 
			
		||||
      (val) => {
 | 
			
		||||
        currentPath.value = val
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        immediate: true,
 | 
			
		||||
        deep: true,
 | 
			
		||||
      }
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    const menus = [
 | 
			
		||||
      {
 | 
			
		||||
        id: 1,
 | 
			
		||||
        title: 'hooks',
 | 
			
		||||
        children: [
 | 
			
		||||
          {
 | 
			
		||||
            id: 0,
 | 
			
		||||
            title: '开始',
 | 
			
		||||
            subTitle: 'useStarted',
 | 
			
		||||
            path: '/zh-CN/hooks/useStarted',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            id: 1,
 | 
			
		||||
            title: '事件',
 | 
			
		||||
            subTitle: 'useClickOutside',
 | 
			
		||||
            path: '/zh-CN/hooks/useClickOutside',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            id: 2,
 | 
			
		||||
            title: '拖拽',
 | 
			
		||||
            subTitle: 'useMove',
 | 
			
		||||
            path: '/zh-CN/hooks/useMove',
 | 
			
		||||
          },{
 | 
			
		||||
            id: 3,
 | 
			
		||||
            title: '布尔',
 | 
			
		||||
            subTitle: 'useBoolean',
 | 
			
		||||
            path: '/zh-CN/hooks/useBoolean',
 | 
			
		||||
          },{
 | 
			
		||||
            id: 4,
 | 
			
		||||
            title: '状态',
 | 
			
		||||
            subTitle: 'useState',
 | 
			
		||||
            path: '/zh-CN/hooks/useState',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            id: 5,
 | 
			
		||||
            title: '全屏',
 | 
			
		||||
            subTitle: 'useFullScreen',
 | 
			
		||||
            path: '/zh-CN/hooks/useFullScreen',
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    const selected = ref(1)
 | 
			
		||||
 | 
			
		||||
    const handleClick = function (menu) {
 | 
			
		||||
      selected.value = menu.id
 | 
			
		||||
      router.push(menu.path)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
      menus,
 | 
			
		||||
      selected,
 | 
			
		||||
      currentPath,
 | 
			
		||||
      handleClick,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user