Skip to content

Commit

Permalink
fix(base): custom link and button should dispatch click event when re…
Browse files Browse the repository at this point in the history
…ndering router-link

closes #206
  • Loading branch information
stasson committed Jan 13, 2018
1 parent f95274e commit bfd3e5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/base/custom-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export const CustomButton = {
element = context.parent.$root.$options.components['router-link']
data.props = Object.assign({tag: context.props.tag}, context.props.link)
data.attrs.role = 'button'
if (data.on.click) {
data.nativeOn = {click: data.on.click }
}
} else if (data.attrs && data.attrs.href) {
// href case
element = 'a'
Expand Down
3 changes: 3 additions & 0 deletions components/base/custom-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export const CustomLink = {
// router-link case
element = context.parent.$root.$options.components['router-link']
data.props = Object.assign({tag: context.props.tag}, context.props.link)
if (data.on.click) {
data.nativeOn = {click: data.on.click }
}
} else {
// element fallback
element = context.props.tag
Expand Down

0 comments on commit bfd3e5a

Please sign in to comment.