File tree Expand file tree Collapse file tree 4 files changed +12
-27
lines changed
Expand file tree Collapse file tree 4 files changed +12
-27
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const _default = defineComponent({
1313 props : {
1414 placeholder : String
1515 } ,
16- emits : [ "clear" , "enter "] ,
16+ emits : [ "search " ] ,
1717 setup ( props , ctx ) {
1818 const modelValue : Ref < string > = ref ( "" )
1919 return ( ) => h ( ElInput , {
@@ -23,10 +23,11 @@ const _default = defineComponent({
2323 clearable : true ,
2424 onClear ( ) {
2525 modelValue . value = ''
26- ctx . emit ( "clear " )
26+ ctx . emit ( "search" , " ")
2727 } ,
2828 onInput : ( val : string ) => modelValue . value = val . trim ( ) ,
29- onKeyup : ( event : KeyboardEvent ) => event . key === 'Enter' && ctx . emit ( "enter" , modelValue . value )
29+ onKeyup : ( event : KeyboardEvent ) => event . key === 'Enter' && ctx . emit ( "search" , modelValue . value ) ,
30+ onBlur : ( _event : FocusEvent ) => ctx . emit ( "search" , modelValue . value ) ,
3031 } )
3132 }
3233} )
Original file line number Diff line number Diff line change @@ -38,14 +38,10 @@ const _default = defineComponent({
3838 return ( ) => [
3939 h ( InputFilterItem , {
4040 placeholder : urlPlaceholder ,
41- onClear ( ) {
42- url . value = ""
41+ onSearch ( searchVal : string ) {
42+ url . value = searchVal
4343 handleChange ( )
4444 } ,
45- onEnter ( newVal : string ) {
46- url . value = newVal
47- handleChange ( )
48- }
4945 } ) ,
5046 h ( SwitchFilterItem , {
5147 label : onlyEnabledLabel ,
Original file line number Diff line number Diff line change @@ -72,14 +72,10 @@ const _default = defineComponent({
7272 return ( ) => [
7373 h ( InputFilterItem , {
7474 placeholder : hostPlaceholder ,
75- onClear ( ) {
76- host . value = ""
75+ onSearch ( searchVal : string ) {
76+ host . value = searchVal
7777 handleChange ( )
7878 } ,
79- onEnter ( newVal : string ) {
80- host . value = newVal
81- handleChange ( )
82- }
8379 } ) ,
8480 h ( DateRangeFilterItem , {
8581 startPlaceholder : dateStartPlaceholder ,
Original file line number Diff line number Diff line change @@ -43,23 +43,15 @@ const _default = defineComponent({
4343 return ( ) => [
4444 h ( InputFilterItem , {
4545 placeholder : hostPlaceholder ,
46- onClear ( ) {
47- host . value = ""
46+ onSearch ( searchVal : string ) {
47+ host . value = searchVal
4848 handleChange ( )
4949 } ,
50- onEnter ( newVal : string ) {
51- host . value = newVal
52- handleChange ( )
53- }
5450 } ) ,
5551 h ( InputFilterItem , {
5652 placeholder : aliasPlaceholder ,
57- onClear ( ) {
58- alias . value = ""
59- handleChange ( )
60- } ,
61- onEnter ( newVal : string ) {
62- alias . value = newVal
53+ onSearch ( searchVal : string ) {
54+ alias . value = searchVal
6355 handleChange ( )
6456 }
6557 } ) ,
You can’t perform that action at this time.
0 commit comments