Skip to content

Commit

Permalink
Merge pull request #180 from cynecx/dropdown-item-button
Browse files Browse the repository at this point in the history
[Dropdown-Item] Change the component type to button if 'href' and 'to…
  • Loading branch information
pi0 committed Mar 27, 2017
2 parents f0214c2 + bd70fb8 commit 8e72a6b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/components/dropdown-item.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<a :is="componentType" class="dropdown-item" :to="to" :href="hrefString" @click="click">
<a :is="itemType" class="dropdown-item" :to="to" :href="hrefString" @click="click">
<slot></slot>
</a>
</template>
Expand All @@ -8,6 +8,11 @@
import Link from './link.vue';
export default {
extends: Link
extends: Link,
computed: {
itemType() {
return (this.href || this.to) ? this.componentType : 'button';
}
}
};
</script>

0 comments on commit 8e72a6b

Please sign in to comment.