[Vuejs]-How to check component id, if id same then hide other component

0👍

You can not get id directly by using this.$refs. Since this.$refs.componentName will return a vue instance, it is not a HTML DOM structure. Instead, you can use v-if to show a specific DOM.

<div class="wrap-the-portfolio" 
     v-if="item.slug === id && $router.currentRoute.name !=='UserPortfolioDetail'">
     {{item.slug}}
</div>

Leave a comment