[Vuejs]-NuxtJs accessing local images in assets folder

2👍

For somebody else who might have the same issue, this is how I solved it (with inspiration of kissus answer below:

data() {
    return {
      defaultCoverImage: require('~/assets/images/covers/default-cover.jpeg'),
    }
  }
👤simon

1👍

This answer may help: https://stackoverflow.com/a/68095775/8816585

Also, this should be enough

<div :style="{ backgroundImage: `url(${require('~/assets/images/covers/default-cover.jpeg')})`}">
</div>
👤kissu

Leave a comment