|
| 1 | +<script lang="ts" setup> |
| 2 | +import { ref } from "vue"; |
| 3 | +import { |
| 4 | + Location, |
| 5 | + Document, |
| 6 | + Menu as IconMenu, |
| 7 | + Setting, |
| 8 | +} from "@element-plus/icons-vue"; |
| 9 | +
|
| 10 | +const isCollapse = ref(true); |
| 11 | +const handleOpen = (key: string, keyPath: string[]) => { |
| 12 | + console.log(key, keyPath); |
| 13 | +}; |
| 14 | +const handleClose = (key: string, keyPath: string[]) => { |
| 15 | + console.log(key, keyPath); |
| 16 | +}; |
| 17 | +</script> |
| 18 | + |
1 | 19 | <template> |
2 | 20 | <el-menu |
| 21 | + router |
3 | 22 | default-active="1" |
4 | 23 | class="el-menu-vertical-demo" |
5 | 24 | @open="handleOpen" |
|
25 | 44 | <el-menu-item index="1-4-1">item one</el-menu-item> |
26 | 45 | </el-sub-menu> |
27 | 46 | </el-sub-menu> |
28 | | - <el-menu-item index="2"> |
| 47 | + <el-menu-item index="/nav/2"> |
29 | 48 | <el-icon> |
30 | 49 | <IconMenu /> |
31 | 50 | </el-icon> |
|
37 | 56 | </el-icon> |
38 | 57 | <template #title>Navigator Three</template> |
39 | 58 | </el-menu-item> |
40 | | - <el-menu-item index="4"> |
| 59 | + <el-menu-item index="/nav/4"> |
41 | 60 | <el-icon> |
42 | 61 | <Setting /> |
43 | 62 | </el-icon> |
|
46 | 65 | </el-menu> |
47 | 66 | </template> |
48 | 67 |
|
49 | | -<script lang="ts" setup> |
50 | | -import { ref } from "vue"; |
51 | | -import { |
52 | | - Location, |
53 | | - Document, |
54 | | - Menu as IconMenu, |
55 | | - Setting, |
56 | | -} from "@element-plus/icons-vue"; |
57 | | -
|
58 | | -const isCollapse = ref(true); |
59 | | -const handleOpen = (key: string, keyPath: string[]) => { |
60 | | - console.log(key, keyPath); |
61 | | -}; |
62 | | -const handleClose = (key: string, keyPath: string[]) => { |
63 | | - console.log(key, keyPath); |
64 | | -}; |
65 | | -</script> |
|
0 commit comments