In this article, we’ll look at how to set static image src in Vue.js template with JavaScript.
To set static image src in Vue.js template with JavaScript, we set the path relative to the src folder.
For instance, we write
<template>
<img src="/static/img/clear.gif" />
</template>
To add an img element with src set to a path relative to the src folder to load the image.
To set static image src in Vue.js template with JavaScript, we set the path relative to the src folder.
Total Views: 1,141