gyyg-components 0.2.13 → 0.2.14
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/lib/gyyg-components.common.js +85 -85
- package/lib/gyyg-components.umd.js +85 -85
- package/lib/gyyg-components.umd.min.js +85 -85
- package/package.json +1 -1
- package/src/components/MecInput/MecInput.vue +7 -1
- package/src/components/MecTable/MecTable.vue +1 -1
- package/src/components/MecTransferDrag/MecTransferDrag.vue +1 -1
package/package.json
CHANGED
|
@@ -119,7 +119,6 @@
|
|
|
119
119
|
methods: {
|
|
120
120
|
handleInput(val) {
|
|
121
121
|
let value = val;
|
|
122
|
-
|
|
123
122
|
if (this.inputType === 'number') {
|
|
124
123
|
// 只允许输入数字
|
|
125
124
|
value = value.replace(/[^0-9]/g, '');
|
|
@@ -129,6 +128,13 @@
|
|
|
129
128
|
} else if (this.inputType === 'english') {
|
|
130
129
|
// 只允许输入英文
|
|
131
130
|
value = value.replace(/[^a-zA-Z\s]/g, '');
|
|
131
|
+
}else if (this.inputType === 'amount') {
|
|
132
|
+
// 只允许输入数字和小数点
|
|
133
|
+
value = value.replace(/[^0-9.]/g, '');
|
|
134
|
+
// 确保小数点只出现一次
|
|
135
|
+
if (value.split('.').length > 2) {
|
|
136
|
+
value = value.replace(/\.+$/, '');
|
|
137
|
+
}
|
|
132
138
|
}
|
|
133
139
|
this.inputValue = value
|
|
134
140
|
this.$emit('input', value);
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
:scope="scope"
|
|
71
71
|
:tableData="col"
|
|
72
72
|
v-model="scope.row[col.bind]"
|
|
73
|
-
v-bind="col.componentProps
|
|
73
|
+
v-bind="typeof col.componentProps === 'function' ? col.componentProps(scope.row) : col.componentProps"
|
|
74
74
|
v-on="col.componentListeners || {}"
|
|
75
75
|
></component>
|
|
76
76
|
</template>
|