virtual-image-layout 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/js/index.js +3 -1
  2. package/package.json +7 -2
package/js/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  class VirtualImageLayout {
2
2
  constructor(containerId, options = {}) {
3
- this.container = document.getElementById(containerId);
3
+ this.container = typeof containerId === 'string'
4
+ ? document.getElementById(containerId)
5
+ : containerId; // 支持直接传入 DOM 元素(Vue ref / React ref)
4
6
  this.rowGap = options.rowGap || 16;
5
7
  this.titleGap = options.titleGap; // 标题高度,如果设置了就显示标题
6
8
  this.containerWidth = this.container.offsetWidth;
package/package.json CHANGED
@@ -1,11 +1,16 @@
1
1
  {
2
2
  "name": "virtual-image-layout",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "A virtual scrolling justified image gallery layout library, framework-agnostic",
5
5
  "main": "js/index.js",
6
6
  "module": "js/index.js",
7
7
  "author": "lukuihao <351973031@qq.com>",
8
- "keywords": ["virtual-scroll", "image-layout", "justified-gallery", "waterfall"],
8
+ "keywords": [
9
+ "virtual-scroll",
10
+ "image-layout",
11
+ "justified-gallery",
12
+ "waterfall"
13
+ ],
9
14
  "license": "MIT",
10
15
  "files": [
11
16
  "js/index.js",