Created
August 30, 2020 08:29
-
-
Save bachhm-dev/f4983b53c92c510cb0f854d953f75962 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
| <form> | |
| <div> | |
| <label for="name">Name</label> | |
| <input type="text" :value="name" @input="updateName($event.target.value)" /> | |
| </div> | |
| <div> | |
| <label for="email">Email</label> | |
| <input type="email" :value="email" @input="updateEmail($event.target.value)" /> | |
| </div> | |
| </form> | |
| </template> | |
| <script> | |
| export default { | |
| props: { | |
| name: String, | |
| email: String, | |
| }, | |
| setup(props, { emit }) { | |
| const updateName = (value) => { | |
| emit("update:name", value); | |
| }; | |
| const updateEmail = (value) => { | |
| emit("update:email", value); | |
| }; | |
| return { updateName, updateEmail }; | |
| }, | |
| }; | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment