chore: merge src and src-next

This commit is contained in:
chenjiahan
2020-07-15 20:02:00 +08:00
parent 6672b34618
commit 0304fcb6fa
382 changed files with 464 additions and 24746 deletions
+22
View File
@@ -0,0 +1,22 @@
// Utils
import { isDef, createNamespace } from '../utils';
const [createComponent, bem] = createNamespace('info');
export default createComponent({
props: {
dot: Boolean,
info: [Number, String],
},
render() {
const { dot, info } = this;
const showInfo = isDef(info) && info !== '';
if (!dot && !showInfo) {
return;
}
return <div class={bem({ dot })}>{dot ? '' : info}</div>;
},
});
-42
View File
@@ -1,42 +0,0 @@
// 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;
badge?: string | number;
};
const [createComponent, bem] = createNamespace('info');
function Info(
h: CreateElement,
props: InfoProps,
slots: DefaultSlots,
ctx: RenderContext<InfoProps>
) {
const { dot, info } = props;
const showInfo = isDef(info) && info !== '';
if (!dot && !showInfo) {
return;
}
return (
<div class={bem({ dot })} {...inherit(ctx, true)}>
{dot ? '' : props.info}
</div>
);
}
Info.props = {
dot: Boolean,
info: [Number, String],
};
export default createComponent<InfoProps>(Info);