From 6fa9f78a65a9611e0cab83bd1cf3c89004c5de88 Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Tue, 5 Nov 2024 21:27:56 +0800 Subject: [PATCH] docs: fix type error for autocomplete (#18762) --- docs/examples/autocomplete/autocomplete-template.vue | 6 +++--- docs/examples/autocomplete/autocomplete.vue | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/examples/autocomplete/autocomplete-template.vue b/docs/examples/autocomplete/autocomplete-template.vue index 326925ef4249c..db1c1bdacad9b 100644 --- a/docs/examples/autocomplete/autocomplete-template.vue +++ b/docs/examples/autocomplete/autocomplete-template.vue @@ -37,8 +37,8 @@ const querySearch = (queryString: string, cb) => { // call callback function to return suggestion objects cb(results) } -const createFilter = (queryString) => { - return (restaurant) => { +const createFilter = (queryString: string) => { + return (restaurant: LinkItem) => { return ( restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0 ) @@ -55,7 +55,7 @@ const loadAll = () => { { value: 'babel', link: 'https://github.com/babel/babel' }, ] } -const handleSelect = (item: LinkItem) => { +const handleSelect = (item: Record) => { console.log(item) } diff --git a/docs/examples/autocomplete/autocomplete.vue b/docs/examples/autocomplete/autocomplete.vue index 0f00a73b6c8e1..3d8840426dee7 100644 --- a/docs/examples/autocomplete/autocomplete.vue +++ b/docs/examples/autocomplete/autocomplete.vue @@ -68,7 +68,7 @@ const loadAll = () => { ] } -const handleSelect = (item: RestaurantItem) => { +const handleSelect = (item: Record) => { console.log(item) }