Skip to content

Commit

Permalink
release(image-list): v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
surunzi committed Sep 7, 2024
1 parent efa2fae commit 9053d3d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
},
"image-list": {
"dependencies": ["gallery"],
"version": "0.1.0",
"version": "0.2.0",
"style": true,
"icon": false,
"test": true,
Expand Down
6 changes: 6 additions & 0 deletions src/image-list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ export default class ImageList extends Component<IOptions> {
document.body.removeChild(this.galleryContainer)
super.destroy()
}
/** Clear all images. */
clear() {
this.images = []
this.$container.html('')
this.gallery.clear()
}
/** Append image. */
append(src: string, title?: string) {
const { verticalMargin, horizontalMargin, rowHeight } = this.options
Expand Down
2 changes: 1 addition & 1 deletion src/image-list/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "image-list",
"version": "0.1.0",
"version": "0.2.0",
"description": "Show list of images",
"luna": {
"dependencies": [
Expand Down
7 changes: 6 additions & 1 deletion src/image-list/story.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'luna-image-list.css'
import ImageList from 'luna-image-list.js'
import { number, boolean } from '@storybook/addon-knobs'
import { number, boolean, button } from '@storybook/addon-knobs'
import story from '../share/story'
import readme from './README.md'

Expand Down Expand Up @@ -40,6 +40,11 @@ const def = story(
imageList.append('/pic4.png', 'pic4.png')
imageList.append('/icon.png', 'icon.png')

button('Clear', () => {
imageList.clear()
return false
})

return imageList
},
{
Expand Down

0 comments on commit 9053d3d

Please sign in to comment.