[improvement] Sku: partial functional (#2756)

This commit is contained in:
neverland
2019-02-15 21:00:46 +08:00
committed by GitHub
parent 632cfbcf36
commit 880f574b9a
3 changed files with 88 additions and 90 deletions

View File

@@ -1,18 +1,19 @@
import { use } from '../../utils';
import { inherit } from '../../utils/functional';
const [sfc, bem] = use('sku-row');
export default sfc({
props: {
skuRow: Object
},
function SkuRow(h, props, slots, ctx) {
return (
<div class={bem()} {...inherit(ctx)}>
<div class={bem('title')}>{props.skuRow.k}</div>
{slots.default && slots.default()}
</div>
);
}
render(h) {
return (
<div class={bem()}>
<div class={bem('title')}>{this.skuRow.k}</div>
{this.slots()}
</div>
);
}
});
SkuRow.props = {
skuRow: Object
};
export default sfc(SkuRow);