Currently, I am working with vue-cli 3 and trying to create background-image paths. To achieve this, I am utilizing the style data bind within a v-for-loop.
Below is the component structure:
<template>
<ul>
<li v-for="(tool, index) in tools" :key="index">
<a href="#" :style="{ backgroundImage: 'url(@/assets/icons/' + tool + '.svg)' }"></a>
</li>
</ul>
</template>
<script>
export default {
props: {
tools: Array,
}
}
</script>
The images can be found in the following directory: src/assets/icons/xxx.svg
Despite my efforts, the generated image path seems to be incorrect. I have reviewed the code but am unable to identify the mistake.