Vuesax: Avatar component does not find relative src image

Created on 6 Oct 2018  路  3Comments  路  Source: lusaxweb/vuesax

  • Mac OSX Mojave
  • Node 10.10.0
  • Vuesax 3.4.16
  • Safari 12.0
  • npm used to install

<vs-avatar> tag, src attribute does not pull from relative paths. When given a full URL image, it works fine, but when trying to use a local asset from the src/assets directory, the image is never found.
<vs-avatar alt="Avatar" size="120px" src="../assets/image-to-load.png"/>

All 3 comments

I was able to resolve the issue by adding this to my vue.config.js file

// vue.config.js
module.exports = {
    chainWebpack: config => {
        config.module
          .rule('vue')
          .use('vue-loader')
            .loader('vue-loader')
            .tap(options => {
              options.transformAssetUrls = {
                'vs-avatar': 'src'       
              }
              return options
            })
    }
}

I do believe however that there should be a more elegant solution to this problem. If this type of options can be done directly when importing the Vuesax library, it would be very helpful.

It's is only in your webpack config, sorry but, its no is a valid issue with a vuesax repo.
Great for you can find a correction and explain for all.

@luisDanielRoviraContreras i sure to you can close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jupox picture jupox  路  3Comments

hahuy95 picture hahuy95  路  3Comments

webafra picture webafra  路  3Comments

andresilva-cc picture andresilva-cc  路  3Comments

mjmnagy picture mjmnagy  路  3Comments