Skip to content

Commit 8e72a6b

Browse files
authored
Merge pull request bootstrap-vue#180 from cynecx/dropdown-item-button
[Dropdown-Item] Change the component type to button if 'href' and 'to…
2 parents f0214c2 + bd70fb8 commit 8e72a6b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/components/dropdown-item.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<a :is="componentType" class="dropdown-item" :to="to" :href="hrefString" @click="click">
2+
<a :is="itemType" class="dropdown-item" :to="to" :href="hrefString" @click="click">
33
<slot></slot>
44
</a>
55
</template>
@@ -8,6 +8,11 @@
88
import Link from './link.vue';
99
1010
export default {
11-
extends: Link
11+
extends: Link,
12+
computed: {
13+
itemType() {
14+
return (this.href || this.to) ? this.componentType : 'button';
15+
}
16+
}
1217
};
1318
</script>

0 commit comments

Comments
 (0)