<template>
<div ref="result">
{{ result }}
</div>
</template>
<script>
export default {
props: ['foo'],
data: function () {
return {
factor: 2
}
},
computed: {
result: function () {
return calculateValue()
}
},
methods: {
calculateValue () {
const { foo, factor } = this
return foo * factor
}
},
mounted () {
this.$refs.result.style.color = 'blue'
}
}
</script>
<style lang="scss" scoped>
</style>
Created
April 5, 2018 09:10
-
-
Save jnsprnw/766038efd9b5ae4232ea80082ef9f119 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment