refactor(tree): 树形组件重构优化暂存

This commit is contained in:
落小梅 2021-10-18 19:10:36 +08:00
parent f22e123be0
commit 8bb751699f
8 changed files with 109 additions and 96 deletions

View File

@ -78,7 +78,7 @@ export default {
:::
| | | |
| ----------- | -------- | --- |
| --------------------- | ------ | --- |
| selectedKey (v-model) | 选中项 | -- |
| openKeys (v-model) | 打开项 | -- |
@ -87,5 +87,5 @@ export default {
:::
| | | |
| ----------- | -------- | --- |
| ----- | -------- | --- |
| title | 菜单标题 | -- |

View File

@ -80,9 +80,10 @@ export default {
() => route.path,
(val) => {
currentPath.value = val
},{
},
{
immediate: true,
deep: true
deep: true,
}
)
@ -109,7 +110,7 @@ export default {
id: 39,
title: '沙盒',
subTitle: 'sandbox',
path: '/zh-CN/guide/sandbox'
path: '/zh-CN/guide/sandbox',
},
{
id: 4,
@ -290,37 +291,43 @@ export default {
title: '复选框',
subTitle: 'checkbox',
path: '/zh-CN/components/checkbox',
},{
},
{
id: 33,
title: '单选框',
subTitle: 'radio',
path: '/zh-CN/components/radio',
},{
},
{
id: 34,
title: '输入框',
subTitle: 'input',
path: '/zh-CN/components/input',
},{
},
{
id: 35,
title: '文本域',
subTitle: 'textarea',
path: '/zh-CN/components/textarea',
},{
},
{
id: 36,
title: '开关',
subTitle: 'switch',
path: '/zh-CN/components/switch',
},{
},
{
id: 37,
title: '滑块',
subTitle: 'slider',
path: '/zh-CN/components/slider',
},{
},
{
id: 38,
title: '轮播',
subTitle: 'carousel',
path: '/zh-CN/components/carousel'
}
path: '/zh-CN/components/carousel',
},
]
const selected = ref(1)

View File

@ -179,35 +179,42 @@ const zhCN = [
path: '/zh-CN/components/transfer',
component: () => import('../../docs/zh-CN/components/transfer.md'),
meta: { title: '穿梭框' },
},{
},
{
path: '/zh-CN/components/checkbox',
component: () => import('../../docs/zh-CN/components/checkbox.md'),
meta: { title: '复选框' },
},{
},
{
path: '/zh-CN/components/radio',
component: () => import('../../docs/zh-CN/components/radio.md'),
meta: { title: '单选框' },
},{
},
{
path: '/zh-CN/components/input',
component: () => import('../../docs/zh-CN/components/input.md'),
meta: { title: '输入框' },
},{
},
{
path: '/zh-CN/components/textarea',
component: () => import('../../docs/zh-CN/components/textarea.md'),
meta: { title: '文本域' },
},{
},
{
path: '/zh-CN/components/switch',
component: () => import('../../docs/zh-CN/components/switch.md'),
meta: { title: '开关' },
},{
},
{
path: '/zh-CN/components/slider',
component: () => import('../../docs/zh-CN/components/slider.md'),
meta: { title: '滑块' },
},{
},
{
path: '/zh-CN/components/carousel',
component: () => import('../../docs/zh-CN/components/carousel.md'),
meta: { title: '轮播' },
}
},
],
},
]

View File

@ -6,8 +6,7 @@
<script setup name="LayCarouselItem" lang="ts">
import { defineProps, inject } from 'vue'
const props =
defineProps<{
const props = defineProps<{
id: string
}>()

View File

@ -9,9 +9,9 @@
>
{{ ss.props.title }}
<i
@click.stop="close(ss.props.id)"
v-if="allowClose"
class="layui-icon layui-icon-close layui-unselect layui-tab-close"
@click.stop="close(ss.props.id)"
></i>
</li>
</ul>
@ -42,7 +42,7 @@ const active = computed({
},
set(val) {
emit('update:modelValue', val)
}
},
})
const change = function (id: any) {