vue3-components-plus 3.0.13 → 3.0.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/README.md CHANGED
@@ -213,12 +213,8 @@ app.use(NsComponents)
213
213
 
214
214
  ```bash
215
215
  # 1. 引入组件库
216
- pnpm i element-plus
217
- pnpm i vue3-components-plus -S --registry=http://199.10.9.178:8081/repository/npm-group/
218
- # 安装失败:pnpm i vue3-components-plus --registry=http://199.10.9.178:8081/repository/npm-hosted/
216
+ pnpm i vue3-components-plus element-plus
219
217
 
220
- # 非初始化安装
221
- pnpm i -S --registry=http://199.10.9.178:8081/repository/npm-group/
222
218
  ```
223
219
 
224
220
  ```typescript
@@ -1019,6 +1015,13 @@ autoScaleInit(document.querySelector('body'), {
1019
1015
 
1020
1016
  ## 更新日志
1021
1017
 
1018
+ ```text
1019
+ version: 3.0.14
1020
+ 日期: 2026-03-16
1021
+ 更新内容:
1022
+ 1. 修复使用 v-length.range="{ min: 0, max: 10, maxLength: 10 }"指令时int:false,可输入负数的问题
1023
+ ```
1024
+
1022
1025
  ```text
1023
1026
  version: 3.0.13
1024
1027
  日期: 2026-03-13
@@ -47,7 +47,7 @@
47
47
  <div class="selection-actions">
48
48
  <el-button @click="getSelectedRows">获取选中行</el-button>
49
49
  <el-button @click="getSelectedKeys">获取选中ID</el-button>
50
- <el-button @click="selectRows([1, 3, 5])">选中ID为1,3,5的行</el-button>
50
+ <el-button @click="selectRows([1, 5, 21])">选中ID为1, 5, 21的行</el-button>
51
51
  <el-button @click="clearSelection">清空选择</el-button>
52
52
  <el-button @click="selectAll">全选</el-button>
53
53
  <el-button @click="checkSelection">检查选择状态</el-button>
@@ -377,16 +377,14 @@ const selectRows = (ids) => {
377
377
  containerRef.value.setSelectionKeys(ids)
378
378
 
379
379
  // 延迟检查选择结果
380
- setTimeout(() => {
381
- const selectedRows = containerRef.value.getSelectionRows()
382
- const selectedKeys = containerRef.value.getSelectionKeys()
383
-
384
- if (selectedRows.length > 0) {
385
- ElMessage.success(`已选中ID为 ${ids.join(', ')} 的行,实际选中:${selectedKeys.join(', ')}`)
386
- } else {
387
- ElMessage.warning(`未选中任何行,请检查数据是否正确`)
388
- }
389
- }, 100)
380
+ const selectedRows = containerRef.value.getSelectionRows()
381
+ const selectedKeys = containerRef.value.getSelectionKeys()
382
+
383
+ if (selectedRows.length > 0) {
384
+ ElMessage.success(`已选中ID为 ${ids.join(', ')} 的行,实际选中:${selectedKeys.join(', ')}`)
385
+ } else {
386
+ ElMessage.warning(`未选中任何行,请检查数据是否正确`)
387
+ }
390
388
  } catch (error) {
391
389
  console.error('选择出错:', error)
392
390
  ElMessage.error(`选择失败:${error.message}`)
@@ -7173,14 +7173,14 @@ function updatedCheck(el2, binding) {
7173
7173
  }
7174
7174
  });
7175
7175
  }
7176
- function formatNumberInput(value, maxLength) {
7176
+ function formatNumberInput(value, maxLength, allowNegative = true) {
7177
7177
  let result = "";
7178
7178
  let hasMinus = false;
7179
7179
  let hasDot = false;
7180
7180
  for (let i3 = 0; i3 < value.length; i3++) {
7181
7181
  const char = value[i3];
7182
7182
  if (char === "-") {
7183
- if (i3 === 0 && !hasMinus) {
7183
+ if (allowNegative && i3 === 0 && !hasMinus) {
7184
7184
  result += char;
7185
7185
  hasMinus = true;
7186
7186
  }
@@ -7247,7 +7247,8 @@ function formatRangeInput(value, config) {
7247
7247
  }
7248
7248
  return result2;
7249
7249
  }
7250
- let result = formatNumberInput(value, config.maxLength || 50);
7250
+ const allowNegative = config.min !== null && config.min < 0;
7251
+ let result = formatNumberInput(value, config.maxLength || 50, allowNegative);
7251
7252
  if (config.min === null && config.max === null) {
7252
7253
  return result;
7253
7254
  }