sy / photoswipe
Photoswipe 网页组件
1.1.0
2022-11-02 17:47 UTC
Requires
- php: >=5.6.0
- sy/webcomponent: ^2
This package is auto-updated.
Last update: 2024-08-30 01:20:30 UTC
README
使用 PhotoSwipe v4 的 Photoswipe 相册网页组件 PhotoSwipe v4
安装
$ composer require sy/photoswipe
基本用法
在 PHP 侧,添加组件
$this->setComponent('PHOTOSWIPE', new \Sy\Component\Web\PhotoSwipe());
在模板文件中,别忘了添加一个槽 {PHOTOSWIPE}
在 HTML 侧,将图像放在具有 "photoswipe-gallery" 类的容器中
<div class="photoswipe-gallery"> <img src="https://picsum.photos/id/1/400/300" alt="Image 1" /> <img src="https://picsum.photos/id/2/400/300" alt="Image 2" /> <img src="https://picsum.photos/id/3/400/300" alt="Image 3" /> <img src="https://picsum.photos/id/4/400/300" alt="Image 4"/> <img src="https://picsum.photos/id/5/400/300" alt="Image 5" /> </div>
您可以尝试 运行一个示例 来了解如何使用此组件。