goodteditor-ui 1.0.35 → 1.0.36
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
|
@@ -177,19 +177,16 @@ export default {
|
|
|
177
177
|
value: {
|
|
178
178
|
handler(v) {
|
|
179
179
|
const a = String(v).match(withUnitRegExp);
|
|
180
|
+
const [_, n, u] = a ?? [];
|
|
180
181
|
const { units } = this;
|
|
181
182
|
let unit = units.length ? units[0] : '';
|
|
182
|
-
let value = '';
|
|
183
|
+
let value = Number.isNaN(Number(v)) ? '' : v;
|
|
183
184
|
|
|
184
|
-
if (
|
|
185
|
-
value =
|
|
186
|
-
|
|
187
|
-
const [_, n, u] = a;
|
|
188
|
-
if (units.includes(u)) {
|
|
189
|
-
value = n;
|
|
190
|
-
unit = u;
|
|
191
|
-
}
|
|
185
|
+
if (units.includes(u)) {
|
|
186
|
+
value = n;
|
|
187
|
+
unit = u;
|
|
192
188
|
}
|
|
189
|
+
|
|
193
190
|
this.dataListCursorIndex = units.indexOf(unit);
|
|
194
191
|
this.model = { value, unit };
|
|
195
192
|
},
|