Created
August 2, 2019 09:30
-
-
Save taewo/006a7e2909eff54c87aa5355720a0106 to your computer and use it in GitHub Desktop.
Vue Getter, Setter 예시
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="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