reference assets with generated style data bind
问题 I'm using the vue-cli 3 and want to generate background-image paths. Therefore I'm using the style data bind within an v-for-loop. the component: <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 are in this folder: src/assets/icons/xxx.svg The problem is, that the generated image path seems to be