reinerBa / Vue-Responsive

A plugin for responsive handling with vue.js
https://reinerba.github.io/Vue-Responsive/dist/
MIT License
99 stars 6 forks source link

Remove DOM element instead of hiding it #13

Closed roszpun closed 2 years ago

roszpun commented 4 years ago

Hello, I'm developing an app, which has mobile and desktop views. Ideally, I would like to display some components conditionally depending on the breakpoints. Currently directive only applies display: none;. Is it possible to remove the DOM element instead?

reinerBa commented 4 years ago

Hello, removing is in vue a different thing than hiding. You can hide with "v-show" and remove with "v-if", with this directive the last is not possible. Because it works in the DOM elements itself. Other Plugins exists with give you a property that indicates the current display size, you can use this to do something like v-if="big" or v-if="!big".