import { use } from '../utils'; import Button, { ButtonType, ButtonEvents } from '../button'; import { emit, inherit } from '../utils/functional'; import { functionalRoute, routeProps, RouteProps } from '../utils/router'; // Types import { CreateElement, RenderContext } from 'vue/types'; import { DefaultSlots } from '../utils/types'; export type GoodsActionButtonProps = RouteProps & { text?: string; type?: ButtonType; primary?: boolean; loading?: boolean; disabled?: boolean; }; const [sfc, bem] = use('goods-action-button'); function GoodsActionButton( h: CreateElement, props: GoodsActionButtonProps, slots: DefaultSlots, ctx: RenderContext ) { function onClick(event: Event) { emit(ctx, 'click', event); functionalRoute(ctx); } return ( ); } GoodsActionButton.props = { ...routeProps, type: String, text: String, loading: Boolean, disabled: Boolean }; export default sfc(GoodsActionButton);