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

20 lines
516 B
Vue
Raw Normal View History

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
2019-01-12 03:33:27 +00:00
export const SkeletonTitleProps = PropTypes.shape(skeletonTitleProps);
2018-12-10 03:34:51 +00:00
const Title = {
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
},
2019-01-12 03:33:27 +00:00
};
2018-12-10 03:34:51 +00:00
2019-01-12 03:33:27 +00:00
export default Title;