小码问答,有问必答!

2021-04-30 18:30

在element-ui的子菜单中el-menu-item添加自己的@click事件后,点击就收回了,咋办?

nellac 2021-04-30 18:30 回答了这个问题

WEB前端

<el-submenu index="1">
        <template slot="title"><i class="el-icon-message"></i>在校班级</template>
        <el-menu-item-group v-for="group in onstudyclasses">
          <template slot="title">{{group.title}}</template>
          <template v-for="c in group.classes">
          <el-submenu :index="group.id+'-'+c.id" >
            <template slot="title">{{c.title}}</template>
            <el-menu-item v-for="student in c.students" :index="c.id+'-'+student.id" @click.native.prevent="clkStudent(student.id)">{{student.name}}</el-menu-item>
          </el-submenu>
          </template>
        </el-menu-item-group>
      </el-submenu>


题主您好,请问这个问题解决了吗?我也碰到了相同的问题。

0条评论

我要评论