diff --git a/lib/picker/dev.ts b/lib/picker/dev.ts index 1896f76075..52aa0d70de 100644 --- a/lib/picker/dev.ts +++ b/lib/picker/dev.ts @@ -54,6 +54,7 @@ onPageUpdate(() => { placeholder: '请选择你的最爱', searchHint: '搜索选项', cache: false, + maxItemsCount: 4, }); console.log('> singlePickerRemote', singlePickerRemote); diff --git a/lib/picker/dev/items.json b/lib/picker/dev/items.json index e1dda98780..73d3e6f142 100644 --- a/lib/picker/dev/items.json +++ b/lib/picker/dev/items.json @@ -7,7 +7,7 @@ {"text": "Dog", "value": "dog", "keys": "animals pet"}, {"text": "Fish", "value": "fish", "keys": "animals food"}, {"text": "Pig", "value": "pig", "keys": "animals food"}, - {"text": "梨子", "value": "pear", "keys": "fruit food"}, + {"text": "梨子", "value": "pear", "keys": "fruit food lizi"}, {"text": "Anna", "value": "anna", "keys": "human animals"}, {"text": "Ben", "value": "ben", "keys": "human animals"}, {"text": "Cake", "value": "cake", "keys": "food"} diff --git a/lib/picker/src/component/picker-menu.tsx b/lib/picker/src/component/picker-menu.tsx index dd3d093f0a..d6f9984c9f 100644 --- a/lib/picker/src/component/picker-menu.tsx +++ b/lib/picker/src/component/picker-menu.tsx @@ -167,7 +167,8 @@ export class PickerMenu extends PickPop { ref: this._menu, className: 'picker-menu-list', underlineKeys: true, - items: maxItemsCount ? items.slice(0, maxItemsCount) : items, + limit: maxItemsCount, + items: items, defaultNestedShow: true, activeOnHover: true, search: search,