I wonder how conditionally rendering NuxtJs components based on viewport width.
so;
in traditional css way we can make it like that:
<div class="isMobile">
<!-- mobile content -->
</div>
<div class="isDesktop">
<!-- desktop content -->
</div>
in this case this solution working.
@media only screen and (max-width: 768px) {
.isDesktop {display:none;}
.isMobile {display:block}
}
But with this solution isDesktop and isMobile divs rendered in dom anyway.
I wan't to do that:
<div v-if="isMobile"></div>
<div v-if="isDesktop"></div>
and control this in beforeMount component, or if user will resize window.
I see some plugin like [https://github.com/dotneet/nuxt-device-detect][1] but there is not understandable readme for me.
anybody have some suggestions?