Answer the question
In order to leave comments, you need to log in
Why is there a problem with ref when importing into components?
I import the component:
...
components: {
MainSection: () => import('@/components/pages/sections/MainSection'),
...
setTimeout(() => {
console.log(this.$refs.screenImg);
}, 0);
Answer the question
In order to leave comments, you need to log in
https://ru.vuejs.org/v2/api/#ref
An important note about link registration time: since links are created by the render function, you won't be able to use them on initial render - they don't exist yet! Also, the $refs object is not reactive, so don't try to use it in data binding templates.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question