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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gyyg-components",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "private": false,
5
5
  "main": "lib/gyyg-components.umd.js",
6
6
  "scripts": {
@@ -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>
@@ -2,7 +2,7 @@
2
2
  <el-transfer
3
3
  v-model="rightData"
4
4
  :data="data"
5
- :titles=titles
5
+ :titles="titles"
6
6
  :left-default-checked="leftDefaultChecked"
7
7
  :right-default-checked="rightDefaultChecked"
8
8
  :props="props"