qtsk-vue3 0.0.12 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
@@ -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>
|