-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: makes Card components susceptible to external attributes (e.g. s…
…tyle/class)
- Loading branch information
Showing
5 changed files
with
41 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
import * as tsx from 'vue-tsx-support'; | ||
import { CreateElement, VNode } from 'vue'; | ||
import { mergeCss } from '../../utils/css'; | ||
|
||
export const Card = tsx.component({ | ||
name: 'Card', | ||
functional: true, | ||
render(h: CreateElement, { children }): VNode { | ||
return <div staticClass="card">{children}</div>; | ||
render(h: CreateElement, { children, data }): VNode { | ||
const cssClass = mergeCss(data, 'card'); | ||
|
||
return ( | ||
<div {...data} class={cssClass}> | ||
{children} | ||
</div> | ||
); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
import * as tsx from 'vue-tsx-support'; | ||
import { CreateElement, VNode } from 'vue'; | ||
import { mergeCss } from '../../utils/css'; | ||
|
||
export const CardBody = tsx.component({ | ||
name: 'CardBody', | ||
functional: true, | ||
render(h: CreateElement, { children }): VNode { | ||
return <div staticClass="card-body">{children}</div>; | ||
render(h: CreateElement, { children, data }): VNode { | ||
const cssClass = mergeCss(data, 'card-body'); | ||
|
||
return ( | ||
<div {...data} class={cssClass}> | ||
{children} | ||
</div> | ||
); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
import * as tsx from 'vue-tsx-support'; | ||
import { CreateElement, VNode } from 'vue'; | ||
import { mergeCss } from '../../utils/css'; | ||
|
||
export const CardFooter = tsx.component({ | ||
name: 'CardFooter', | ||
functional: true, | ||
render(h: CreateElement, { children }): VNode { | ||
return <div staticClass="card-footer">{children}</div>; | ||
render(h: CreateElement, { children, data }): VNode { | ||
const cssClass = mergeCss(data, 'card-footer'); | ||
|
||
return ( | ||
<div {...data} class={cssClass}> | ||
{children} | ||
</div> | ||
); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
import * as tsx from 'vue-tsx-support'; | ||
import { CreateElement, VNode } from 'vue'; | ||
import { mergeCss } from '../../utils/css'; | ||
|
||
export const CardHeader = tsx.component({ | ||
name: 'CardHeader', | ||
functional: true, | ||
render(h: CreateElement, { children }): VNode { | ||
return <div staticClass="card-header">{children}</div>; | ||
render(h: CreateElement, { children, data }): VNode { | ||
const cssClass = mergeCss(data, 'card-header'); | ||
|
||
return ( | ||
<div {...data} class={cssClass}> | ||
{children} | ||
</div> | ||
); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters