Skip to content

Commit fefff24

Browse files
committed
refactor: CHeader, CFooter changes
- add tag prop, - add colorScheme prop to CHeader - update typings
1 parent 3dbf098 commit fefff24

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

src/components/Footer/CFooter.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
<template>
2-
<footer :class="classList">
2+
<component :is="tag" :class="classList">
33
<slot>Footer</slot>
4-
</footer>
4+
</component>
55
</template>
66

77
<script>
88
export default {
99
name: 'CFooter',
1010
props: {
11+
tag: {
12+
type: String,
13+
default: 'footer'
14+
},
1115
fixed: Boolean
1216
},
1317
computed: {

src/components/Header/CHeader.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
<template>
2-
<header :class="classList">
2+
<component :is="tag" :class="classList">
33
<slot></slot>
4-
</header>
4+
</component>
55
</template>
66

77
<script>
88
export default {
99
name: 'CHeader',
1010
props: {
11+
tag: {
12+
type: String,
13+
default: 'header'
14+
},
15+
colorScheme: {
16+
type: String,
17+
default: 'light'
18+
},
1119
fixed: Boolean,
1220
withSubheader: Boolean
1321
},
1422
computed: {
1523
classList () {
1624
return [
17-
'c-header c-header-light',
25+
'c-header',
26+
`c-header-${this.colorScheme}`,
1827
{
1928
'c-header-fixed': this.fixed,
2029
'c-header-with-subheader': this.withSubheader

src/components/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export declare class CEmbed extends Vue {
165165
}
166166

167167
export declare class CFooter extends Vue {
168+
tag: string
168169
fixed: boolean
169170
}
170171

@@ -296,6 +297,9 @@ export declare class CRow extends Vue {
296297

297298
export declare class CHeader extends Vue {
298299
fixed: boolean
300+
tag: string
301+
colorScheme: string
302+
withSubheader: boolean
299303
}
300304

301305
export declare class CImg extends Vue {

0 commit comments

Comments
 (0)