[improvement] declare functional sfc (#2695)

This commit is contained in:
neverland
2019-02-06 21:11:12 +08:00
committed by GitHub
parent 061382014d
commit 1b60e4df80
14 changed files with 465 additions and 494 deletions

View File

@@ -2,25 +2,21 @@ import { use } from '../utils';
const [sfc, bem] = use('cell-group');
export default sfc(
{
props: {
border: {
type: Boolean,
default: true
}
},
export default sfc({
functional: true,
render(h, context) {
return (
<div
class={[bem(), { 'van-hairline--top-bottom': context.props.border }]}
{...context.data}
>
{context.children}
</div>
);
props: {
border: {
type: Boolean,
default: true
}
},
true
);
render(h, context) {
return (
<div class={[bem(), { 'van-hairline--top-bottom': context.props.border }]} {...context.data}>
{context.children}
</div>
);
}
});