File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1
- import { onBeforeUpdate , Ref , ref } from 'vue' ;
1
+ import { onMounted , Ref , ref } from 'vue' ;
2
2
3
3
/**
4
4
* Similar with `useLock`, but this hook will always execute last value.
@@ -14,12 +14,11 @@ export default function useDelayReset(
14
14
window . clearTimeout ( delay ) ;
15
15
} ;
16
16
17
- onBeforeUpdate ( ( ) => {
17
+ onMounted ( ( ) => {
18
18
cancelLatest ( ) ;
19
19
} ) ;
20
20
const delaySetBool = ( value : boolean , callback : ( ) => void ) => {
21
21
cancelLatest ( ) ;
22
-
23
22
delay = window . setTimeout ( ( ) => {
24
23
bool . value = value ;
25
24
if ( callback ) {
Original file line number Diff line number Diff line change 1
1
import { warning } from '../../vc-util/warning' ;
2
- import { VNodeChild } from 'vue' ;
2
+ import { isVNode , VNodeChild } from 'vue' ;
3
3
import {
4
4
OptionsType as SelectOptionsType ,
5
5
OptionData ,
@@ -163,7 +163,15 @@ export const getLabeledValue: GetLabeledValue<FlattenOptionData[]> = (
163
163
} ;
164
164
165
165
function toRawString ( content : VNodeChild ) : string {
166
- return toArray ( content ) . join ( '' ) ;
166
+ return toArray ( content )
167
+ . map ( item => {
168
+ if ( isVNode ( item ) ) {
169
+ return item ?. el ?. innerText || item ?. el ?. wholeText ;
170
+ } else {
171
+ return '' ;
172
+ }
173
+ } )
174
+ . join ( '' ) ;
167
175
}
168
176
169
177
/** Filter single option if match the search text */
@@ -177,7 +185,6 @@ function getFilterFunction(optionFilterProp: string) {
177
185
. toLowerCase ( )
178
186
. includes ( lowerSearchText ) ;
179
187
}
180
-
181
188
// Option value search
182
189
const rawValue = option [ optionFilterProp ] ;
183
190
const value = toRawString ( rawValue ) . toLowerCase ( ) ;
You can’t perform that action at this time.
0 commit comments