Update README.md

Update README.md
This commit is contained in:
Horcrux
2016-01-27 11:35:24 +08:00
parent e181a1a546
commit 9cb827e332
7 changed files with 114 additions and 7 deletions

View File

@@ -3,8 +3,12 @@ import rgba from './rgba';
let separator = /\s*,\s*/;
export default function (props) {
let strokeDasharray = props.strokeDash || props.strokeDasharray;
let strokeDashoffset = +props.strokeDashoffset;
if (typeof strokeDasharray === 'string') {
// TODO: support Percentage for strokeDashoffset
if (!isNaN(strokeDashoffset)) {
strokeDasharray = [+props.strokeDashoffset];
} else if (typeof strokeDasharray === 'string') {
strokeDasharray = strokeDasharray.split(separator).map(dash => +dash);
}