import { createNamespace } from '../../utils'; import { inherit } from '../../utils/functional'; import Button from '../../button'; // Types import Vue, { CreateElement, RenderContext } from 'vue/types'; import { DefaultSlots } from '../../utils/types'; export type SkuActionsProps = { buyText?: string; skuEventBus: Vue; addCartText?: string; showAddCartBtn?: boolean; }; const [createComponent, bem] = createNamespace('sku-actions'); function SkuActions( h: CreateElement, props: SkuActionsProps, slots: DefaultSlots, ctx: RenderContext ) { const createEmitter = (name: string) => () => { props.skuEventBus.$emit(name); }; return (
{props.showAddCartBtn && (
); } SkuActions.props = { buyText: String, addCartText: String, skuEventBus: Object, showAddCartBtn: Boolean }; export default createComponent(SkuActions);