V
V
Vladimir Golub2020-09-18 17:56:16
Vue.js
Vladimir Golub, 2020-09-18 17:56:16

How not to load image via require in mobile version?

The template has an image that is loaded via require, but if you put display: none on the element in the mobile version, it still loads. How not to load an element in the mobile version. v-if tried does not help.

<img
          alt="laptop"
          v-for="item in 52"
          v-show="item === imgNumber"
          :src="require(`@/assets/images/main/laptop/${ item }.jpg`)"
        />

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2020-09-18
@Aetae

v-if tried does not help

And should.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question