chore: extract getSizeStyle

This commit is contained in:
chenjiahan
2020-08-26 18:09:32 +08:00
parent 47a7ccef85
commit 216417eae6
7 changed files with 29 additions and 53 deletions
+2 -3
View File
@@ -1,4 +1,4 @@
import { createNamespace, addUnit } from '../utils';
import { createNamespace, addUnit, getSizeStyle } from '../utils';
const [createComponent, bem] = createNamespace('skeleton');
const DEFAULT_ROW_WIDTH = '100%';
@@ -42,11 +42,10 @@ export default createComponent({
setup(props, { slots }) {
const renderAvatar = () => {
if (props.avatar) {
const size = addUnit(props.avatarSize);
return (
<div
class={bem('avatar', props.avatarShape)}
style={{ width: size, height: size }}
style={getSizeStyle(props.avatarSize)}
/>
);
}