📝(menu): 补充 child-spacing 层级缩进 demo

This commit is contained in:
就眠儀式 2022-05-06 10:56:50 +08:00
parent a71dffb6f5
commit c331fc53c3

View File

@ -473,6 +473,65 @@ export default {
:::
::: title 层级缩进
:::
::: demo
<template>
<lay-menu v-model:selectedKey="selectedKey" v-model:openKeys="openKeys7" :child-spacing="childSpacing" v-model:tree="isTree">
<lay-menu-item id="1">
<router-link to="">
<lay-icon type="layui-icon-home"></lay-icon>
首页
</router-link>
</lay-menu-item>
<lay-sub-menu id="7">
<template v-slot:title>
<router-link to="">
<lay-icon type="layui-icon-home"></lay-icon>
目录
</router-link>
</template>
<lay-menu-item id="8">
<router-link to="">
<lay-icon type="layui-icon-home"></lay-icon>
菜单
</router-link>
</lay-menu-item>
<lay-menu-item id="9">
<router-link to="">
<lay-icon type="layui-icon-home"></lay-icon>
菜单
</router-link>
</lay-menu-item>
</lay-sub-menu>
</lay-menu>
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
const isTree = ref(true)
const selectedKey = ref("5")
const openKeys7 = ref(["7"])
const childSpacing = ref(true);
return {
isTree,
openKeys7,
selectedKey,
childSpacing
}
}
}
</script>
:::
::: title Menu 属性
:::