Skip to content

Instantly share code, notes, and snippets.

@brunokunace
Forked from WandersonAlves/algo.js
Last active September 15, 2017 19:26
Show Gist options
  • Save brunokunace/576ce532f4c4a5454736d8f7ba2ab954 to your computer and use it in GitHub Desktop.
Save brunokunace/576ce532f4c4a5454736d8f7ba2ab954 to your computer and use it in GitHub Desktop.
Computed props
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