Pavan Kumar
Pavan Kumar

Reputation: 39

Vue JS - Adding dynamic number to images (in between image name and image format)

I have bind image with the image tag like this

<img  title="head" :src="availableParts.heads[selectNextHeadIndex].src"/>

added called this from json

 {
      id: 1,
      description:
        'A robot head with an unusually large eye and teloscpic neck -- excellent for exploring high spaces.',
      title: 'Large Cyclops',
      src: images('./head-big-eye.png'),
      type: 'heads',
      cost: 1225.5,
    },

but image is displaying as shown in screenshot. but it automatically adds some number to image name and image format. How I can remove the numbers?and make it simple like this head-big-eye.png

enter image description here

Upvotes: 0

Views: 181

Answers (1)

Patryk Laszuk
Patryk Laszuk

Reputation: 1440

You can disable hashing in vue.config.js

module.exports = {
  ...
  filenameHashing: false,
}

https://cli.vuejs.org/config/#filenamehashing

Upvotes: 1

Related Questions