我无法在v-for loop |中绑定图像源 vue.js,node.js
我尝试在v-for循环中绑定图像源。 我的数组是由函数填充,而不是静态的。
我的代码看起来像:
<section class="section"> <div class="container"> <div v-for="match in matches" class="card"> <img :src="match.avatar" alt=""> </div> </div> </section>
和
created() { ipcRenderer.send('get:all:champions') ipcRenderer.send('summoner:recent:matches:request') ipcRenderer.on('summoner:recent:matches:response', (event, matches) => { matches.splice(-15, 15) // -15, 15 this.matches = matches for (let match in matches) { ipcRenderer.send('matches:champion:avatar:request', { element: match, championId: matches[match].champion }) } ipcRenderer.on('matches:champion:avatar:response', (event, data) => { this.matches[data.element].avatar = data.avatar }) }) }
我在控制台中得到错误,任何图片不显示。 错误:
(node:9696) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 42): Error: Request failed with status code 429
我希望你能帮助我=)