From 4055a23c507dbd7ba08c8fbb7bb4db3766a91460 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sun, 6 Jan 2019 19:24:32 +0800 Subject: [PATCH] docs: update demo --- components/table/demo/custom-filter-panel.md | 21 +++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/components/table/demo/custom-filter-panel.md b/components/table/demo/custom-filter-panel.md index db5846d07..9d4966300 100644 --- a/components/table/demo/custom-filter-panel.md +++ b/components/table/demo/custom-filter-panel.md @@ -13,7 +13,7 @@ Implement a customized column search example via `filterDropdown`.
{ if (visible) { setTimeout(() => { - this.$refs.searchInput.focus() - }) + this.searchInput.focus() + },0) } }, }, { @@ -101,6 +102,13 @@ export default { customRender: 'customRender', }, onFilter: (value, record) => record.age.toLowerCase().includes(value.toLowerCase()), + onFilterDropdownVisibleChange: (visible) => { + if (visible) { + setTimeout(() => { + this.searchInput.focus() + }) + } + }, }, { title: 'Address', dataIndex: 'address', @@ -111,6 +119,13 @@ export default { customRender: 'customRender', }, onFilter: (value, record) => record.address.toLowerCase().includes(value.toLowerCase()), + onFilterDropdownVisibleChange: (visible) => { + if (visible) { + setTimeout(() => { + this.searchInput.focus() + }) + } + }, }], } },