S
S
Sergey Khlopov2019-08-23 10:37:09
Vue.js
Sergey Khlopov, 2019-08-23 10:37:09

$refs chain, is that correct?

Hello, please tell me if I get such a call in the component:

this.$refs.formCategory.$refs.dropzoneInput.removeAll(); //Очищаем dropzone при закрытии модального окна

Is it normal that I have a chain of refs ? , to simplify understanding, I will write:
The current component has a component
<form-category ref="formCategory" active="/categories_update"></form-category>

And inside <form-category>there is such a challenge
<dropzone-input v-model="category.image" title="Загрузить картинку" class="form__dropzone dropzone-elem" ref="dropzoneInput"></dropzone-input>

Thank you in advance for your response

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2019-08-23
@Shlop

No. Use vuex or event bus.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question