Dynamic image error (v-for list)



  • hi, i have problem.

    working:

    data () {
      return {
        aImg: 'statics/images/aimg.svg'
      }
    }
    <div>
          <img :src="aImg" />
    </div>
    

    does not work:

    data () {
      return {
        aImg: 'statics/images/aimg.svg'
      }
    }
    <div>
        <div
          v-for="aa in aas"
          :key="aa.id"
        >
          <img :src="aa.image" /> // Not this
          <img :src="aImg" /> // Not this
          <span>{{ aa.name }}</span>
        </div>
    </div>
    

    everything works on dev, but on build no
    what am I doing wrong?

    Build mode… cordova
    Quasar theme… mat
    Quasar CLI… v0.17.13
    Quasar Framework… v0.17.10



  • tried to change path, do not help any: assets whith ~,@,/,./ or statics with ~,@,/,./ or required(path)

    😞



  • found a solution

    required('src/statics/images/aimg.svg')