-
-
Save brunokunace/576ce532f4c4a5454736d8f7ba2ab954 to your computer and use it in GitHub Desktop.
Computed props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
computed: { | |
strokeDashoffset() { | |
return 339.292 * (1 - (this.computedPercentage / 100)) | |
}, | |
xAxis() { | |
if (this.computedPercentage >= 100) { return 36 } | |
if (this.computedPercentage >=0 && this.computedPercentage <=9) { return 47 } | |
return 42 | |
}, | |
computedDirection() { | |
if (this.direction !== 'mid' && this.direction !== 'right' && this.direction !== 'left') { return 'mid' } | |
return this.direction | |
}, | |
computedPercentage() { | |
if (this.percentage > 100) { return 100 } | |
if (this.percentage < 0) { return 0 } | |
return this.percentage | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment