refactor(tree): 树形组件重构优化暂存
This commit is contained in:
parent
f22e123be0
commit
8bb751699f
@ -78,7 +78,7 @@ export default {
|
|||||||
:::
|
:::
|
||||||
|
|
||||||
| | | |
|
| | | |
|
||||||
| ----------- | -------- | --- |
|
| --------------------- | ------ | --- |
|
||||||
| selectedKey (v-model) | 选中项 | -- |
|
| selectedKey (v-model) | 选中项 | -- |
|
||||||
| openKeys (v-model) | 打开项 | -- |
|
| openKeys (v-model) | 打开项 | -- |
|
||||||
|
|
||||||
@ -87,5 +87,5 @@ export default {
|
|||||||
:::
|
:::
|
||||||
|
|
||||||
| | | |
|
| | | |
|
||||||
| ----------- | -------- | --- |
|
| ----- | -------- | --- |
|
||||||
| title | 菜单标题 | -- |
|
| title | 菜单标题 | -- |
|
@ -80,9 +80,10 @@ export default {
|
|||||||
() => route.path,
|
() => route.path,
|
||||||
(val) => {
|
(val) => {
|
||||||
currentPath.value = val
|
currentPath.value = val
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
immediate: true,
|
immediate: true,
|
||||||
deep: true
|
deep: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -109,7 +110,7 @@ export default {
|
|||||||
id: 39,
|
id: 39,
|
||||||
title: '沙盒',
|
title: '沙盒',
|
||||||
subTitle: 'sandbox',
|
subTitle: 'sandbox',
|
||||||
path: '/zh-CN/guide/sandbox'
|
path: '/zh-CN/guide/sandbox',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
@ -290,37 +291,43 @@ export default {
|
|||||||
title: '复选框',
|
title: '复选框',
|
||||||
subTitle: 'checkbox',
|
subTitle: 'checkbox',
|
||||||
path: '/zh-CN/components/checkbox',
|
path: '/zh-CN/components/checkbox',
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
id: 33,
|
id: 33,
|
||||||
title: '单选框',
|
title: '单选框',
|
||||||
subTitle: 'radio',
|
subTitle: 'radio',
|
||||||
path: '/zh-CN/components/radio',
|
path: '/zh-CN/components/radio',
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
id: 34,
|
id: 34,
|
||||||
title: '输入框',
|
title: '输入框',
|
||||||
subTitle: 'input',
|
subTitle: 'input',
|
||||||
path: '/zh-CN/components/input',
|
path: '/zh-CN/components/input',
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
id: 35,
|
id: 35,
|
||||||
title: '文本域',
|
title: '文本域',
|
||||||
subTitle: 'textarea',
|
subTitle: 'textarea',
|
||||||
path: '/zh-CN/components/textarea',
|
path: '/zh-CN/components/textarea',
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
id: 36,
|
id: 36,
|
||||||
title: '开关',
|
title: '开关',
|
||||||
subTitle: 'switch',
|
subTitle: 'switch',
|
||||||
path: '/zh-CN/components/switch',
|
path: '/zh-CN/components/switch',
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
id: 37,
|
id: 37,
|
||||||
title: '滑块',
|
title: '滑块',
|
||||||
subTitle: 'slider',
|
subTitle: 'slider',
|
||||||
path: '/zh-CN/components/slider',
|
path: '/zh-CN/components/slider',
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
id: 38,
|
id: 38,
|
||||||
title: '轮播',
|
title: '轮播',
|
||||||
subTitle: 'carousel',
|
subTitle: 'carousel',
|
||||||
path: '/zh-CN/components/carousel'
|
path: '/zh-CN/components/carousel',
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const selected = ref(1)
|
const selected = ref(1)
|
||||||
|
@ -179,35 +179,42 @@ const zhCN = [
|
|||||||
path: '/zh-CN/components/transfer',
|
path: '/zh-CN/components/transfer',
|
||||||
component: () => import('../../docs/zh-CN/components/transfer.md'),
|
component: () => import('../../docs/zh-CN/components/transfer.md'),
|
||||||
meta: { title: '穿梭框' },
|
meta: { title: '穿梭框' },
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
path: '/zh-CN/components/checkbox',
|
path: '/zh-CN/components/checkbox',
|
||||||
component: () => import('../../docs/zh-CN/components/checkbox.md'),
|
component: () => import('../../docs/zh-CN/components/checkbox.md'),
|
||||||
meta: { title: '复选框' },
|
meta: { title: '复选框' },
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
path: '/zh-CN/components/radio',
|
path: '/zh-CN/components/radio',
|
||||||
component: () => import('../../docs/zh-CN/components/radio.md'),
|
component: () => import('../../docs/zh-CN/components/radio.md'),
|
||||||
meta: { title: '单选框' },
|
meta: { title: '单选框' },
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
path: '/zh-CN/components/input',
|
path: '/zh-CN/components/input',
|
||||||
component: () => import('../../docs/zh-CN/components/input.md'),
|
component: () => import('../../docs/zh-CN/components/input.md'),
|
||||||
meta: { title: '输入框' },
|
meta: { title: '输入框' },
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
path: '/zh-CN/components/textarea',
|
path: '/zh-CN/components/textarea',
|
||||||
component: () => import('../../docs/zh-CN/components/textarea.md'),
|
component: () => import('../../docs/zh-CN/components/textarea.md'),
|
||||||
meta: { title: '文本域' },
|
meta: { title: '文本域' },
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
path: '/zh-CN/components/switch',
|
path: '/zh-CN/components/switch',
|
||||||
component: () => import('../../docs/zh-CN/components/switch.md'),
|
component: () => import('../../docs/zh-CN/components/switch.md'),
|
||||||
meta: { title: '开关' },
|
meta: { title: '开关' },
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
path: '/zh-CN/components/slider',
|
path: '/zh-CN/components/slider',
|
||||||
component: () => import('../../docs/zh-CN/components/slider.md'),
|
component: () => import('../../docs/zh-CN/components/slider.md'),
|
||||||
meta: { title: '滑块' },
|
meta: { title: '滑块' },
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
path: '/zh-CN/components/carousel',
|
path: '/zh-CN/components/carousel',
|
||||||
component: () => import('../../docs/zh-CN/components/carousel.md'),
|
component: () => import('../../docs/zh-CN/components/carousel.md'),
|
||||||
meta: { title: '轮播' },
|
meta: { title: '轮播' },
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -6,8 +6,7 @@
|
|||||||
<script setup name="LayCarouselItem" lang="ts">
|
<script setup name="LayCarouselItem" lang="ts">
|
||||||
import { defineProps, inject } from 'vue'
|
import { defineProps, inject } from 'vue'
|
||||||
|
|
||||||
const props =
|
const props = defineProps<{
|
||||||
defineProps<{
|
|
||||||
id: string
|
id: string
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
>
|
>
|
||||||
{{ ss.props.title }}
|
{{ ss.props.title }}
|
||||||
<i
|
<i
|
||||||
@click.stop="close(ss.props.id)"
|
|
||||||
v-if="allowClose"
|
v-if="allowClose"
|
||||||
class="layui-icon layui-icon-close layui-unselect layui-tab-close"
|
class="layui-icon layui-icon-close layui-unselect layui-tab-close"
|
||||||
|
@click.stop="close(ss.props.id)"
|
||||||
></i>
|
></i>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -42,7 +42,7 @@ const active = computed({
|
|||||||
},
|
},
|
||||||
set(val) {
|
set(val) {
|
||||||
emit('update:modelValue', val)
|
emit('update:modelValue', val)
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const change = function (id: any) {
|
const change = function (id: any) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user