Element: [Bug Report] el-menu in router mode should expose router-links so that users can "Open Link in New Tab"

Created on 30 Nov 2018  ·  2Comments  ·  Source: ElemeFE/element

Element UI version

2.4.11

OS/Browsers version

Windows 10 / Version 70.0.3538.102 (Official Build) (64-bit)

Vue version

2.5.17

Reproduction Link

https://jsfiddle.net/fuyrvn6L/2/

Steps to reproduce

See the reproduction link. A normal router-link places an anchor on the DOM and then users can Ctrl click or right click to open link in a new tab. Unfortunately, with the el-menu, this does not work.

Note: I have also tried placing a router-link inside the el-menu, like this <el-menu><router-link>click me</router-link></el-menu>. This is not ideal either though because then a user has to click on the words themselves and not overall menu item.

What is Expected?

I expect el-menu in router mode to expose a router-link/anchor

What is actually happening?

pure javascript is being used to perform a router.push

Most helpful comment

@freeman-g good idea, I posted similar issue here: https://github.com/ElemeFE/element/issues/12212

NavMenu has a lot of usability issues by design and need to be reworked. Note that element-ui examples by itself use custom menu :)

Also, it's impossible to create element menu which doesn't trigger any route, for example, it useful for language switcher.

Closing https://github.com/ElemeFE/element/issues/12212 because this one has better description.

All 2 comments

@freeman-g good idea, I posted similar issue here: https://github.com/ElemeFE/element/issues/12212

NavMenu has a lot of usability issues by design and need to be reworked. Note that element-ui examples by itself use custom menu :)

Also, it's impossible to create element menu which doesn't trigger any route, for example, it useful for language switcher.

Closing https://github.com/ElemeFE/element/issues/12212 because this one has better description.

Received, we see how to support

Was this page helpful?
0 / 5 - 0 ratings