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>
Source:stackexchange.com