feat: 任务全景搜索框增加一键清除(×)按钮
This commit is contained in:
@ -264,8 +264,17 @@ export default function AdminTasksPage() {
|
|||||||
value={keyword}
|
value={keyword}
|
||||||
onChange={(e) => setKeyword(e.target.value)}
|
onChange={(e) => setKeyword(e.target.value)}
|
||||||
placeholder="搜索产品身份证、订单号、规格型号..."
|
placeholder="搜索产品身份证、订单号、规格型号..."
|
||||||
className="w-full rounded-lg border border-gray-200 py-2.5 pl-9 pr-3 text-sm focus:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-100"
|
className="w-full rounded-lg border border-gray-200 py-2.5 pl-9 pr-8 text-sm focus:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-100"
|
||||||
/>
|
/>
|
||||||
|
{keyword && (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => { setKeyword(""); loadProducts(""); }}
|
||||||
|
className="absolute right-2 top-1/2 -translate-y-1/2 rounded-full p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-100"
|
||||||
|
>
|
||||||
|
<X className="h-4 w-4" />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|||||||
Reference in New Issue
Block a user