1995
No
random 임의 증가값
<img class="card-img-top" src="https://picsum.photos/600/400?random=${Math.floor(Math.random() * 1000) + 1}" onerror="this.src='https://via.placeholder.com/300x200'" />
export const generateDummyPost = (number) => Array(10).fill().map(() => ({ id: shortid.generate(), User: { id: shortid.generate(), nickname: faker.internet.userName() }, content: faker.lorem.paragraph(), Images: [{ id: shortid.generate(), src: 'https://picsum.photos/600/400?random=' + Math.floor(Math.random() * 1000) + 1, onerror: "https://via.placeholder.com/600x400" }], Comments: [{ id: shortid.generate(), User: { nickname: faker.internet.userName() }, content: faker.lorem.paragraph() }] }));
댓글 ( 4)
댓글 남기기