Recently, I encountered an issue while using Vue.js to dynamically create a source attribute using an object's properties. Here is the code snippet where I faced the problem:
<img :src='"../assets/" + project.image.name + "." + project.image.extension'>
Strangely enough, this code did not work and no errors were logged in the console. However, when I made a slight modification like so:
<img :src='"../assets/" + project.image.name + "." + project.image.extension + ""'>
Surprisingly, it worked perfectly fine. Although the workaround resolved the issue, it still bothers me that I don't fully comprehend why the initial implementation didn't work as expected.