ant-design-vue/components/skeleton/Title.tsx

23 lines
685 B
Vue
Raw Normal View History

2020-10-18 14:03:57 +00:00
import { defineComponent, ExtractPropTypes } from 'vue';
2019-01-12 03:33:27 +00:00
import PropTypes from '../_util/vue-types';
2018-12-10 03:34:51 +00:00
const skeletonTitleProps = {
prefixCls: PropTypes.string,
2019-01-12 03:33:27 +00:00
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
};
2018-12-10 03:34:51 +00:00
export const SkeletonTitleProps = PropTypes.shape(skeletonTitleProps).loose;
2018-12-10 03:34:51 +00:00
2020-10-18 14:03:57 +00:00
export type ISkeletonTitleProps = Partial<ExtractPropTypes<typeof skeletonTitleProps>>;
const Title = defineComponent({
2019-03-18 12:35:24 +00:00
props: skeletonTitleProps,
2019-01-12 03:33:27 +00:00
render() {
const { prefixCls, width } = this.$props;
const zWidth = typeof width === 'number' ? `${width}px` : width;
return <h3 class={prefixCls} style={{ width: zWidth }} />;
2018-12-10 03:34:51 +00:00
},
2020-10-18 14:03:57 +00:00
});
2018-12-10 03:34:51 +00:00
2019-01-12 03:33:27 +00:00
export default Title;