[Vuejs]-How to build Vue dynamic assets (image) path?

1👍

As you have correctly pointed out, vue does not interpret @/asstes. @ also only stands for src/. For this reason, you can replace the @ with src, then it should work.

    makeImgPath(imgName = 'defaultImageName') { // suggestion
        return "src/assets/svgs/" + imgName + "svg";
    }

Leave a comment