File size: 929 Bytes
d95db82 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
<template> <el-col :span="data.span"> <el-menu :default-active="activeIndex" class="el-menu-demo" :mode="data.direction" @select="(key, keyPath) => console.log(key, keyPath)" :ellipsis="false" active-text-color="#ffd04b" background-color="#545c64" text-color="#fff" > <template v-for="item in data.menuItems"> <el-menu-item v-if="!item.subItems" :key="item.index" :index="item.index" :disabled="item.disabled" > {{ item.title }} </el-menu-item> <el-sub-menu v-else :key="item.index" :index="item.index"> <template #title>{{ item.title }}</template> <el-menu-item v-for="subItem in item.subItems" :key="subItem.index" :index="subItem.index" > {{ subItem.title }} </el-menu-item> </el-sub-menu> </template> </el-menu> </el-col> </template> |