feat(tree): add tree component and wip workspace
This commit is contained in:
56
docs/docs/zh-CN/components/tree.md
Normal file
56
docs/docs/zh-CN/components/tree.md
Normal file
@@ -0,0 +1,56 @@
|
||||
::: demo
|
||||
|
||||
<template>
|
||||
<lay-tree
|
||||
:data="data"
|
||||
>
|
||||
</lay-tree>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const data = ref([{
|
||||
title: '江西'
|
||||
,id: 1
|
||||
,children: [{
|
||||
title: '南昌'
|
||||
,id: 1000
|
||||
,children: [{
|
||||
title: '青山湖区'
|
||||
,id: 10001
|
||||
},{
|
||||
title: '高新区'
|
||||
,id: 10002
|
||||
}]
|
||||
},{
|
||||
title: '九江'
|
||||
,id: 1001
|
||||
},{
|
||||
title: '赣州'
|
||||
,id: 1002
|
||||
}]
|
||||
},{
|
||||
title: '广西'
|
||||
,id: 2
|
||||
,children: [{
|
||||
title: '南宁'
|
||||
,id: 2000
|
||||
},{
|
||||
title: '桂林'
|
||||
,id: 2001
|
||||
}]
|
||||
},{
|
||||
title: '陕西'
|
||||
,id: 3
|
||||
,children: [{
|
||||
title: '西安'
|
||||
,id: 3000
|
||||
},{
|
||||
title: '延安'
|
||||
,id: 3001
|
||||
}]
|
||||
}])
|
||||
</script>
|
||||
|
||||
:::
|
||||
@@ -18,14 +18,10 @@
|
||||
style="margin-top: 0px; margin-bottom: 0px"
|
||||
>
|
||||
<li class="layui-nav-item">
|
||||
<a href="https://gitee.com/layui-vue/layui-vue-sample">
|
||||
案例
|
||||
</a>
|
||||
<a href="https://gitee.com/layui-vue/layui-vue-sample"> 案例 </a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a href="https://gitee.com/layui-vue/layui-vue">
|
||||
仓库
|
||||
</a>
|
||||
<a href="https://gitee.com/layui-vue/layui-vue"> 仓库 </a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a
|
||||
@@ -37,11 +33,16 @@
|
||||
</ul>
|
||||
</lay-header>
|
||||
<lay-side>
|
||||
<ul class="layui-menu layui-menu-lg layui-menu-docs" style="padding:6px">
|
||||
<ul
|
||||
class="layui-menu layui-menu-lg layui-menu-docs"
|
||||
style="padding: 6px"
|
||||
>
|
||||
<li
|
||||
:key="menu"
|
||||
v-for="menu in menus"
|
||||
:class="[currentPath === menu.path ? 'layui-menu-item-checked2' : '']"
|
||||
:class="[
|
||||
currentPath === menu.path ? 'layui-menu-item-checked2' : '',
|
||||
]"
|
||||
@click="handleClick(menu)"
|
||||
>
|
||||
<div class="layui-menu-body-title">
|
||||
@@ -70,7 +71,7 @@ export default {
|
||||
setup() {
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const currentPath = ref("hahaha")
|
||||
const currentPath = ref('hahaha')
|
||||
|
||||
watch(
|
||||
() => route.path,
|
||||
@@ -247,12 +248,19 @@ export default {
|
||||
title: '选项卡',
|
||||
subTitle: 'tab',
|
||||
path: '/zh-CN/components/tab',
|
||||
},{
|
||||
},
|
||||
{
|
||||
id: 29,
|
||||
title: '图标选择',
|
||||
subTitle: 'iconPicker',
|
||||
path: '/zh-CN/components/iconPicker',
|
||||
},
|
||||
{
|
||||
id: 30,
|
||||
title: '树形组件',
|
||||
subTitle: 'tree',
|
||||
path: '/zh-CN/components/tree',
|
||||
},
|
||||
]
|
||||
|
||||
const selected = ref(1)
|
||||
@@ -284,4 +292,4 @@ export default {
|
||||
.layui-menu-docs .layui-menu-body-title .layui-font-gray {
|
||||
padding-left: 10px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -148,7 +148,11 @@ const zhCN = [
|
||||
path: '/zh-CN/components/iconPicker',
|
||||
component: () => import('../../docs/zh-CN/components/iconPicker.md'),
|
||||
meta: { title: '图标选择' },
|
||||
}
|
||||
}, {
|
||||
path: '/zh-CN/components/tree',
|
||||
component: () => import('../../docs/zh-CN/components/tree.md'),
|
||||
meta: { title: '树形组件' }
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user