Skip to content

Custom input not working #243

Closed Answered by newcat
klavsbuss asked this question in Q&A
Jan 8, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

For Vue 3, adding the emits property is necessary. Also, you can remove the general listener stuff, since it is your custom component and you can add listeners if needed. This makes it more readable.

<template>
  <div>
    <textarea :value="value" @input="$emit('input', $event.target.value)" />
  </div>
</template>

<script>
export default {
  components: {},
  props: ["value", "name", "option", "node"],
  emits: ["input"],
};
</script>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@klavsbuss
Comment options

Answer selected by klavsbuss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants