mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
23 lines
430 B
JavaScript
23 lines
430 B
JavaScript
// 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>;
|
|
},
|
|
});
|