Skip to content

Instantly share code, notes, and snippets.

@bmfteixeira
Last active November 6, 2017 11:09
Show Gist options
  • Save bmfteixeira/4f75c34e881230fb369091a05ff3cb01 to your computer and use it in GitHub Desktop.
Save bmfteixeira/4f75c34e881230fb369091a05ff3cb01 to your computer and use it in GitHub Desktop.
<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