我正在为我的Android游戏开发一个管理员控制台。它是一个单一页面的web应用程序。我正在使用Vue.js和iView。因此,主页包含一个iView侧导航栏,它包含menu-items,我试图将每个menu-item与屏幕上显示的不同组件链接起来,但是@click、@select和@change不会触发更新显示组件的函数。以下是代码:
<Sider hide-trigger :style="{background: '#fff'}">
<Menu v-bind:active-name="currentActiveBranch" theme="light" width="auto" v-bind:open-names="[currentActiveSection]" accordion>
<Submenu v-for="section in sections" :key="section.title" v-bind:name="section.title">
<template slot="title">
<Icon v-bind:type="section.icon"></Icon>
{{ section.title }}
</template>
<menu-item v-for="branch in section.branches" :key="branch" v-bind:name="branch">{{ branch }}</menu-item>
</Submenu>
</Menu>
</Sider>因此,我希望在选择menu-item时更改显示的组件。
发布于 2018-06-18 16:35:29
在搜索后,该溶液使用@click.native="function_name"。有关更多信息,请查看以下链接:https://github.com/iview/iview/issues/2412
https://stackoverflow.com/questions/50605506
复制相似问题