Skip to content

Added 2 properties #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/markdown/en/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ Used together with `vue-router`. Set `router` property to `at-menu`, and Passed
| to | the object of `vue-router`, same as the `to` property in `vue-router` | String / Object | - | - |
| replace | whether to add new history when using `to` | Boolean | - | false |
| disabled | whether the MenuItem is disabled | Boolean | - | false |
| exact | The default active class matching behavior is inclusive match. For example, `<router-link to="/a">` will get this class applied as long as the current path starts with /a/ or is /a. To force the link into "exact match mode", use the `exact` prop. This prop work when using `to` | Boolean | - | false |
| event |Specify the event(s) that can trigger the link navigation. This prop work when using `to` | String / Array | - | "click" |

<script>
export default {
Expand Down
15 changes: 14 additions & 1 deletion src/components/menu/src/menu-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
this.active ? 'at-menu__item--active' : '',
this.disabled ? 'at-menu__item--disabled' : ''
]" @click="handleClick">
<router-link v-if="Object.keys(to).length" class="at-menu__item-link" ref="link" :to="to">
<router-link v-if="Object.keys(to).length"
class="at-menu__item-link"
ref="link"
:to="to"
:exact="exact"
:event="event">
<slot></slot>
</router-link>
<div v-else class="at-menu__item-link">
Expand Down Expand Up @@ -38,6 +43,14 @@
disabled: {
type: Boolean,
default: false
},
exact: {
type: Boolean,
default: false
},
event: {
type: [String,Array],
default: 'click'
}
},
data () {
Expand Down