- English | 简体中文
valaxy-addon-lightgallery provides a gallery preview effect based on lightgallery.
npm i valaxy-addon-lightgallery
// valaxy.config.ts
import { defineValaxyConfig } from 'valaxy'
import { addonLightGallery } from 'valaxy-addon-lightgallery'
export default defineValaxyConfig({
addons: [
addonLightGallery(),
],
})
Insert the component directly in Markdown.
---
photos:
- caption: Me
src: https://cdn.jsdelivr.net/gh/YunYouJun/yun/images/meme/yun-good-alpha-compressed.png
desc: 'I remember the run under the sunset that day.'
---
<!-- The style of gallery -->
<VAGallery :photos="frontmatter.photos" />
<!-- You can also use the style of the photo separately -->
<VAPhoto :photo="frontmatter.photos[0]" />
Lock packages.json dependencies version to "lightgallery": "2.7.2"
.