AutoComplete照着官方的例子,为什么VSCODE会报错? #16317
Replies: 2 comments 3 replies
-
typeScript类型校验不通过,应该是参数类型没对上,可以尝试着将 cb: (arg: any) => void 类型定义为AutocompleteFetchSuggestionsCallback import { AutocompleteFetchSuggestionsCallback } from 'element-plus';
const query = async (queryString: string, cb:AutocompleteFetchSuggestionsCallback) => {
if (!queryString) {
cb([])
}
const res = await getEntities(props.url, {
filter: {
logic: FilterLogic.OR,
filters: props.treeProps.search.map((s: any) => ({
type: SEATypes.String,
operator: Operators.CONTAINS,
field: s,
value: queryString,
})),
},
})
cb(res.data)
} |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
WestFarmer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
version: 2.4.4
Beta Was this translation helpful? Give feedback.
All reactions