matrix_components 2.0.358 → 2.0.360

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
@@ -1,6 +1,13 @@
1
1
  # **组件库2.0**
2
2
  组件使用示例参考dist/ComponentDemo
3
3
 
4
+ ```
5
+ version:2.0.360
6
+ 2025-11-29
7
+ 更新日志:
8
+ 1.增加数值范围指令 v-length.range="{ min: 0, max: 100, int: true, maxLength: 10 }"
9
+ ```
10
+
4
11
  ```
5
12
  version:2.0.352
6
13
  2025-11-28
@@ -31,7 +31,7 @@
31
31
  <span>当前: "{{ numberInput }}" ({{ numberInput.length }}/8)</span>
32
32
  </div>
33
33
 
34
- <h3>正则模式 - v-length.regex</h3>
34
+ <h3>正则模式(不支持小数,使用v-length.range) - v-length.regex</h3>
35
35
  <div class="input-group">
36
36
  <label>字母数字,限制6位:</label>
37
37
  <el-input
@@ -42,6 +42,87 @@
42
42
  />
43
43
  <span>当前: "{{ regexInput }}" ({{ regexInput.length }}/6)</span>
44
44
  </div>
45
+
46
+ <h3>范围模式 - v-length.range</h3>
47
+ <div class="input-group">
48
+ <label>数字范围 0-100:</label>
49
+ <el-input
50
+ v-model="rangeInput1"
51
+ v-length.range="{ min: 0, max: 100 }"
52
+ placeholder="输入0-100之间的数字"
53
+ style="width: 300px;"
54
+ />
55
+ <span>当前: "{{ rangeInput1 }}"</span>
56
+ </div>
57
+
58
+ <div class="input-group">
59
+ <label>负数范围 -50到50:</label>
60
+ <el-input
61
+ v-model="rangeInput2"
62
+ v-length.range="{ min: -50, max: 50, maxLength: 10 }"
63
+ placeholder="输入-50到50之间的数字"
64
+ style="width: 300px;"
65
+ />
66
+ <span>当前: "{{ rangeInput2 }}"</span>
67
+ </div>
68
+
69
+ <div class="input-group">
70
+ <label>小数范围 0.1-99.9:</label>
71
+ <el-input
72
+ v-model="rangeInput3"
73
+ v-length.range="{ min: 0.1, max: 99.9 }"
74
+ placeholder="输入0.1-99.9之间的小数"
75
+ style="width: 300px;"
76
+ />
77
+ <span>当前: "{{ rangeInput3 }}"</span>
78
+ </div>
79
+
80
+ <div class="input-group">
81
+ <label>百分比范围 0-100%:</label>
82
+ <el-input
83
+ v-model="rangeInput4"
84
+ v-length.range="{ min: 0, max: 100, maxLength: 5 }"
85
+ placeholder="输入0-100之间的百分比数值"
86
+ style="width: 300px;"
87
+ >
88
+ <template #suffix>%</template>
89
+ </el-input>
90
+ <span>当前: "{{ rangeInput4 }}%"</span>
91
+ </div>
92
+
93
+ <h3>整数范围模式 - v-length.range (integerOnly)</h3>
94
+ <div class="input-group">
95
+ <label>整数范围 0-100 (仅整数):</label>
96
+ <el-input
97
+ v-model="rangeInput5"
98
+ v-length.range="{ min: 0, max: 100, integerOnly: true }"
99
+ placeholder="仅能输入0-100之间的整数"
100
+ style="width: 300px;"
101
+ />
102
+ <span>当前: "{{ rangeInput5 }}"</span>
103
+ </div>
104
+
105
+ <div class="input-group">
106
+ <label>年龄范围 1-120 (仅整数):</label>
107
+ <el-input
108
+ v-model="rangeInput6"
109
+ v-length.range="{ min: 1, max: 120, integerOnly: true, maxLength: 3 }"
110
+ placeholder="输入年龄1-120岁"
111
+ style="width: 300px;"
112
+ />
113
+ <span>当前: "{{ rangeInput6 }}"岁</span>
114
+ </div>
115
+
116
+ <div class="input-group">
117
+ <label>负整数范围 -10到10 (仅整数):</label>
118
+ <el-input
119
+ v-model="rangeInput7"
120
+ v-length.range="{ min: -10, max: 10, integerOnly: true }"
121
+ placeholder="输入-10到10之间的整数"
122
+ style="width: 300px;"
123
+ />
124
+ <span>当前: "{{ rangeInput7 }}"</span>
125
+ </div>
45
126
  </div>
46
127
 
47
128
  <!-- v-permission 指令演示 -->
@@ -154,6 +235,15 @@ const regexInput = ref('')
154
235
  const chineseInput = ref('')
155
236
  const autocompleteInput = ref('')
156
237
 
238
+ // v-length.range 演示数据
239
+ const rangeInput1 = ref('')
240
+ const rangeInput2 = ref('')
241
+ const rangeInput3 = ref('')
242
+ const rangeInput4 = ref('')
243
+ const rangeInput5 = ref('')
244
+ const rangeInput6 = ref('')
245
+ const rangeInput7 = ref('')
246
+
157
247
  // v-permission 演示数据
158
248
  const btnsPermission = ref(JSON.parse(sessionStorage.getItem('btnsPermission')) || ['add_btn', 'edit_btn', 'admin-btn'])
159
249
  sessionStorage.setItem('btnsPermission', JSON.stringify(btnsPermission.value))