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
|
|
|
|
2021-05-28 05:16:59 +00:00
|
|
|
export const skeletonTitleProps = {
|
2018-12-10 03:34:51 +00:00
|
|
|
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
|
|
|
|
2021-05-28 05:16:59 +00:00
|
|
|
export type SkeletonTitleProps = Partial<ExtractPropTypes<typeof skeletonTitleProps>>;
|
2018-12-10 03:34:51 +00:00
|
|
|
|
2021-05-28 05:16:59 +00:00
|
|
|
const SkeletonTitle = defineComponent({
|
|
|
|
name: 'SkeletonTitle',
|
2021-05-30 13:39:25 +00:00
|
|
|
props: skeletonTitleProps,
|
2021-05-28 05:16:59 +00:00
|
|
|
setup(props) {
|
|
|
|
return () => {
|
|
|
|
const { prefixCls, width } = 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
|
|
|
|
2021-05-28 05:16:59 +00:00
|
|
|
export default SkeletonTitle;
|