File tree Expand file tree Collapse file tree 4 files changed +20
-65
lines changed Expand file tree Collapse file tree 4 files changed +20
-65
lines changed Original file line number Diff line number Diff line change 3
3
<span v-if =" title" class =" EditorField-Title" >{{ title }}</span >
4
4
<div class =" EditorField-Form" >
5
5
<editor-input-field
6
- v-model = " modelValue "
6
+ :value = " value "
7
7
:label =" label"
8
8
:placeholder =" placeholder"
9
9
:transparent =" transparent"
10
10
:readonly =" readonly"
11
+ @input =" $emit('input', $event)"
11
12
/>
12
13
<content-card-editor-button
13
14
v-if =" iconName"
@@ -24,10 +25,6 @@ import Vue from 'vue'
24
25
import EditorInputField from ' @/components/EditorInputField.vue'
25
26
import ContentCardEditorButton from ' @/components/ContentCardEditorButton.vue'
26
27
27
- type DataType = {
28
- modelValue: string
29
- }
30
-
31
28
export default Vue .extend ({
32
29
components: { EditorInputField , ContentCardEditorButton },
33
30
props: {
@@ -66,19 +63,6 @@ export default Vue.extend({
66
63
required: false ,
67
64
default: ' '
68
65
}
69
- },
70
- data(): DataType {
71
- return {
72
- modelValue: this .value
73
- }
74
- },
75
- watch: {
76
- modelValue(value ) {
77
- this .$emit (' input' , value )
78
- },
79
- value(value ) {
80
- this .modelValue = value
81
- }
82
66
}
83
67
})
84
68
</script >
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<v-text-field
3
- v-model = " modelValue "
3
+ :value = " value "
4
4
:color =" transparent ? 'white' : '#424242'"
5
5
type =" text"
6
6
:hint =" hint"
11
11
class =" elevation-0"
12
12
solo
13
13
flat
14
+ @input =" $emit('input', $event)"
14
15
/>
15
16
</template >
16
17
17
18
<script lang="ts">
18
19
import Vue from ' vue'
19
- type DataType = {
20
- modelValue: string
21
- }
20
+
22
21
export default Vue .extend ({
23
22
name: ' InputField' ,
24
23
props: {
@@ -62,19 +61,6 @@ export default Vue.extend({
62
61
required: true ,
63
62
default: ' '
64
63
}
65
- },
66
- data(): DataType {
67
- return {
68
- modelValue: this .value
69
- }
70
- },
71
- watch: {
72
- modelValue(value ) {
73
- this .$emit (' input' , value )
74
- },
75
- value(value ) {
76
- this .modelValue = value
77
- }
78
64
}
79
65
})
80
66
</script >
Original file line number Diff line number Diff line change 2
2
<div >
3
3
<span v-if =" title" class =" EditorTextarea-Title" >{{ title }}</span >
4
4
<v-textarea
5
- v-model = " modelValue "
5
+ :value = " value "
6
6
:hint =" hint"
7
7
:label =" label"
8
8
:placeholder =" placeholder"
9
9
background-color =" white"
10
10
class =" elevation-0"
11
11
solo
12
12
flat
13
+ @input =" $emit('input', $event)"
13
14
/>
14
15
</div >
15
16
</template >
16
17
17
18
<script lang="ts">
18
19
import Vue from ' vue'
19
20
20
- type DataType = {
21
- modelValue: string
22
- }
23
-
24
21
export default Vue .extend ({
25
22
props: {
26
23
title: {
@@ -48,19 +45,6 @@ export default Vue.extend({
48
45
required: false ,
49
46
default: ' '
50
47
}
51
- },
52
- data(): DataType {
53
- return {
54
- modelValue: this .value
55
- }
56
- },
57
- watch: {
58
- modelValue(value ) {
59
- this .$emit (' input' , value )
60
- },
61
- value(value ) {
62
- this .modelValue = value
63
- }
64
48
}
65
49
})
66
50
</script >
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<v-text-field
3
3
v-if =" type === 'password'"
4
- v-model =" value"
4
+ :value =" value"
5
5
:color =" textFieldColor"
6
6
:type =" show ? 'text' : 'password'"
7
7
:hint =" hint"
12
12
solo
13
13
flat
14
14
outlined
15
+ @input =" $emit('input', $event)"
15
16
>
16
17
<template v-slot :prepend-inner >
17
18
<v-icon :color =" prependIconColor" >{{ prependIcon }}</v-icon >
26
27
</v-text-field >
27
28
<v-text-field
28
29
v-else-if =" type === 'email'"
29
- v-model =" value"
30
+ :value =" value"
30
31
:color =" textFieldColor"
31
32
type =" text"
32
33
:hint =" hint"
37
38
solo
38
39
flat
39
40
outlined
41
+ @input =" $emit('input', $event)"
40
42
>
41
43
<template v-slot :prepend-inner >
42
44
<v-icon :color =" prependIconColor" >{{ prependIcon }}</v-icon >
43
45
</template >
44
46
</v-text-field >
45
47
<v-text-field
46
48
v-else-if =" type === 'classId'"
47
- v-model =" value"
49
+ :value =" value"
48
50
:color =" textFieldColor"
49
51
type =" text"
50
52
:hint =" hint"
55
57
solo
56
58
flat
57
59
outlined
60
+ @input =" $emit('input', $event)"
58
61
>
59
62
<template v-slot :prepend-inner >
60
63
<v-icon :color =" prependIconColor" >{{ prependIcon }}</v-icon >
61
64
</template >
62
65
</v-text-field >
63
66
<v-text-field
64
67
v-else
65
- v-model =" value"
68
+ :value =" value"
66
69
:color =" textFieldColor"
67
70
type =" text"
68
71
:hint =" hint"
73
76
solo
74
77
flat
75
78
outlined
79
+ @input =" $emit('input', $event)"
76
80
>
77
81
<template v-slot :prepend-inner >
78
82
<v-icon :color =" prependIconColor" >{{ prependIcon }}</v-icon >
83
87
<script lang="ts">
84
88
import Vue from ' vue'
85
89
type DataType = {
86
- value: string
87
90
show: boolean
88
91
}
89
92
export default Vue .extend ({
90
93
name: ' InputField' ,
91
94
props: {
95
+ value: {
96
+ type: String ,
97
+ default: ' '
98
+ },
92
99
type: {
93
100
type: String ,
94
101
required: false ,
@@ -122,8 +129,7 @@ export default Vue.extend({
122
129
},
123
130
data(): DataType {
124
131
return {
125
- show: false ,
126
- value: ' '
132
+ show: false
127
133
}
128
134
},
129
135
computed: {
@@ -182,11 +188,6 @@ export default Vue.extend({
182
188
}
183
189
return ' mdi-check-circle'
184
190
}
185
- },
186
- watch: {
187
- value(value ) {
188
- this .$emit (' input' , value )
189
- }
190
191
}
191
192
})
192
193
</script >
You can’t perform that action at this time.
0 commit comments