[improvement] Circle: support number type of size prop (#4160)

This commit is contained in:
neverland
2019-08-20 12:57:58 +08:00
committed by GitHub
parent b7244f8fa9
commit 112839984d
5 changed files with 25 additions and 7 deletions
+6 -5
View File
@@ -1,4 +1,4 @@
import { createNamespace, isObj } from '../utils';
import { createNamespace, isObj, addUnit } from '../utils';
import { raf, cancelRaf } from '../utils/dom/raf';
import { BLUE, WHITE } from '../utils/constant';
@@ -29,8 +29,8 @@ export default createComponent({
default: 0
},
size: {
type: String,
default: '100px'
type: [String, Number],
default: 100
},
fill: {
type: String,
@@ -64,9 +64,10 @@ export default createComponent({
computed: {
style() {
const size = addUnit(this.size);
return {
width: this.size,
height: this.size
width: size,
height: size
};
},