Skip to content

Instantly share code, notes, and snippets.

@taewo
Created August 2, 2019 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taewo/006a7e2909eff54c87aa5355720a0106 to your computer and use it in GitHub Desktop.
Save taewo/006a7e2909eff54c87aa5355720a0106 to your computer and use it in GitHub Desktop.
Vue Getter, Setter 예시
<template>
<div class="input-wrapper">
<h1>input3</h1>
<input v-model="resultOutputValue" :type="type">
</div>
</template>
<script>
export default {
name: 'Input3',
props: {
resultOutput: {
type: String,
required: true
},
type: {
type: String,
required: true
}
},
computed: {
resultOutputValue: {
get() { return this.resultOutput },
set(resultOutput) {
this.$emit('resultOutput', resultOutput)
}
}
}
}
</script>
<style>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment