mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 18:01:24 +08:00
70 lines
2.1 KiB
Vue
70 lines
2.1 KiB
Vue
|
<template>
|
||
|
<el-menu
|
||
|
:default-active="activeIndex"
|
||
|
class="el-menu-demo"
|
||
|
mode="horizontal"
|
||
|
@select="handleSelect"
|
||
|
>
|
||
|
<el-menu-item index="1">Processing Center</el-menu-item>
|
||
|
<el-sub-menu index="2">
|
||
|
<template #title>Workspace</template>
|
||
|
<el-menu-item index="2-1">item one</el-menu-item>
|
||
|
<el-menu-item index="2-2">item two</el-menu-item>
|
||
|
<el-menu-item index="2-3">item three</el-menu-item>
|
||
|
<el-sub-menu index="2-4">
|
||
|
<template #title>item four</template>
|
||
|
<el-menu-item index="2-4-1">item one</el-menu-item>
|
||
|
<el-menu-item index="2-4-2">item two</el-menu-item>
|
||
|
<el-menu-item index="2-4-3">item three</el-menu-item>
|
||
|
</el-sub-menu>
|
||
|
</el-sub-menu>
|
||
|
<el-menu-item index="3" disabled>Info</el-menu-item>
|
||
|
<el-menu-item index="4">Orders</el-menu-item>
|
||
|
</el-menu>
|
||
|
<div class="line"></div>
|
||
|
<el-menu
|
||
|
:default-active="activeIndex2"
|
||
|
class="el-menu-demo"
|
||
|
mode="horizontal"
|
||
|
background-color="#545c64"
|
||
|
text-color="#fff"
|
||
|
active-text-color="#ffd04b"
|
||
|
@select="handleSelect"
|
||
|
>
|
||
|
<el-menu-item index="1">Processing Center</el-menu-item>
|
||
|
<el-sub-menu index="2">
|
||
|
<template #title>Workspace</template>
|
||
|
<el-menu-item index="2-1">item one</el-menu-item>
|
||
|
<el-menu-item index="2-2">item two</el-menu-item>
|
||
|
<el-menu-item index="2-3">item three</el-menu-item>
|
||
|
<el-sub-menu index="2-4">
|
||
|
<template #title>item four</template>
|
||
|
<el-menu-item index="2-4-1">item one</el-menu-item>
|
||
|
<el-menu-item index="2-4-2">item two</el-menu-item>
|
||
|
<el-menu-item index="2-4-3">item three</el-menu-item>
|
||
|
</el-sub-menu>
|
||
|
</el-sub-menu>
|
||
|
<el-menu-item index="3" disabled>Info</el-menu-item>
|
||
|
<el-menu-item index="4">Orders</el-menu-item>
|
||
|
</el-menu>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts">
|
||
|
import { defineComponent, ref } from 'vue'
|
||
|
|
||
|
export default defineComponent({
|
||
|
setup() {
|
||
|
const activeIndex = ref('1')
|
||
|
const activeIndex2 = ref('1')
|
||
|
const handleSelect = (key, keyPath) => {
|
||
|
console.log(key, keyPath)
|
||
|
}
|
||
|
return {
|
||
|
activeIndex,
|
||
|
activeIndex2,
|
||
|
handleSelect,
|
||
|
}
|
||
|
},
|
||
|
})
|
||
|
</script>
|