Skip to content

Instantly share code, notes, and snippets.

@cristoferdomingues
Created September 13, 2018 20:49
Show Gist options
  • Save cristoferdomingues/f4dee7ec53560f9bddaecae5d1894d20 to your computer and use it in GitHub Desktop.
Save cristoferdomingues/f4dee7ec53560f9bddaecae5d1894d20 to your computer and use it in GitHub Desktop.
vue computed setter e getter
<template>
<v-date-picker v-model="formattedDate">
</template>
<script>
export default {
data: function () {
return { date: '2018-MAY-09T12:00:00' }
},
computed: {
formattedDate: {
get() { return /* transfor this.date here */ },
set(valueFromPicker) { this.date = /* transform back here */ }
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment