0👍
In your template, change:
<img :src="getImgUrl(project.p_img_path)" alt="project cover image">
To:
<img :src="require(`../assets/${project.p_img_path}`)" alt="project cover image">
You shouldn’t need a method to return the path as a string, just use a template literal as above.
Ps. This assumes project.p_img_path
= img/project_img/filename.jpg
, so adjust as necessary.
0👍
The solution is that I had to put all the images inside the assets folder directly. Thank you all for your time.
- [Vuejs]-TypeError: this.$cookies is undefined using vue-cookie
- [Vuejs]-Why does my Vue transition have no effect?
Source:stackexchange.com