vue3-waterfall-next 1.1.0

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.
package/README.md ADDED
@@ -0,0 +1,206 @@
1
+ # vue3-waterfall-next
2
+
3
+ 安装:
4
+
5
+ ```bash
6
+ npm install vue3-waterfall-next
7
+ ```
8
+
9
+ 无图片 - demo:
10
+
11
+ ```Vue
12
+ <template>
13
+ <div>
14
+ <vue3-Waterfall ref="waterfallRow" :list="list" :columns="3" :columnGap="10" :rowGap="10">
15
+ <template #default="{ item }">
16
+ <div class="test-waterfall" :style="{ height: item.height + 'px' }">{{ item.name }}</div>
17
+ </template>
18
+ </vue3-Waterfall>
19
+ </div>
20
+ </template>
21
+ <script lang="ts" setup>
22
+ import { ref } from 'vue'
23
+ const list = ref([
24
+ {
25
+ id: 1,
26
+ name: '张三',
27
+ age: 18,
28
+ height: 100,
29
+ },
30
+ {
31
+ id: 2,
32
+ name: '李四',
33
+ age: 19,
34
+ height: 110,
35
+ },
36
+ {
37
+ id: 3,
38
+ name: '王五',
39
+ age: 20,
40
+ height: 120,
41
+ },
42
+ {
43
+ id: 4,
44
+ name: '赵六',
45
+ age: 21,
46
+ height: 90,
47
+ },
48
+ {
49
+ id: 5,
50
+ name: '钱七',
51
+ age: 22,
52
+ height: 130,
53
+ },
54
+ {
55
+ id: 6,
56
+ name: '孙八',
57
+ age: 23,
58
+ height: 80,
59
+ },
60
+ {
61
+ id: 7,
62
+ name: '周九',
63
+ age: 24,
64
+ height: 60,
65
+ },
66
+ {
67
+ id: 8,
68
+ name: '郑十',
69
+ age: 25,
70
+ height: 100,
71
+ },
72
+ ])
73
+ </script>
74
+ <style lang="scss" scoped>
75
+ .test-waterfall {
76
+ width: 100%;
77
+ height: 100px;
78
+ background-color: #f00;
79
+ border-radius: 10px;
80
+ color: #fff;
81
+ display: flex;
82
+ align-items: center;
83
+ justify-content: center;
84
+ }
85
+ </style>
86
+
87
+ ```
88
+
89
+ ```
90
+ list:列表(必填)
91
+ columns:几列(默认3列)
92
+ columnGap:列间距(默认10px)
93
+ rowGap:行间距(默认10px)
94
+ ```
95
+
96
+ 图片 - demo:
97
+
98
+ ```Vue
99
+ <template>
100
+ <div>
101
+ <vue3-Waterfall-Image
102
+ ref="waterfallRow"
103
+ :list="list"
104
+ :columns="3"
105
+ :columnGap="10"
106
+ :rowGap="10"
107
+ @imgClick="imgClick"
108
+ >
109
+ <template #header="{ item }">
110
+ <div class="test-waterfall">
111
+ {{ item.item.name }}
112
+ </div>
113
+ </template>
114
+ <template #footer="{ item }">
115
+ <div class="test-waterfall">
116
+ {{ item.item.name }}
117
+ </div>
118
+ </template>
119
+ </vue3-Waterfall-Image>
120
+ </div>
121
+ </template>
122
+
123
+ <script lang="ts" setup>
124
+ import { onMounted, ref } from 'vue'
125
+
126
+ onMounted(() => {
127
+ console.log('初始化')
128
+ })
129
+
130
+ const imgClick = (e: any) => {
131
+ console.log('点击了图片', e)
132
+ }
133
+
134
+ const list = ref([
135
+ {
136
+ id: 1,
137
+ name: '张三',
138
+ age: 18,
139
+ src: '图片地址',
140
+ },
141
+ {
142
+ id: 2,
143
+ name: '李四',
144
+ age: 19,
145
+ src: '图片地址',
146
+ },
147
+ {
148
+ id: 3,
149
+ name: '王五',
150
+ age: 20,
151
+ src: '图片地址',
152
+ },
153
+ {
154
+ id: 4,
155
+ name: '赵六',
156
+ age: 21,
157
+ src: '图片地址',
158
+ },
159
+ {
160
+ id: 5,
161
+ name: '钱七',
162
+ age: 22,
163
+ src: '图片地址',
164
+ },
165
+ {
166
+ id: 6,
167
+ name: '孙八',
168
+ age: 23,
169
+ src: '图片地址',
170
+ },
171
+ {
172
+ id: 7,
173
+ name: '周九',
174
+ age: 24,
175
+ src: '图片地址',
176
+ },
177
+ {
178
+ id: 8,
179
+ name: '郑十',
180
+ age: 25,
181
+ src: '图片地址',
182
+ },
183
+ ])
184
+ </script>
185
+
186
+ <style lang="scss" scoped>
187
+ .test-waterfall {
188
+ width: 100%;
189
+ background-color: #f00;
190
+ color: #fff;
191
+ display: flex;
192
+ align-items: center;
193
+ justify-content: center;
194
+ }
195
+ </style>
196
+
197
+ ```
198
+
199
+ ```
200
+ list:列表(必填)
201
+ columns:几列(默认3列)
202
+ columnGap:列间距(默认10px)
203
+ rowGap:行间距(默认10px)
204
+ imgViewBind: 图片view的 bind 数据
205
+ loadEndAppend: 是否全部图片加载完成后在渲染(默认false)
206
+ ```
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "vue3-waterfall-next",
3
+ "version": "1.1.0",
4
+ "description": "Vue3 瀑布流组件",
5
+ "keywords": [
6
+ "vue3",
7
+ "waterfall",
8
+ "layout",
9
+ "component"
10
+ ],
11
+ "private": false,
12
+ "type": "module",
13
+ "main": "./packages/index.js",
14
+ "module": "./packages/index.mjs",
15
+ "types": "./packages/index.d.ts",
16
+ "files": [
17
+ "packages/*"
18
+ ],
19
+ "author": {
20
+ "name": "GaoYi",
21
+ "email": "1219164581@qq.com"
22
+ },
23
+ "dependencies": {
24
+ "lodash": "^4.17.23",
25
+ "vue": "^3.5.27"
26
+ },
27
+ "devDependencies": {
28
+ "@types/lodash": "^4.17.23"
29
+ },
30
+ "engines": {
31
+ "node": "^20.19.0 || >=22.12.0"
32
+ }
33
+ }
Binary file