Last active
November 6, 2017 11:09
-
-
Save bmfteixeira/4f75c34e881230fb369091a05ff3cb01 to your computer and use it in GitHub Desktop.
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
<template> | |
<div :class="getClasses"> | |
Another component, another test, random probability | |
</div> | |
</template> | |
<script> | |
export default { | |
props: { | |
classModifiers: { | |
type: Array, | |
default: () => ['large'] | |
} | |
}, | |
computed: { | |
baseProbability () { | |
if (this.classModifiers.includes('large')) { | |
return .8 | |
} | |
return .5 | |
}, | |
getClasses () { | |
return this.classModifiers.map(function (class) { | |
return `probability--${modifier}` | |
}) | |
} | |
}, | |
methods: { | |
calcProbability (probMultiplier) { | |
return this.baseProbability * probMultiplier | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment