@truenewx/tnxvue3 3.0.0-alpha.32 → 3.0.0-alpha.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truenewx/tnxvue3",
3
- "version": "3.0.0-alpha.32",
3
+ "version": "3.0.0-alpha.33",
4
4
  "description": "互联网技术解决方案:Vue3扩展支持",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -1,16 +1,16 @@
1
1
  <template>
2
2
  <div class="tnxel-input-number" :class="containerClassObject">
3
3
  <el-input-number ref="input" class="flex-grow-1" :class="{'rounded-end-0': suffix, 'text-start': !controls}"
4
- v-model="model"
5
- :min="min" :max="max"
6
- :controls="controls" controls-position="right"
7
- :placeholder="placeholderText" :disabled="disabled"
8
- :step="step || Math.pow(10, -this.scale)" step-strictly
9
- :precision="scale"
10
- :value-on-clear="null"
11
- :size="size"
12
- @change="onChange"
13
- @blur="$emit('blur', $event)"/>
4
+ v-model="model"
5
+ :min="min" :max="max"
6
+ :controls="controls" controls-position="right"
7
+ :placeholder="placeholderText" :disabled="disabled"
8
+ :step="step || Math.pow(10, -this.scale)" step-strictly
9
+ :precision="scale"
10
+ :value-on-clear="null"
11
+ :size="size"
12
+ @change="onChange"
13
+ @blur="$emit('blur', $event)"/>
14
14
  <div class="el-input-group__append" v-if="suffix">{{ suffix }}</div>
15
15
  </div>
16
16
  </template>
@@ -41,7 +41,7 @@ export default {
41
41
  required: Boolean,
42
42
  size: String,
43
43
  },
44
- emits: ['update:modelValue', 'blur'],
44
+ emits: ['update:modelValue', 'blur', 'change'],
45
45
  data() {
46
46
  return {
47
47
  model: typeof this.modelValue === 'string' ? Number(this.modelValue) : this.modelValue,
@@ -103,7 +103,11 @@ export default {
103
103
  this.$refs.input.focus();
104
104
  },
105
105
  onChange() {
106
- this.validateRequired(false);
106
+ if (this.validateRequired(false)) {
107
+ this.$nextTick(() => {
108
+ this.$emit('change', this.modelValue);
109
+ });
110
+ }
107
111
  },
108
112
  }
109
113
  }