mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
15 KiB
JavaScript
2 lines
15 KiB
JavaScript
/*! For license information please see 5109.af412890.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["5109"],{17662:function(t,e,r){"use strict";r.r(e);var n=r("51637");r("29834");let a=n.Z;e.default=a},51637:function(t,e,r){"use strict";var n=r("80681"),a=r("11848"),o=r("57122"),i=r("23483"),l=r("7197"),u=r("19294"),s=r("95786"),c=r("54369"),d=r("24647"),f={class:"text"},v=(0,n._)("div",{class:"text"},"cover",-1),p={class:"text"},m=(0,n._)("div",{class:"text"},"contain",-1),g={class:"text"},h={class:"text"},S={class:"text"},w={class:"text"},y={class:"text"},Z={class:"text"};e.Z=(0,n.aZ)({__name:"index",setup(t){var e=(0,c.q)({"zh-CN":{fitMode:"\u586B\u5145\u6A21\u5F0F",position:"\u56FE\u7247\u4F4D\u7F6E",round:"\u5706\u5F62\u56FE\u7247",loading:"\u52A0\u8F7D\u4E2D\u63D0\u793A",error:"\u52A0\u8F7D\u5931\u8D25\u63D0\u793A",defaultTip:"\u9ED8\u8BA4\u63D0\u793A",customTip:"\u81EA\u5B9A\u4E49\u63D0\u793A",loadFail:"\u52A0\u8F7D\u5931\u8D25"},"en-US":{fitMode:"Fit Mode",position:"Position",round:"Round",loading:"Loading",error:"Error",defaultTip:"Default Tip",customTip:"Custom Tip",loadFail:"Load failed"}}),r=(0,d.RQ)("cat.jpeg"),P=["contain","cover","fill","none","scale-down"],W=["left","center","right"],b=["top","center","bottom"];return(t,c)=>{var d=(0,n.up)("demo-block");return(0,n.wg)(),(0,n.iD)(n.HY,null,[(0,n.Wm)(d,{title:(0,a.SU)(e)("basicUsage")},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(i.ZP),null,{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(l.ZP),{width:"100",height:"100",src:(0,a.SU)(r)},null,8,["src"])]),_:1})]),_:1},8,["title"]),(0,n.Wm)(d,{title:(0,a.SU)(e)("fitMode")},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(i.ZP),{gutter:"20"},{default:(0,n.w5)(()=>[((0,n.wg)(),(0,n.iD)(n.HY,null,(0,n.Ko)(P,t=>(0,n.Wm)((0,a.SU)(u.ZP),{span:"8",key:t},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(l.ZP),{fit:t,width:"100%",height:"27vw",src:(0,a.SU)(r)},null,8,["fit","src"]),(0,n._)("div",f,(0,o.zw)(t),1)]),_:2},1024)),64))]),_:1})]),_:1},8,["title"]),(0,n.Wm)(d,{title:(0,a.SU)(e)("position")},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(i.ZP),{gutter:"20"},{default:(0,n.w5)(()=>[((0,n.wg)(),(0,n.iD)(n.HY,null,(0,n.Ko)(W,t=>(0,n.Wm)((0,a.SU)(u.ZP),{span:"8",key:t},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(l.ZP),{position:t,width:"100%",height:"27vw",fit:"cover",src:(0,a.SU)(r)},null,8,["position","src"]),v,(0,n._)("div",p,(0,o.zw)(t),1)]),_:2},1024)),64)),((0,n.wg)(),(0,n.iD)(n.HY,null,(0,n.Ko)(b,t=>(0,n.Wm)((0,a.SU)(u.ZP),{span:"8",key:t},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(l.ZP),{position:t,width:"100%",height:"27vw",fit:"contain",src:(0,a.SU)(r)},null,8,["position","src"]),m,(0,n._)("div",g,(0,o.zw)(t),1)]),_:2},1024)),64))]),_:1})]),_:1},8,["title"]),(0,n.Wm)(d,{title:(0,a.SU)(e)("round")},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(i.ZP),{gutter:"20"},{default:(0,n.w5)(()=>[((0,n.wg)(),(0,n.iD)(n.HY,null,(0,n.Ko)(P,t=>(0,n.Wm)((0,a.SU)(u.ZP),{span:"8",key:t},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(l.ZP),{round:"",fit:t,width:"100%",height:"27vw",src:(0,a.SU)(r)},null,8,["fit","src"]),(0,n._)("div",h,(0,o.zw)(t),1)]),_:2},1024)),64))]),_:1})]),_:1},8,["title"]),(0,n.Wm)(d,{title:(0,a.SU)(e)("loading")},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(i.ZP),{gutter:"20"},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(u.ZP),{span:"8"},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(l.ZP),{width:"100%",height:"27vw"}),(0,n._)("div",S,(0,o.zw)((0,a.SU)(e)("defaultTip")),1)]),_:1}),(0,n.Wm)((0,a.SU)(u.ZP),{span:"8"},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(l.ZP),{width:"100%",height:"27vw"},{loading:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(s.ZP),{type:"spinner",size:"20"})]),_:1}),(0,n._)("div",w,(0,o.zw)((0,a.SU)(e)("customTip")),1)]),_:1})]),_:1})]),_:1},8,["title"]),(0,n.Wm)(d,{title:(0,a.SU)(e)("error")},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(i.ZP),{gutter:"20"},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(u.ZP),{span:"8"},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(l.ZP),{width:"100%",height:"27vw",src:"http://x"}),(0,n._)("div",y,(0,o.zw)((0,a.SU)(e)("defaultTip")),1)]),_:1}),(0,n.Wm)((0,a.SU)(u.ZP),{span:"8"},{default:(0,n.w5)(()=>[(0,n.Wm)((0,a.SU)(l.ZP),{width:"100%",height:"27vw",src:"http://x"},{error:(0,n.w5)(()=>[(0,n.Uk)((0,o.zw)((0,a.SU)(e)("loadFail")),1)]),_:1}),(0,n._)("div",Z,(0,o.zw)((0,a.SU)(e)("customTip")),1)]),_:1})]),_:1})]),_:1},8,["title"])],64)}}})},24647:function(t,e,r){"use strict";r.d(e,{RQ:function(){return n}});var n=t=>"https://fastly.jsdelivr.net/npm/@vant/assets/".concat(t)},72555:function(t,e,r){"use strict";r.d(e,{Ct:function(){return o}});var n=r("63112"),a=r("63022"),o=(0,n.n)(a.Z);e.ZP=o},19294:function(t,e,r){"use strict";var n=r("63112"),a=r("24657"),o=(0,n.n)(a.C);e.ZP=o},14517:function(t,e,r){"use strict";r.d(e,{H:function(){return o},t:function(){return a}});var n=2e3,a=()=>++n,o=t=>{n=t}},96528:function(t,e,r){"use strict";r.d(e,{JO:function(){return o}});var n=r("63112"),a=r("28779"),o=(0,n.n)(a.Z);e.ZP=o},7197:function(t,e,r){"use strict";r.d(e,{Ee:function(){return o}});var n=r("63112"),a=r("46858"),o=(0,n.n)(a.Z);e.ZP=o},95786:function(t,e,r){"use strict";r.d(e,{gb:function(){return o}});var n=r("63112"),a=r("2309"),o=(0,n.n)(a.Z);e.ZP=o},23483:function(t,e,r){"use strict";var n=r("63112"),a=r("66125"),o=(0,n.n)(a.ZP);e.ZP=o},78335:function(t,e,r){"use strict";r.d(e,{Ce:function(){return l},J5:function(){return o},Or:function(){return a},SI:function(){return s},SQ:function(){return c},Vg:function(){return n},ir:function(){return i},qM:function(){return u}});var n=null,a=[Number,String],o={type:Boolean,default:!0},i=t=>({type:t,required:!0}),l=()=>({type:Array,default:()=>[]}),u=t=>({type:Number,default:t}),s=t=>({type:a,default:t}),c=t=>({type:String,default:t})},63112:function(t,e,r){"use strict";r.d(e,{n:function(){return a}});var n=r("20358");function a(t){return t.install=e=>{var{name:r}=t;r&&(e.component(r,t),e.component((0,n._A)("-".concat(r)),t))},t}},63022:function(t,e,r){"use strict";r("82116"),r("17989"),r("56115"),r("59644"),r("89176");var n=r("80681"),a=r("62568"),o=r("78335"),i=r("12308"),l=r("20358"),[u,s]=(0,a.do)("badge"),c={dot:Boolean,max:o.Or,tag:(0,o.SQ)("div"),color:String,offset:Array,content:o.Or,showZero:o.J5,position:(0,o.SQ)("top-right")};e.Z=(0,n.aZ)({name:u,props:c,setup(t,e){var{slots:r}=e,a=()=>{if(r.content)return!0;var{content:e,showZero:n}=t;return(0,i.Xq)(e)&&""!==e&&(n||0!==e&&"0"!==e)},o=()=>{var{dot:e,max:n,content:o}=t;if(!e&&a())return r.content?r.content():(0,i.Xq)(n)&&(0,i.kE)(o)&&+o>+n?"".concat(n,"+"):o},u=t=>t.startsWith("-")?t.replace("-",""):"-".concat(t),c=(0,n.Fl)(()=>{var e={background:t.color};if(t.offset){var[n,a]=t.offset,{position:o}=t,[i,s]=o.split("-");r.default?("number"==typeof a?e[i]=(0,l.Nn)("top"===i?a:-a):e[i]="top"===i?(0,l.Nn)(a):u(a),"number"==typeof n?e[s]=(0,l.Nn)("left"===s?n:-n):e[s]="left"===s?(0,l.Nn)(n):u(n)):(e.marginTop=(0,l.Nn)(a),e.marginLeft=(0,l.Nn)(n))}return e}),d=()=>{if(a()||t.dot)return(0,n.Wm)("div",{class:s([t.position,{dot:t.dot,fixed:!!r.default}]),style:c.value},[o()])};return()=>{if(r.default){var{tag:e}=t;return(0,n.Wm)(e,{class:s("wrapper")},{default:()=>[r.default(),d()]})}return d()}}})},24657:function(t,e,r){"use strict";r("82116"),r("17989");var n=r("80681"),a=r("62568"),o=r("78335"),i=r("12308"),l=r("22300"),u=r("66125"),[s,c]=(0,a.do)("col"),d={tag:(0,o.SQ)("div"),span:(0,o.SI)(0),offset:o.Or};e.C=(0,n.aZ)({name:s,props:d,setup(t,e){var{slots:r}=e,{parent:a,index:o}=(0,l.NB)(u.oA),s=(0,n.Fl)(()=>{if(a){var{spaces:t,verticalSpaces:e}=a,r={};if(t&&t.value&&t.value[o.value]){var{left:n,right:l}=t.value[o.value];r={paddingLeft:n?"".concat(n,"px"):null,paddingRight:l?"".concat(l,"px"):null}}var{bottom:u}=e.value[o.value]||{};return(0,i.l7)(r,{marginBottom:u?"".concat(u,"px"):null})}});return()=>{var{tag:e,span:a,offset:o}=t;return(0,n.Wm)(e,{style:s.value,class:c({[a]:a,["offset-".concat(o)]:o})},{default:()=>{var t;return[null===(t=r.default)||void 0===t?void 0:t.call(r)]}})}}})},53419:function(t,e,r){"use strict";r.d(e,{q9:function(){return d}}),r("82116"),r("17989"),r("86795"),r("56115"),r("59644"),r("31564"),r("8649"),r("70629");var n=r("80681"),a=r("62568"),o=r("78335"),i=r("20358"),l=r("12308"),u=r("14517"),[s,c]=(0,a.do)("config-provider"),d=Symbol(s),f={tag:(0,o.SQ)("div"),theme:(0,o.SQ)("light"),zIndex:Number,themeVars:Object,themeVarsDark:Object,themeVarsLight:Object,themeVarsScope:(0,o.SQ)("local"),iconPrefix:String};function v(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach(r=>{t[r]!==e[r]&&document.documentElement.style.setProperty(r,t[r])}),Object.keys(e).forEach(e=>{!t[e]&&document.documentElement.style.removeProperty(e)})}e.ZP=(0,n.aZ)({name:s,props:f,setup(t,e){var{slots:r}=e,a=(0,n.Fl)(()=>{var e,r;return e=(0,l.l7)({},t.themeVars,"dark"===t.theme?t.themeVarsDark:t.themeVarsLight),r={},Object.keys(e).forEach(t=>{var n=(0,i.GL)(t).replace(/([a-zA-Z])(\d)/g,"$1-$2");r["--van-".concat(n)]=e[t]}),r});if(l._f){var o=()=>{document.documentElement.classList.add("van-theme-".concat(t.theme))},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.theme;document.documentElement.classList.remove("van-theme-".concat(e))};(0,n.YP)(()=>t.theme,(t,e)=>{e&&s(e),o()},{immediate:!0}),(0,n.dl)(o),(0,n.se)(s),(0,n.Jd)(s),(0,n.YP)(a,(e,r)=>{"global"===t.themeVarsScope&&v(e,r)}),(0,n.YP)(()=>t.themeVarsScope,(t,e)=>{"global"===e&&v({},a.value),"global"===t&&v(a.value,{})}),"global"===t.themeVarsScope&&v(a.value,{})}return(0,n.JJ)(d,t),(0,n.m0)(()=>{void 0!==t.zIndex&&(0,u.H)(t.zIndex)}),()=>(0,n.Wm)(t.tag,{class:c(),style:"local"===t.themeVarsScope?a.value:void 0},{default:()=>{var t;return[null===(t=r.default)||void 0===t?void 0:t.call(r)]}})}})},28779:function(t,e,r){"use strict";r("82116"),r("17989"),r("24660");var n=r("80681"),a=r("62568"),o=r("78335"),i=r("20358"),l=r("72555"),u=r("53419"),[s,c]=(0,a.do)("icon"),d=t=>null==t?void 0:t.includes("/"),f={dot:Boolean,tag:(0,o.SQ)("i"),name:String,size:o.Or,badge:o.Or,color:String,badgeProps:Object,classPrefix:String};e.Z=(0,n.aZ)({name:s,props:f,setup(t,e){var{slots:r}=e,a=(0,n.f3)(u.q9,null),o=(0,n.Fl)(()=>t.classPrefix||(null==a?void 0:a.iconPrefix)||c());return()=>{var{tag:e,dot:a,name:u,size:s,badge:f,color:v}=t,p=d(u);return(0,n.Wm)(l.Ct,(0,n.dG)({dot:a,tag:e,class:[o.value,p?"":"".concat(o.value,"-").concat(u)],style:{color:v,fontSize:(0,i.Nn)(s)},content:f},t.badgeProps),{default:()=>{var t;return[null===(t=r.default)||void 0===t?void 0:t.call(r),p&&(0,n.Wm)("img",{class:c("image"),src:u},null)]}})}}})},46858:function(t,e,r){"use strict";r("82116"),r("17989");var n=r("80681"),a=r("11848"),o=r("62568"),i=r("78335"),l=r("20358"),u=r("12308"),s=r("96528"),[c,d]=(0,o.do)("image"),f={src:String,alt:String,fit:String,position:String,round:Boolean,block:Boolean,width:i.Or,height:i.Or,radius:i.Or,lazyLoad:Boolean,iconSize:i.Or,showError:i.J5,errorIcon:(0,i.SQ)("photo-fail"),iconPrefix:String,showLoading:i.J5,loadingIcon:(0,i.SQ)("photo"),crossorigin:String,referrerpolicy:String};e.Z=(0,n.aZ)({name:c,props:f,emits:["load","error"],setup(t,e){var{emit:r,slots:o}=e,i=(0,a.iH)(!1),c=(0,a.iH)(!0),f=(0,a.iH)(),{$Lazyload:v}=(0,n.FN)().proxy,p=(0,n.Fl)(()=>{var e={width:(0,l.Nn)(t.width),height:(0,l.Nn)(t.height)};return(0,u.Xq)(t.radius)&&(e.overflow="hidden",e.borderRadius=(0,l.Nn)(t.radius)),e});(0,n.YP)(()=>t.src,()=>{i.value=!1,c.value=!0});var m=t=>{c.value&&(c.value=!1,r("load",t))},g=()=>{var t=new Event("load");Object.defineProperty(t,"target",{value:f.value,enumerable:!0}),m(t)},h=t=>{i.value=!0,c.value=!1,r("error",t)},S=(e,r,a)=>a?a():(0,n.Wm)(s.JO,{name:e,size:t.iconSize,class:r,classPrefix:t.iconPrefix},null),w=()=>c.value&&t.showLoading?(0,n.Wm)("div",{class:d("loading")},[S(t.loadingIcon,d("loading-icon"),o.loading)]):i.value&&t.showError?(0,n.Wm)("div",{class:d("error")},[S(t.errorIcon,d("error-icon"),o.error)]):void 0,y=()=>{if(!i.value&&t.src){var e={alt:t.alt,class:d("img"),style:{objectFit:t.fit,objectPosition:t.position},crossorigin:t.crossorigin,referrerpolicy:t.referrerpolicy};return t.lazyLoad?(0,n.wy)((0,n.Wm)("img",(0,n.dG)({ref:f},e),null),[[(0,n.Q2)("lazy"),t.src]]):(0,n.Wm)("img",(0,n.dG)({ref:f,src:t.src,onLoad:m,onError:h},e),null)}},Z=t=>{var{el:e}=t,r=()=>{e===f.value&&c.value&&g()};f.value?r():(0,n.Y3)(r)},P=t=>{var{el:e}=t;e===f.value&&!i.value&&h()};return v&&u._f&&(v.$on("loaded",Z),v.$on("error",P),(0,n.Jd)(()=>{v.$off("loaded",Z),v.$off("error",P)})),(0,n.bv)(()=>{(0,n.Y3)(()=>{var e;(null===(e=f.value)||void 0===e?void 0:e.complete)&&!t.lazyLoad&&g()})}),()=>{var e;return(0,n.Wm)("div",{class:d({round:t.round,block:t.block}),style:p.value},[y(),w(),null===(e=o.default)||void 0===e?void 0:e.call(o)])}}})},2309:function(t,e,r){"use strict";r("82116"),r("17989"),r("66786"),r("14529");var n=r("80681"),a=r("62568"),o=r("78335"),i=r("12308"),l=r("20358"),[u,s]=(0,a.do)("loading"),c=Array(12).fill(null).map((t,e)=>(0,n.Wm)("i",{class:s("line",String(e+1))},null)),d=(0,n.Wm)("svg",{class:s("circular"),viewBox:"25 25 50 50"},[(0,n.Wm)("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),f={size:o.Or,type:(0,o.SQ)("circular"),color:String,vertical:Boolean,textSize:o.Or,textColor:String};e.Z=(0,n.aZ)({name:u,props:f,setup(t,e){var{slots:r}=e,a=(0,n.Fl)(()=>(0,i.l7)({color:t.color},(0,l.Xn)(t.size))),o=()=>{var e="spinner"===t.type?c:d;return(0,n.Wm)("span",{class:s("spinner",t.type),style:a.value},[r.icon?r.icon():e])},u=()=>{if(r.default){var e;return(0,n.Wm)("span",{class:s("text"),style:{fontSize:(0,l.Nn)(t.textSize),color:null!==(e=t.textColor)&&void 0!==e?e:t.color}},[r.default()])}};return()=>{var{type:e,vertical:r}=t;return(0,n.Wm)("div",{class:s([e,{vertical:r}]),"aria-live":"polite","aria-busy":!0},[o(),u()])}}})},66125:function(t,e,r){"use strict";r.d(e,{oA:function(){return s}}),r("82116"),r("17989"),r("86795"),r("31564"),r("8649"),r("70629"),r("61557");var n=r("80681"),a=r("62568"),o=r("78335"),i=r("22300"),[l,u]=(0,a.do)("row"),s=Symbol(l),c={tag:(0,o.SQ)("div"),wrap:o.J5,align:String,gutter:{type:[String,Number,Array],default:0},justify:String};e.ZP=(0,n.aZ)({name:l,props:c,setup(t,e){var{slots:r}=e,{children:a,linkChildren:o}=(0,i.$E)(s),l=(0,n.Fl)(()=>{var t=[[]],e=0;return a.forEach((r,n)=>{(e+=Number(r.span))>24?(t.push([n]),e-=24):t[t.length-1].push(n)}),t}),c=(0,n.Fl)(()=>{var e=0;e=Array.isArray(t.gutter)?Number(t.gutter[0])||0:Number(t.gutter);var r=[];return e?(l.value.forEach(t=>{var n=e*(t.length-1)/t.length;t.forEach((t,a)=>{if(0===a)r.push({right:n});else{var o=e-r[t-1].right;r.push({left:o,right:n-o})}})}),r):r});return o({spaces:c,verticalSpaces:(0,n.Fl)(()=>{var{gutter:e}=t,r=[];if(Array.isArray(e)&&e.length>1){var n=Number(e[1])||0;if(n<=0)return r;l.value.forEach((t,e)=>{e!==l.value.length-1&&t.forEach(()=>{r.push({bottom:n})})})}return r})}),()=>{var{tag:e,wrap:a,align:o,justify:i}=t;return(0,n.Wm)(e,{class:u({["align-".concat(o)]:o,["justify-".concat(i)]:i,nowrap:!a})},{default:()=>{var t;return[null===(t=r.default)||void 0===t?void 0:t.call(r)]}})}}})},29834:function(t,e,r){"use strict";r.r(t.exports={})},68147:function(t,e,r){"use strict";r.r(t.exports={})}}]); |