Es6 can't find local resources in vue-cli?

I used a vue carousel plug-in vue-concise-slider, in the project, but I couldn"t find the picture during initialization

directory structure

.vue



Feb.28,2021

use require to reference a picture, something like this:

  computed: {
    styleObj () {
      return {
        'background': `url(${require(`../assets/${this.type}.png`)}) center center / 70% 70% no-repeat`
      }
    }
  }

your picture resources cannot be parsed. Put the style in a separate style tag


introduce the picture before creating a vue instance, and then use it in data.


there is also a way to throw static (the new version is public), and then the absolute path to lead. All the resources in the logic that the browser has just started to run are quoted in this way.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb456a-5d2e5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb456a-5d2e5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?