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

View File

@@ -1,4 +1,4 @@
import { createNamespace, isDef, addUnit } from '../utils';
import { createNamespace, isDef, addUnit, getSizeStyle } from '../utils';
import { resetScroll } from '../utils/dom/reset-scroll';
import { preventDefault } from '../utils/dom/event';
import { formatNumber } from '../utils/format/number';
@@ -124,14 +124,7 @@ export default createComponent({
},
buttonStyle() {
if (this.buttonSize) {
const size = addUnit(this.buttonSize);
return {
width: size,
height: size,
};
}
return getSizeStyle(this.buttonSize);
},
},