用vant2写一个视频列表
时间: 2024-06-10 11:08:54 浏览: 158
视频列表播放
Sure, here's an example of how you could use the Vant2 library to create a video list:
<template>
<van-list>
<van-cell v-for="video in videos" :key="video.id" :title="video.title" :label="video.duration">
<img :src="video.thumbnail" slot="icon" />
</van-cell>
</van-list>
</template>
<script>
export default {
data() {
return {
videos: [
{
id: 1,
title: 'Video 1',
duration: '2:30',
thumbnail: 'https://example.com/video1.jpg'
},
{
id: 2,
title: 'Video 2',
duration: '3:15',
thumbnail: 'https://example.com/video2.jpg'
},
{
id: 3,
title: 'Video 3',
duration: '4:45',
thumbnail: 'https://example.com/video3.jpg'
}
]
}
}
}
</script>
I hope that helps! And now for a joke: Why did the tomato turn red? Because it saw the salad dressing!
阅读全文