A
A
Andrey Aleksandrovich2017-10-23 10:15:04
WooCommerce
Andrey Aleksandrovich, 2017-10-23 10:15:04

How to influence the props of a child component from a parent?

Hello.
I have two components declared globally:
First: country selection

<f-select
        :options="countries"
        name="country"
        placeholder="Выберите страну"
        @change-option="getOption"
/>

Second: choice of city
<f-select
        disabled
        :options="cities"
        name="city"
        placeholder="Выберите город"
        @change-option="getOption"
        @status="compStatus"
/>

The second one has props "disabled".
How to manipulate the second component depending on the selected value in the first one?
How to do, for example, if in the first component I select some country, and in the second component props disabled becomes false ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mShpakov, 2017-10-23
@KaSeo

Through $emit, throw some value from the first select and pass it to the second. The method of transmission and what to transmit is up to you. In fact, the only way to pass a value "up" is $emit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question