File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1111 ref =" btn"
1212 >
1313 <span class =" cl-btn-selection" >{{ selection ?? selectedStr }}</span >
14- <span :class =" { clearable: clearable && !isEmpty }" class =" cl-btn-suffix" @click =" clear" >
14+ <span
15+ :class =" { clearable: clearable && !isEmpty }"
16+ class =" cl-btn-suffix"
17+ @click =" iconClicked"
18+ >
1519 <CloseCircleFilled v-if =" clearable && !isEmpty" />
1620 <DownOutlined v-else />
1721 </span >
@@ -83,13 +87,24 @@ export default defineComponent({
8387 }
8488 }
8589
90+ function iconClicked(e : Event ) {
91+ if (! props .clearable || s .isEmpty .value ) {
92+ return
93+ }
94+ if (! menu .value ) {
95+ e .stopPropagation ()
96+ }
97+ s .clear ()
98+ }
99+
86100 return {
87101 ... s ,
88102 menu ,
89103 toggleMenu ,
90104 btn ,
91105 floating ,
92106 floatingStyles ,
107+ iconClicked ,
93108 }
94109 },
95110})
You can’t perform that action at this time.
0 commit comments