Using a vue.js app, I have the ability to choose locations using either a map or an input field. However, for mobile users, I want to exclude the map and only serve the search engine.
The issue is that it's not very user-friendly on mobile devices because even though I have prevented the map from displaying with a media query, I am still unable to prevent the downloading of a large geojson file and other related data files.
The imports are structured like this:
//modules for leaflet
import Vue2Leaflet from '../../node_modules/vue2-leaflet/dist/vue2-leaflet.js';
import { InfoControl, ReferenceChart, ChoroplethLayer } from 'vue-choropleth'
//geojson and data files
import { geojsonA } from '../../data/mygeojson.min.geojson'
import { specificData } from '../../data/mydata.js'
and in the styles:
@media (min-width: 640px) {
.mobile {
display: none;
}
//other styles
}
Is there a way to selectively block import based on media queries or any other method for specific displays?