O
O
Ohurmevshiy2020-11-21 13:09:40
Vue.js
Ohurmevshiy, 2020-11-21 13:09:40

Dynamic attribute :src - the image does not appear. What's wrong?

Could this Vue CLI work? For if I directly set the path, then it has additional numbers in the name in devtools: /img/model_1.c5430f1b.jpgthe image appears. But the image is not dynamically displayed, although the path is written.

Does not work:

<img v-if="currentModel" :src= "img_path" max-width="300"/>  
 data: () => ({
    img_path: '@/assets/img/model_1/img.jpg'
})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2020-11-21
@Ohurmevshiy

Did you want runtime aliases to work?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question