+65
-7
lines changedFilter options
+65
-7
lines changed Original file line number Diff line number Diff line change
@@ -10,6 +10,10 @@ export const props = {
10
10
type: String,
11
11
default: 'active'
12
12
},
13
+
buttonClass: {
14
+
type: [String, Array, Object],
15
+
default: null
16
+
},
13
17
disabled: {
14
18
type: Boolean,
15
19
default: false
@@ -48,10 +52,13 @@ export const BDropdownItemButton = /*#__PURE__*/ Vue.extend({
48
52
'button',
49
53
{
50
54
staticClass: 'dropdown-item',
51
-
class: {
52
-
[this.activeClass]: this.active,
53
-
[`text-${this.variant}`]: this.variant && !(this.active || this.disabled)
54
-
},
55
+
class: [
56
+
this.buttonClass,
57
+
{
58
+
[this.activeClass]: this.active,
59
+
[`text-${this.variant}`]: this.variant && !(this.active || this.disabled)
60
+
}
61
+
],
55
62
attrs: {
56
63
...this.$attrs,
57
64
role: 'menuitem',
Original file line number Diff line number Diff line change
@@ -102,4 +102,19 @@ describe('dropdown-item-button', () => {
102
102
103
103
wrapper.destroy()
104
104
})
105
+
106
+
it('has buttonClass when prop is passed a value', () => {
107
+
const wrapper = mount(BDropdownItemButton, {
108
+
propsData: {
109
+
buttonClass: 'button-class'
110
+
}
111
+
})
112
+
expect(wrapper.is('li')).toBe(true)
113
+
114
+
const button = wrapper.find('button')
115
+
expect(button.classes()).toContain('button-class')
116
+
expect(button.classes()).toContain('dropdown-item')
117
+
118
+
wrapper.destroy()
119
+
})
105
120
})
Original file line number Diff line number Diff line change
@@ -17,6 +17,10 @@ export const BDropdownItem = /*#__PURE__*/ Vue.extend({
17
17
},
18
18
props: {
19
19
...props,
20
+
linkClass: {
21
+
type: [String, Array, Object],
22
+
default: null
23
+
},
20
24
variant: {
21
25
type: String,
22
26
default: null
@@ -43,9 +47,12 @@ export const BDropdownItem = /*#__PURE__*/ Vue.extend({
43
47
{
44
48
props: this.$props,
45
49
staticClass: 'dropdown-item',
46
-
class: {
47
-
[`text-${this.variant}`]: this.variant && !(this.active || this.disabled)
48
-
},
50
+
class: [
51
+
this.linkClass,
52
+
{
53
+
[`text-${this.variant}`]: this.variant && !(this.active || this.disabled)
54
+
}
55
+
],
49
56
attrs: { ...this.$attrs, role: 'menuitem' },
50
57
on: { click: this.onClick },
51
58
ref: 'item'
Original file line number Diff line number Diff line change
@@ -79,6 +79,21 @@ describe('dropdown-item', () => {
79
79
wrapper.destroy()
80
80
})
81
81
82
+
it('has linkClass when prop is passed a value', () => {
83
+
const wrapper = mount(BDropdownItem, {
84
+
propsData: {
85
+
linkClass: 'link-class'
86
+
}
87
+
})
88
+
expect(wrapper.is('li')).toBe(true)
89
+
90
+
const item = wrapper.find('a')
91
+
expect(item.classes()).toContain('link-class')
92
+
expect(item.classes()).toContain('dropdown-item')
93
+
94
+
wrapper.destroy()
95
+
})
96
+
82
97
describe('router-link support', () => {
83
98
it('works', async () => {
84
99
const localVue = new CreateLocalVue()
Original file line number Diff line number Diff line change
@@ -198,6 +198,13 @@
198
198
"aliases": [
199
199
"BDdItem"
200
200
],
201
+
"props": [
202
+
{
203
+
"prop": "linkClass",
204
+
"version": "2.9.0",
205
+
"description": "Class or classes to apply to the inner link element"
206
+
}
207
+
],
201
208
"events": [
202
209
{
203
210
"event": "click",
@@ -219,6 +226,13 @@
219
226
"BDdItemButton",
220
227
"BDdItemBtn"
221
228
],
229
+
"props": [
230
+
{
231
+
"prop": "buttonClass",
232
+
"version": "2.9.0",
233
+
"description": "Class or classes to apply to the inner button element"
234
+
}
235
+
],
222
236
"events": [
223
237
{
224
238
"event": "click",
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4