// Utils import { createNamespace, isDef } from '../utils'; import { inherit } from '../utils/functional'; // Types import { CreateElement, RenderContext } from 'vue/types'; import { DefaultSlots } from '../utils/types'; export type InfoProps = { dot?: boolean; info?: string | number; }; const [createComponent, bem] = createNamespace('info'); function Info( h: CreateElement, props: InfoProps, slots: DefaultSlots, ctx: RenderContext ) { const { dot, info } = props; const showInfo = isDef(info) && info !== ''; if (!dot && !showInfo) { return; } return (
{dot ? '' : props.info}
); } Info.props = { dot: Boolean, info: [Number, String], }; export default createComponent(Info);