@netang/quasar 0.2.1 → 0.2.2

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.
@@ -100,9 +100,13 @@
100
100
  v-for="(fileItem, fileItemIndex) in query"
101
101
  :key="`query-item-${fileItem.id}`"
102
102
  class="n-uploader-query__item n-uploader-query__item--image"
103
- :class="{
104
- ghost: fileItemIndex === fromIndex,
105
- }"
103
+ :class="[
104
+ {
105
+ ghost: fileItemIndex === fromIndex,
106
+ },
107
+ itemClass,
108
+ ]"
109
+ :style="itemStyle"
106
110
  :draggable="currentDrag"
107
111
  @mousedown.self="mousedown($event, fileItemIndex)"
108
112
  @mouseup="dragEnd"
@@ -173,6 +177,7 @@
173
177
  <slot
174
178
  name="settings"
175
179
  :file="fileItem"
180
+ :index="fileItemIndex"
176
181
  />
177
182
 
178
183
  <!-- 预览 -->
@@ -198,7 +203,15 @@
198
203
  />
199
204
 
200
205
  </div>
206
+
207
+ <!-- 插槽-->
208
+ <slot
209
+ name="item-append"
210
+ :file="fileItem"
211
+ :index="fileItemIndex"
212
+ />
201
213
  </n-img>
214
+
202
215
  </div>
203
216
 
204
217
  <!-- 右边方块按钮 -->
@@ -236,12 +249,18 @@
236
249
  v-for="(fileItem, fileItemIndex) in query"
237
250
  :key="`query-item-${fileItem.id}`"
238
251
  class="n-uploader-query__item n-uploader-query__item--file"
239
- :class="{
240
- ghost: fileItemIndex === fromIndex,
241
- }"
242
- :style="{
243
- height: toPx(currentSize),
244
- }"
252
+ :class="[
253
+ {
254
+ ghost: fileItemIndex === fromIndex,
255
+ },
256
+ itemClass,
257
+ ]"
258
+ :style="[
259
+ {
260
+ height: toPx(currentSize),
261
+ },
262
+ itemStyle,
263
+ ]"
245
264
  :draggable="currentDrag"
246
265
  @mousedown.self="mousedown($event, fileItemIndex)"
247
266
  @mouseup="dragEnd"
@@ -321,6 +340,7 @@
321
340
  <slot
322
341
  name="settings"
323
342
  :file="fileItem"
343
+ :index="fileItemIndex"
324
344
  />
325
345
 
326
346
  <template v-if="fileItem.status === UPLOAD_STATUS.success">
@@ -381,6 +401,14 @@
381
401
  v-if="! noDelete && ! disable && ! readonly"
382
402
  />
383
403
  </div>
404
+
405
+ <!-- 插槽-->
406
+ <slot
407
+ name="item-append"
408
+ :file="fileItem"
409
+ :index="fileItemIndex"
410
+ />
411
+
384
412
  </div>
385
413
  </template>
386
414
  </n-dragger>
@@ -429,6 +457,10 @@ export default {
429
457
  * 声明属性
430
458
  */
431
459
  props: {
460
+ // 单个文件类名
461
+ itemClass: [String, Array, Object],
462
+ // 单个文件样式
463
+ itemStyle: [String, Array, Object],
432
464
  // 按钮类型, 可选值 square button
433
465
  buttonType: {
434
466
  type: String,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netang/quasar",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "netang-quasar",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/utils/uploader.js CHANGED
@@ -568,7 +568,7 @@ function create(options) {
568
568
  // 设置文件 hash
569
569
  fileItem.hash = hash
570
570
  // 标题
571
- fileItem.title = fileItem.hash
571
+ fileItem.title = ''
572
572
  // 设置文件状态
573
573
  fileItem.status = UPLOAD_STATUS.hashChecked
574
574
  // 设置文件检查进度