qtsk-vue3 0.0.12 → 0.0.13

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.
@@ -12,13 +12,14 @@
12
12
  </template>
13
13
 
14
14
  <script setup>
15
+ import { computed } from 'vue'
15
16
  import {ElInput} from 'element-plus'
16
17
  import '../../style/root.css'
17
18
 
18
19
  defineOptions({
19
20
  name: 'Input'
20
21
  })
21
- defineProps({
22
+ const props = defineProps({
22
23
  type: {
23
24
  type: String,
24
25
  default: 'text'
@@ -26,9 +27,24 @@ defineProps({
26
27
  placeholder: {
27
28
  type: String,
28
29
  default: '请输入'
30
+ },
31
+ modelValue: {
32
+ type: [String, Number],
33
+ default: ''
34
+ }
35
+ })
36
+ const emits = defineEmits(['update:modelValue'])
37
+ const inputValue = computed({
38
+ get () {
39
+ return props.modelValue
40
+ },
41
+ set (value) {
42
+ if(value && typeof value === 'string'){
43
+ value = value.trim()
44
+ }
45
+ emits('update:modelValue', value)
29
46
  }
30
47
  })
31
- const inputValue = defineModel('modelValue', {default: '',type: [String, Number]})
32
48
  </script>
33
49
 
34
50
  <style lang="less" scoped>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qtsk-vue3",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "vue3版组件库",
5
5
  "main": "./package/index.js",
6
6
  "scripts": {