In Vue: src can't find resources?

.vue

<ul>
    <li v-for="brand in brands">
        <img :src="brand.img_url" alt="">
        <span>{{brand.text}}</span>
    </li>
</ul>



brands: [
    {
        img_url: "./images/icon-aodi.png",
        text: ""
    }
]

directory structure



but directly src= ". / images/icon-aodi.png" can be displayed normally

Mar.01,2021

this route is based on the path of the html file where the code ends up, not on the .vue file


there are two ways:
1, storing resources under / static/, referencing
2, and passing in image coding through require (path)

.

reference: https://m.jb51.net/article/11.

alas, you should do it yourself and have plenty of food and clothing.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e3cc10-58c62.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e3cc10-58c62.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?