@netang/quasar 0.2.10 → 0.2.12

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.
@@ -300,7 +300,7 @@ export default {
300
300
  /**
301
301
  * 对话框确认
302
302
  */
303
- async function onDialogConfirm() {
303
+ async function onDialogConfirm(...args) {
304
304
 
305
305
  // 如果有确定按钮
306
306
  if ($n_isFunction(props.onConfirm)) {
@@ -313,7 +313,7 @@ export default {
313
313
  return
314
314
  }
315
315
 
316
- const res = await $n_runAsync(props.onConfirm)(await $n_runAsync(compSubmit)(), hide)
316
+ const res = await $n_runAsync(props.onConfirm)(await $n_runAsync(compSubmit)(...args), hide)
317
317
  if (res === false) {
318
318
  return
319
319
  }
@@ -7,6 +7,7 @@
7
7
  :disable="disable"
8
8
  :readonly="readonly"
9
9
  v-model="currentValue"
10
+ @update:model-value="onUpdate"
10
11
  @blur="onBlur"
11
12
  v-bind="$attrs"
12
13
  >
@@ -313,19 +314,7 @@ export default {
313
314
  /**
314
315
  * 监听 当前最小值 / 当前最大值 / 当前小数位数
315
316
  */
316
- watch([currentMin, currentMax, currentDecimalLength], function () {
317
-
318
- // 格式化当前值
319
- const val = formatToCurrentValue(currentValue.value, false)
320
-
321
- // 如果当前值有变化
322
- if (val !== currentValue.value) {
323
- // 更新当前值
324
- currentValue.value = val
325
- // 更新值
326
- emitModelValue(formatToModelValue(val))
327
- }
328
- })
317
+ watch([currentMin, currentMax, currentDecimalLength], onUpdate)
329
318
 
330
319
  // ==========【方法】=============================================================================================
331
320
 
@@ -446,6 +435,23 @@ export default {
446
435
  return ''
447
436
  }
448
437
 
438
+ /**
439
+ * 更新值触发
440
+ */
441
+ function onUpdate() {
442
+
443
+ // 格式化当前值
444
+ const newVal = formatToCurrentValue(currentValue.value, false)
445
+
446
+ // 如果当前值有变化
447
+ if (newVal !== currentValue.value) {
448
+ // 更新当前值
449
+ currentValue.value = newVal
450
+ // 更新值
451
+ emitModelValue(formatToModelValue(newVal))
452
+ }
453
+ }
454
+
449
455
  /**
450
456
  * 失去焦点触发
451
457
  */
@@ -504,6 +510,8 @@ export default {
504
510
  // 当前是否禁用增加按钮
505
511
  currentDisablePlus,
506
512
 
513
+ // 更新值触发
514
+ onUpdate,
507
515
  // 失去焦点触发
508
516
  onBlur,
509
517
  // 改变值
@@ -897,7 +897,7 @@ export default {
897
897
  &__item {
898
898
  // 单个文件
899
899
  &--file {
900
- width: 100%;
900
+ width: 250px;
901
901
  }
902
902
  }
903
903
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netang/quasar",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
 
5
5
  "description": "netang-quasar",
6
6
  "scripts": {