[improvement] Sku: tsx (#2801)

This commit is contained in:
neverland
2019-02-20 10:51:18 +08:00
committed by GitHub
parent bff9c9d6d9
commit 5c7c14d8df
8 changed files with 124 additions and 26 deletions
+33
View File
@@ -0,0 +1,33 @@
import { use } from '../../utils';
import { inherit } from '../../utils/functional';
// Types
import { CreateElement, RenderContext } from 'vue/types';
import { DefaultSlots } from '../../utils/use/sfc';
import { SkuTreeItemData } from '../type';
export type SkuRowProps = {
skuRow: SkuTreeItemData;
};
const [sfc, bem] = use('sku-row');
function SkuRow(
h: CreateElement,
props: SkuRowProps,
slots: DefaultSlots,
ctx: RenderContext<SkuRowProps>
) {
return (
<div class={bem()} {...inherit(ctx)}>
<div class={bem('title')}>{props.skuRow.k}</div>
{slots.default && slots.default()}
</div>
);
}
SkuRow.props = {
skuRow: Object
};
export default sfc<SkuRowProps>(SkuRow);