F
F
Fyodor Buzinov2018-05-16 18:17:34
Vue.js
Fyodor Buzinov, 2018-05-16 18:17:34

Vue - how to properly organize the structure of components?

Good afternoon!
There is a page with a form:

<custom-form>
  <section title="Contacts">
    <custom-input :type="text" />
    <custom-input :type="text" />
    <custom-input type="select" />
  </section>
  <section title="Info">
    <custom-input type="select" />
  </section>
</custom-form>

Each element will have a "Configure" button, by pressing it you need to show a modal window with settings for a particular element (Change label, name, etc.)
Tell me where is it correct in the structure above to place the component?
Would it be correct to screw inside each component like a child?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orfen, 2018-05-16
@Orfen

Use slot, slot-scope write components that do not depend on each other (modal window)
https://ru.vuejs.org/v2/guide/components-slots.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question