File tree 4 files changed +32
-4
lines changed
4 files changed +32
-4
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,17 @@ const CFormInput = defineComponent({
63
63
required : false ,
64
64
} ,
65
65
} ,
66
- setup ( props , { attrs, slots } ) {
66
+ emits : [ 'change' , 'input' ] ,
67
+ setup ( props , { attrs, emit, slots } ) {
68
+ const handleInput = ( event : Event ) => {
69
+ const target = event . target as HTMLInputElement
70
+ emit ( 'input' , target . value )
71
+ }
72
+
73
+ const handleChange = ( event : Event ) => {
74
+ const target = event . target as HTMLInputElement
75
+ emit ( 'change' , target . value )
76
+ }
67
77
return ( ) =>
68
78
h (
69
79
'input' ,
@@ -79,6 +89,8 @@ const CFormInput = defineComponent({
79
89
'is-valid' : props . valid ,
80
90
} ,
81
91
] ,
92
+ onChange : handleChange ,
93
+ onInput : handleInput ,
82
94
} ,
83
95
slots . default && slots . default ( ) ,
84
96
)
Original file line number Diff line number Diff line change @@ -39,7 +39,12 @@ const CFormSelect = defineComponent({
39
39
required : false ,
40
40
} ,
41
41
} ,
42
- setup ( props , { attrs, slots } ) {
42
+ emits : [ 'change' ] ,
43
+ setup ( props , { attrs, emit, slots } ) {
44
+ const handleChange = ( event : Event ) => {
45
+ const target = event . target as HTMLSelectElement
46
+ emit ( 'change' , Number ( target . value ) )
47
+ }
43
48
return ( ) =>
44
49
h (
45
50
'select' ,
@@ -52,6 +57,7 @@ const CFormSelect = defineComponent({
52
57
} ,
53
58
] ,
54
59
size : props . htmlSize ,
60
+ onChange : handleChange ,
55
61
} ,
56
62
slots . default && slots . default ( ) ,
57
63
)
Original file line number Diff line number Diff line change @@ -36,7 +36,11 @@ const CPaginationItem = defineComponent({
36
36
required : false ,
37
37
} ,
38
38
} ,
39
- setup ( props , { slots } ) {
39
+ emits : [ 'click' ] ,
40
+ setup ( props , { emit, slots } ) {
41
+ const handleClick = ( ) => {
42
+ emit ( 'click' )
43
+ }
40
44
return ( ) => {
41
45
const component = props . component ? props . component : props . active ? 'span' : 'a'
42
46
return h (
@@ -58,6 +62,7 @@ const CPaginationItem = defineComponent({
58
62
class : [ 'page-link' ] ,
59
63
component : component ,
60
64
href : props . href ,
65
+ onClick : handleClick ,
61
66
} ,
62
67
{
63
68
default : ( ) => slots . default && slots . default ( ) ,
Original file line number Diff line number Diff line change @@ -32,7 +32,11 @@ const CTableRow = defineComponent({
32
32
*/
33
33
color : Color ,
34
34
} ,
35
- setup ( props , { slots } ) {
35
+ emits : [ 'click' ] ,
36
+ setup ( props , { emit, slots } ) {
37
+ const handleClick = ( ) => {
38
+ emit ( 'click' )
39
+ }
36
40
return ( ) =>
37
41
h (
38
42
'tr' ,
@@ -44,6 +48,7 @@ const CTableRow = defineComponent({
44
48
[ `table-${ props . color } ` ] : props . color ,
45
49
} ,
46
50
] ,
51
+ onClick : handleClick ,
47
52
} ,
48
53
slots . default && slots . default ( ) ,
49
54
)
You can’t perform that action at this time.
0 commit comments