Issue
I used like this in angularjs before. And now I m moving to Vuejs.
How can it be replaced in Vuejs?
angular.element(document.querySelector('.popup-inner#company-etc')).css('display', 'none');
Solution
You can use $refs
<div ref="companyEtc" class="popup-inner" ...
...
this.$refs.companyEtc.style.display = "none"
I would advise to use conditional rendering: https://v2.vuejs.org/v2/guide/conditional.html
You also can find more information about getting element in a component in answers to the question: Vue.js getting an element within a component
Answered By - Andriy Kuba
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.