Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 17ccc9d

Browse filesBrowse files
committed
Merge branch 'main' of https://github.com/coreui/coreui-vue
2 parents 18c962d + 7d80cc6 commit 17ccc9d
Copy full SHA for 17ccc9d

File tree

2 files changed

+27
-1
lines changed
Filter options

2 files changed

+27
-1
lines changed

‎packages/coreui-vue/src/components/footer/CFooter.ts

Copy file name to clipboardExpand all lines: packages/coreui-vue/src/components/footer/CFooter.ts
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import { defineComponent, h } from 'vue'
33
const CFooter = defineComponent({
44
name: 'CFooter',
55
props: {
6+
/**
7+
* Component used for the root node. Either a string to use a HTML element or a component.
8+
*/
9+
as: {
10+
type: String,
11+
default: 'div',
12+
},
613
/**
714
* Place footer in non-static positions.
815
*
@@ -18,7 +25,7 @@ const CFooter = defineComponent({
1825
setup(props, { slots }) {
1926
return () =>
2027
h(
21-
'div',
28+
props.as,
2229
{ class: ['footer', { [`footer-${props.position}`]: props.position }] },
2330
slots.default && slots.default(),
2431
)

‎packages/coreui-vue/src/components/footer/__tests__/CFooter.spec.ts

Copy file name to clipboardExpand all lines: packages/coreui-vue/src/components/footer/__tests__/CFooter.spec.ts
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ const customWrapper = mount(Component, {
1919
},
2020
})
2121

22+
const customWrapperTwo = mount(Component, {
23+
propsData: {
24+
as: 'footer',
25+
},
26+
slots: {
27+
default: 'Default slot',
28+
},
29+
})
30+
2231
describe(`Loads and display ${ComponentName} component`, () => {
2332
it('has a name', () => {
2433
expect(Component.name).toMatch(ComponentName)
@@ -42,3 +51,13 @@ describe(`Customize ${ComponentName} component`, () => {
4251
expect(customWrapper.classes('footer-fixed')).toBe(true)
4352
})
4453
})
54+
55+
describe(`Customize (number two) ${ComponentName} component`, () => {
56+
it('renders correctly', () => {
57+
expect(customWrapperTwo.html()).toMatchSnapshot()
58+
})
59+
60+
it('tag name is custom', () => {
61+
expect(customWrapperTwo.element.tagName).toBe('FOOTER')
62+
})
63+
})

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.