1 |
- import{S as e}from"./index-15874193.js";import{d as a,r,H as l,j as s,a as c,V as o,B as t,n}from"./index-d31722d5.js";const u={"m-search":"_m-search_xezdo_1",searchBtn:"_searchBtn_xezdo_24",leftIcon:"_leftIcon_xezdo_39"},A=a({name:"m-search",props:{modelValue:{type:String,"default":""},shape:{type:String,"default":"round"},disabled:{type:Boolean,"default":!1},clearable:{type:Boolean,"default":!0},autofocus:{type:Boolean,"default":!1},placeholder:{type:String,"default":"请输入搜索关键词"},background:{type:String,"default":"#fff"},searchIcon:{type:String,"default":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAjVBMVEUAAAABwbUBwbUIxbMAx7sBwrUG0sEBwrUCwbYAwrYBwbYBwbYCwrYDw7YEwbYCxbcExLUYzKIBwrYBwrUBwrUBwrUBwrYBwrYCwrYCwrYCwrcCwrcBwbUDw7gBwrUBwbYBwrUCwrYCwrYCwrcCwrYDwbUCxLcAw7cBwbUCwrYCw7YExbgCwrYBwrYBwbXnPIxzAAAALnRSTlMA/PkTCs4G9qgZ6uJ6PyYhEAVm8u/VvK6fllYc5jDbx8Gaj4qDX0UssnZxO2qxSgNy2wAAAfBJREFUOMuNVNmWgjAUAwoCyibKDops4zb8/+cNaXUslnrMg+fahiS3t6DMoNtV7rRNF7p+oHyCF54MbWTYJI67lRH168EcOahry1skrgZjFLC+BAuSl/3IsD8Yx6h85kh+BM2Uee/OvefbduG7zYalMKo3zXQEEI6PrtL+/JnmxYRAPMxb9loaqua5A11KCqGBcAeJTH+tGFhIlk4xhN3u9v//Cs0YmiIccOPVM9IBHQ3KIkgCx543sWRDzNHHkcnqJ8TxpOOOp+2SHa6Nps6KFP20bYa0rDDDXk4NkC+jCXLMHf4y1HANUDlTdfA/UFP0ZaNqp8pAJUMHQoGqYQ/JAduIUjtWyZH9295xbp+y/mK0BJU7VZorZ65wx1MdpY+ykVMhpTrsiBNcdV0elbtMDt6Lq4xZwTQiD4c1huBJkrYql29rIU27HOFWwh+iFB5k9+ES8yeCzP21cKGfgHCBaWCn5mYZJAhkOuQt5y2iGrn4tJnkOr/YliOgpeT9SBA47oOHopttYEW58xfPrx8bZp12TvaLR6m7hl+LzLjZbhSg1nkKrnaacfVbDGEe67utEEvIgHz9sTRf3+yoIWxCYgaQqzA7H43IiFNneO6RE8sQCEMP7KKwCXdqzwy58gVYhu4zictQuspXCPLO3f4BoTRURugakDAAAAAASUVORK5CYII="},inputBackground:{type:String,"default":"#f8f9fc"}},emits:["search","focus","blur"],setup(a,{slots:A,emit:d,expose:h}){const w=r({search:a.modelValue||""}),p=l();return s((()=>a.modelValue),(()=>{w.search=a.modelValue})),h({searchBlur:()=>{var e;null==(e=p.value)||e.blur()}}),()=>c(e,{"class":[u["m-search"],u[a.inputBackground]],style:{"--van-search-content-background":a.inputBackground},ref:p,shape:a.shape,background:a.background,placeholder:a.placeholder,disabled:a.disabled,autofocus:a.autofocus,autocomplete:"off",clearable:a.clearable,modelValue:w.search,"onUpdate:modelValue":e=>w.search=e,clearTrigger:"always",onClear:()=>{w.search="",d("search",w.search)},onFocus:()=>d("focus"),onBlur:()=>d("blur",w.search),onSearch:()=>d("search",w.search)},{left:()=>A.left&&A.left(),"left-icon":()=>c(o,{name:a.searchIcon,"class":u.leftIcon},null),"right-icon":()=>c(t,{disabled:a.disabled,"class":u.searchBtn,round:!0,type:"primary",size:"mini",onClick:()=>d("search",w.search)},{"default":()=>[n("搜索")]})})}});export{A as O};
|