[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,21 +2,20 @@ import { use, isDef } from '../utils';
const [sfc, bem] = use('info');
export default sfc(
{
props: {
info: [String, Number]
},
export default sfc({
functional: true,
render(h, { props, data }) {
return (
isDef(props.info) && (
<div class={bem()} {...data}>
{props.info}
</div>
)
);
}
props: {
info: [String, Number]
},
true
);
render(h, { props, data }) {
return (
isDef(props.info) && (
<div class={bem()} {...data}>
{props.info}
</div>
)
);
}
});