I put a button here, how to click this button to jump to the corresponding menu item, or change the focus of the current menu
<template>
<div id="app">
<button @click="change()">3</button>
<el-container>
<el-aside>
<el-row>
<el-col>
<el-menu default-active="1" class="el-menu-vertical-demo" background-color="-sharp545c64" text-color="-sharpfff" active-text-color="-sharpffd04b" router="true">
<el-menu-item index="1" route="/">
<i class="el-icon-location"></i>
<span slot="title"></span>
</el-menu-item>
<el-menu-item index="2" route="/about">
<i class="el-icon-menu"></i>
<span slot="title">API</span>
</el-menu-item>
<el-menu-item index="3" :route="{name: "api"}">
<i class="el-icon-document"></i>
<span slot="title"></span>
</el-menu-item>
<el-menu-item index="4" :route="{name: "test"}">
<i class="el-icon-setting"></i>
<span slot="title"></span>
</el-menu-item>
<el-menu-item index="5" :route="{name: "todo"}">
<i class="el-icon-setting"></i>
<span slot="title">todo</span>
</el-menu-item>
</el-menu>
</el-col>
</el-row>
</el-aside>
<!-- -->
<el-main>
<router-view />
</el-main>
</el-container>
</div>
</template>
<script>
export default {
methods: {
change() {
console.log("");
}
}
};
</script>
<style>
</style>
Picture