[improvement] Functional components be just functions (#2735)

This commit is contained in:
neverland
2019-02-14 11:56:02 +08:00
committed by GitHub
parent 166397dad4
commit 5a9143c736
21 changed files with 704 additions and 674 deletions
+8 -10
View File
@@ -2,14 +2,12 @@ import { use } from '../utils';
const [sfc, bem] = use('goods-action');
export default sfc({
functional: true,
function GoodsAction(h, props, slots, ctx) {
return (
<div class={bem()} {...ctx.data}>
{slots.default && slots.default()}
</div>
);
}
render(h, context) {
return (
<div class={bem()} {...context.data}>
{context.children}
</div>
);
}
});
export default sfc(GoodsAction);