I
I
Ivanko2018-07-02 21:25:23
Vue.js
Ivanko, 2018-07-02 21:25:23

VueJs - how to make dependent form elements?

Good!
VueJs - how to make dependent form elements?
For example, depending on the selected select item, certain additional options appear. fields whose parameters are obtained via Ajax (field type, its name, required or not, etc.). Ie I select the item "articles" in the diva, the inputs "title" and "release date" appear, and if you select "books" - "title" and "author".
With jQuery, this was relatively easy.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aleksandr, 2018-07-03
@Qvazi

Read:
Component Basics
Dynamic & Asynchronous Components
Mixins
Create "articles" and "books" components. In the select list of the attribute, add the name of the components. Depending on the selected "select" item, you render the desired component.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question