vue2server7 7.0.3 → 7.0.5

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": "vue2server7",
3
- "version": "7.0.3",
3
+ "version": "7.0.5",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "dev": "nodemon --watch src --ext ts --exec \"ts-node src/app.ts\"",
package/test/319 DELETED
@@ -1,41 +0,0 @@
1
- <template>
2
- <el-input
3
- v-model="innerValue"
4
- @input="handleInput"
5
- v-bind="$attrs"
6
- />
7
- </template>
8
-
9
- <script setup lang="ts">
10
- import { ref, watch } from 'vue'
11
-
12
- // ✅ props 类型
13
- interface Props {
14
- modelValue?: string
15
- }
16
-
17
- const props = defineProps<Props>()
18
-
19
- // ✅ emit 类型
20
- const emit = defineEmits<{
21
- (e: 'update:modelValue', value: string): void
22
- }>()
23
-
24
- // ✅ 内部值
25
- const innerValue = ref<string>(props.modelValue ?? '')
26
-
27
- // ✅ 监听外部变化
28
- watch(
29
- () => props.modelValue,
30
- (val) => {
31
- innerValue.value = val ?? ''
32
- }
33
- )
34
-
35
- // ✅ 输入处理
36
- const handleInput = (val: string) => {
37
- const newVal = val.replace(/[^\d]/g, '')
38
- innerValue.value = newVal
39
- emit('update:modelValue', newVal)
40
- }
41
- </script>