Different mobile and desktop layout with vuejs

11,660

If you have 2 different vue files, one for mobile and the other for desktop you can do like explained at this answer:

https://stackoverflow.com/a/51053611/1178478

Share:
11,660
PamanBeruang
Author by

PamanBeruang

🤔 INTJ-T | 🌎 Web Developer | 📱 Mobile Developer | 🎨 Graphic Designer | 💰 Investor & Trader | ✍️ Creator @beruanginvestasi

Updated on June 15, 2022

Comments

  • PamanBeruang
    PamanBeruang almost 2 years

    I'm looking a lightweight and smart way to provide user with different layout or component for mobile and desktop view using vue.

    My web application consist of a lot of table and as you all know table is not a best experience when use in mobile device (even thought there is a lot of method to make table useable but not enjoyable)

    So i thinking to make vue js to detect whether user access web apps from desktop or mobile device. when user open in desktop it will showing a good old table because of screen real estate desktop user have. But when user open in mobile device it will show card or panel like view that more suitable for mobile device (portrait orientation in general)

    I know there is a solution with great bootstrap frameworks that can do that, but it is not swapping but instead render all part (html for most part) and just hide each part according to the screen size.

    But maybe there is a much more efficient and smart way to implement these features in vue js?