A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bootstrap-vue/bootstrap-vue/commit/9b1edc978f7029facaf5a4f2a512b13cd43987a8 below:

accepts custom attributes (#6858) · bootstrap-vue/bootstrap-vue@9b1edc9 · GitHub

File tree Expand file treeCollapse file tree 6 files changed

+65

-19

lines changed

Filter options

Expand file treeCollapse file tree 6 files changed

+65

-19

lines changed Original file line number Diff line number Diff line change

@@ -1,4 +1,4 @@

1 -

import { Vue } from '../../vue'

1 +

import { Vue, mergeData } from '../../vue'

2 2

import { NAME_SKELETON_ICON } from '../../constants/components'

3 3

import { PROP_TYPE_OBJECT, PROP_TYPE_STRING } from '../../constants/props'

4 4

import { makeProp, makePropsConfigurable } from '../../utils/props'

@@ -22,7 +22,7 @@ export const BSkeletonIcon = /*#__PURE__*/ Vue.extend({

22 22

name: NAME_SKELETON_ICON,

23 23

functional: true,

24 24

props,

25 -

render(h, { props }) {

25 +

render(h, { data, props }) {

26 26

const { icon, animation } = props

27 27 28 28

const $icon = h(BIcon, {

@@ -35,10 +35,10 @@ export const BSkeletonIcon = /*#__PURE__*/ Vue.extend({

35 35 36 36

return h(

37 37

'div',

38 -

{

38 +

mergeData(data, {

39 39

staticClass: 'b-skeleton-icon-wrapper position-relative d-inline-block overflow-hidden',

40 40

class: { [`b-skeleton-animate-${animation}`]: animation }

41 -

},

41 +

}),

42 42

[$icon]

43 43

)

44 44

}

Original file line number Diff line number Diff line change

@@ -72,4 +72,17 @@ describe('skeleton-icon', () => {

72 72 73 73

wrapper.destroy()

74 74

})

75 + 76 +

it('accepts custom classes', async () => {

77 +

const wrapper = mount(BSkeletonIcon, {

78 +

context: {

79 +

class: ['foobar']

80 +

}

81 +

})

82 + 83 +

expect(wrapper.classes()).toContain('b-skeleton-icon-wrapper')

84 +

expect(wrapper.classes()).toContain('foobar')

85 + 86 +

wrapper.destroy()

87 +

})

75 88

})

Original file line number Diff line number Diff line change

@@ -1,4 +1,4 @@

1 -

import { Vue } from '../../vue'

1 +

import { Vue, mergeData } from '../../vue'

2 2

import { NAME_SKELETON_IMG } from '../../constants/components'

3 3

import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props'

4 4

import { makeProp, makePropsConfigurable } from '../../utils/props'

@@ -27,19 +27,22 @@ export const BSkeletonImg = /*#__PURE__*/ Vue.extend({

27 27

name: NAME_SKELETON_IMG,

28 28

functional: true,

29 29

props,

30 -

render(h, { props }) {

30 +

render(h, { data, props }) {

31 31

const { aspect, width, height, animation, variant, cardImg } = props

32 32 33 -

const $img = h(BSkeleton, {

34 -

props: {

35 -

type: 'img',

36 -

width,

37 -

height,

38 -

animation,

39 -

variant

40 -

},

41 -

class: { [`card-img-${cardImg}`]: cardImg }

42 -

})

33 +

const $img = h(

34 +

BSkeleton,

35 +

mergeData(data, {

36 +

props: {

37 +

type: 'img',

38 +

width,

39 +

height,

40 +

animation,

41 +

variant

42 +

},

43 +

class: { [`card-img-${cardImg}`]: cardImg }

44 +

})

45 +

)

43 46 44 47

return props.noAspect ? $img : h(BAspect, { props: { aspect } }, [$img])

45 48

}

Original file line number Diff line number Diff line change

@@ -123,4 +123,17 @@ describe('skeleton-img', () => {

123 123 124 124

wrapper.destroy()

125 125

})

126 + 127 +

it('accepts custom classes', async () => {

128 +

const wrapper = mount(BSkeletonImg, {

129 +

context: {

130 +

class: ['foobar']

131 +

}

132 +

})

133 + 134 +

expect(wrapper.find('.b-aspect-content > .b-skeleton-img').exists()).toBe(true)

135 +

expect(wrapper.find('.b-aspect-content > .b-skeleton-img').classes()).toContain('foobar')

136 + 137 +

wrapper.destroy()

138 +

})

126 139

})

Original file line number Diff line number Diff line change

@@ -1,4 +1,4 @@

1 -

import { Vue } from '../../vue'

1 +

import { Vue, mergeData } from '../../vue'

2 2

import { NAME_SKELETON_TABLE } from '../../constants/components'

3 3

import {

4 4

PROP_TYPE_BOOLEAN,

@@ -36,7 +36,7 @@ export const BSkeletonTable = /*#__PURE__*/ Vue.extend({

36 36

name: NAME_SKELETON_TABLE,

37 37

functional: true,

38 38

props,

39 -

render(h, { props }) {

39 +

render(h, { data, props }) {

40 40

const { animation, columns } = props

41 41 42 42

const $th = h('th', [h(BSkeleton, { props: { animation } })])

@@ -49,6 +49,10 @@ export const BSkeletonTable = /*#__PURE__*/ Vue.extend({

49 49

const $thead = !props.hideHeader ? h('thead', [$thTr]) : h()

50 50

const $tfoot = props.showFooter ? h('tfoot', [$thTr]) : h()

51 51 52 -

return h(BTableSimple, { props: { ...props.tableProps } }, [$thead, $tbody, $tfoot])

52 +

return h(BTableSimple, mergeData(data, { props: { ...props.tableProps } }), [

53 +

$thead,

54 +

$tbody,

55 +

$tfoot

56 +

])

53 57

}

54 58

})

Original file line number Diff line number Diff line change

@@ -103,4 +103,17 @@ describe('skeleton-table', () => {

103 103 104 104

wrapper.destroy()

105 105

})

106 + 107 +

it('accepts custom classes', async () => {

108 +

const wrapper = mount(BSkeletonTable, {

109 +

context: {

110 +

class: ['foobar']

111 +

}

112 +

})

113 + 114 +

expect(wrapper.classes()).toContain('b-table')

115 +

expect(wrapper.classes()).toContain('foobar')

116 + 117 +

wrapper.destroy()

118 +

})

106 119

})

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