图片预览
<amber-button type="primary" @click="imageIndex = 0, display = true">预览图片</amber-button> <amber-button type="primary" @click="() => { imageIndex = 1, display = true }">预览第2张图片</amber-button> <amber-picture-preview :show="display" @close="handlePictureClick" :image-index="imageIndex" :picture-list="list" /> <script> export default { data() { return { display: false, imageIndex: 0, list: [{ url: '/amber-ui/1.png', name: '1.png' },{ url: '/amber-ui/2.png', name: '2.png' },{ url: '/amber-ui/3.png', name: '3.png' },{ url: '/amber-ui/4.png', name: '4.png' }] } }, methods: { handlePictureClick() { this.display = !this.display; } } }; </script>
← Rate 评分 Rotation 图片无限滚动 →