S
S
squadbrodyaga2021-04-16 11:00:55
Vue.js
squadbrodyaga, 2021-04-16 11:00:55

How to make attributes work on the app-input component?

(Using Vue 3)

Hello, I have an app-input component, it looks like this:

<template>
  <div class="input">
    <input type="text">
  </div>
</template>

<script>
...
</script>

Well, it is used like this: Well, the bottom line is that if this component is given some attribute, such as placeholder or value, then it will not work, now I solved this problem using props, but maybe there is some more convenient way, to have the attributes automatically applied to the input tag inside the component?
<app-input/>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2021-04-16
@squadbrodyaga

https://ru.vuejs.org/v2/api/#inheritAttrs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question