mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
/*! For license information please see 1487.d8fd89d4.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["1487"],{39025:function(t,e,n){"use strict";n.r(e);let r=n("84804").Z;e.default=r},84804:function(t,e,n){"use strict";var r=n("80681"),o=n("11848"),u=n("89959"),a=n("6918"),l=n("7197"),i=n("54369"),c=n("24647");e.Z=(0,r.aZ)({__name:"index",setup(t){var e=(0,i.q)({"zh-CN":{text:"\u6587\u5B57",route:"\u9875\u9762\u5BFC\u822A",gutter:"\u683C\u5B50\u95F4\u8DDD",square:"\u6B63\u65B9\u5F62\u683C\u5B50",columnNum:"\u81EA\u5B9A\u4E49\u5217\u6570",customContent:"\u81EA\u5B9A\u4E49\u5185\u5BB9",urlRoute:"URL \u8DF3\u8F6C",vueRoute:"\u8DEF\u7531\u8DF3\u8F6C",showBadge:"\u5FBD\u6807\u63D0\u793A",horizontal:"\u5185\u5BB9\u6A2A\u6392"},"en-US":{text:"Text",route:"Route",gutter:"Gutter",square:"Square",columnNum:"Column Num",customContent:"Custom Content",urlRoute:"URL",vueRoute:"Vue Router",showBadge:"Show Badge",horizontal:"Horizontal"}});return(t,n)=>{var i=(0,r.up)("demo-block");return(0,r.wg)(),(0,r.iD)(r.HY,null,[(0,r.Wm)(i,{title:(0,o.SU)(e)("basicUsage")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(u.ZP),null,{default:(0,r.w5)(()=>[((0,r.wg)(),(0,r.iD)(r.HY,null,(0,r.Ko)(4,t=>(0,r.Wm)((0,o.SU)(a.ZP),{key:t,icon:"photo-o",text:(0,o.SU)(e)("text")},null,8,["text"])),64))]),_:1})]),_:1},8,["title"]),(0,r.Wm)(i,{title:(0,o.SU)(e)("columnNum")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(u.ZP),{"column-num":3},{default:(0,r.w5)(()=>[((0,r.wg)(),(0,r.iD)(r.HY,null,(0,r.Ko)(6,t=>(0,r.Wm)((0,o.SU)(a.ZP),{key:t,icon:"photo-o",text:(0,o.SU)(e)("text")},null,8,["text"])),64))]),_:1})]),_:1},8,["title"]),(0,r.Wm)(i,{title:(0,o.SU)(e)("customContent")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(u.ZP),{border:!1,"column-num":3},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(a.ZP),null,{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(l.ZP),{fit:"contain",src:(0,o.SU)(c.RQ)("apple-1.jpeg")},null,8,["src"])]),_:1}),(0,r.Wm)((0,o.SU)(a.ZP),null,{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(l.ZP),{fit:"contain",src:(0,o.SU)(c.RQ)("apple-2.jpeg")},null,8,["src"])]),_:1}),(0,r.Wm)((0,o.SU)(a.ZP),null,{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(l.ZP),{fit:"contain",src:(0,o.SU)(c.RQ)("apple-3.jpeg")},null,8,["src"])]),_:1})]),_:1})]),_:1},8,["title"]),(0,r.Wm)(i,{title:(0,o.SU)(e)("square")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(u.ZP),{square:""},{default:(0,r.w5)(()=>[((0,r.wg)(),(0,r.iD)(r.HY,null,(0,r.Ko)(8,t=>(0,r.Wm)((0,o.SU)(a.ZP),{key:t,icon:"photo-o",text:(0,o.SU)(e)("text")},null,8,["text"])),64))]),_:1})]),_:1},8,["title"]),(0,r.Wm)(i,{title:(0,o.SU)(e)("gutter")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(u.ZP),{gutter:10},{default:(0,r.w5)(()=>[((0,r.wg)(),(0,r.iD)(r.HY,null,(0,r.Ko)(8,t=>(0,r.Wm)((0,o.SU)(a.ZP),{key:t,icon:"photo-o",text:(0,o.SU)(e)("text")},null,8,["text"])),64))]),_:1})]),_:1},8,["title"]),(0,r.Wm)(i,{title:(0,o.SU)(e)("horizontal")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(u.ZP),{direction:"horizontal","column-num":3},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(a.ZP),{icon:"photo-o",text:(0,o.SU)(e)("text")},null,8,["text"]),(0,r.Wm)((0,o.SU)(a.ZP),{icon:"photo-o",text:(0,o.SU)(e)("text")},null,8,["text"]),(0,r.Wm)((0,o.SU)(a.ZP),{icon:"photo-o",text:(0,o.SU)(e)("text")},null,8,["text"])]),_:1})]),_:1},8,["title"]),(0,r.Wm)(i,{title:(0,o.SU)(e)("route")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(u.ZP),{clickable:"","column-num":2},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(a.ZP),{icon:"home-o",text:(0,o.SU)(e)("vueRoute"),to:"/"},null,8,["text"]),(0,r.Wm)((0,o.SU)(a.ZP),{icon:"search",text:(0,o.SU)(e)("urlRoute"),url:"https://github.com/vant-ui/vant"},null,8,["text"])]),_:1})]),_:1},8,["title"]),(0,r.Wm)(i,{title:(0,o.SU)(e)("showBadge")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(u.ZP),{"column-num":2},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(a.ZP),{icon:"home-o",text:(0,o.SU)(e)("text"),dot:""},null,8,["text"]),(0,r.Wm)((0,o.SU)(a.ZP),{icon:"search",text:(0,o.SU)(e)("text"),badge:"99+"},null,8,["text"])]),_:1})]),_:1},8,["title"])],64)}}})},24647:function(t,e,n){"use strict";n.d(e,{RQ:function(){return r}});var r=t=>"https://fastly.jsdelivr.net/npm/@vant/assets/".concat(t)},72555:function(t,e,n){"use strict";n.d(e,{Ct:function(){return u}});var r=n("63112"),o=n("63022"),u=(0,r.n)(o.Z);e.ZP=u},14517:function(t,e,n){"use strict";n.d(e,{H:function(){return u},t:function(){return o}});var r=2e3,o=()=>++r,u=t=>{r=t}},6149:function(t,e,n){"use strict";n.d(e,{BC:function(){return u},g2:function(){return o},yj:function(){return a}}),n("56115"),n("59644");var r=n("80681"),o={to:[String,Object],url:String,replace:Boolean};function u(t){var{to:e,url:n,replace:r,$router:o}=t;e&&o?o[r?"replace":"push"](e):n&&(r?location.replace(n):location.href=n)}function a(){var t=(0,r.FN)().proxy;return()=>u(t)}},6918:function(t,e,n){"use strict";var r=n("63112"),o=n("49605"),u=(0,r.n)(o.Z);e.ZP=u},89959:function(t,e,n){"use strict";var r=n("63112"),o=n("69014"),u=(0,r.n)(o.ZP);e.ZP=u},96528:function(t,e,n){"use strict";n.d(e,{JO:function(){return u}});var r=n("63112"),o=n("28779"),u=(0,r.n)(o.Z);e.ZP=u},7197:function(t,e,n){"use strict";n.d(e,{Ee:function(){return u}});var r=n("63112"),o=n("46858"),u=(0,r.n)(o.Z);e.ZP=u},8051:function(t,e,n){"use strict";n.d(e,{Cp:function(){return m},T5:function(){return r},WN:function(){return f},_K:function(){return i},a8:function(){return u},dt:function(){return a},e9:function(){return d},k7:function(){return o},mH:function(){return v},pj:function(){return s},r5:function(){return c},xe:function(){return l}}),n("86795");var r="van-hairline",o="".concat(r,"--top"),u="".concat(r,"--left"),a="".concat(r,"--right"),l="".concat(r,"--bottom"),i="".concat(r,"--surround"),c="".concat(r,"--top-bottom"),s="".concat(r,"-unset--top-bottom"),d="van-haptics-feedback",f=Symbol("van-form"),m=500,v=5},78335:function(t,e,n){"use strict";n.d(e,{Ce:function(){return l},J5:function(){return u},Or:function(){return o},SI:function(){return c},SQ:function(){return s},Vg:function(){return r},ir:function(){return a},qM:function(){return i}});var r=null,o=[Number,String],u={type:Boolean,default:!0},a=t=>({type:t,required:!0}),l=()=>({type:Array,default:()=>[]}),i=t=>({type:Number,default:t}),c=t=>({type:o,default:t}),s=t=>({type:String,default:t})},63112:function(t,e,n){"use strict";n.d(e,{n:function(){return o}});var r=n("20358");function o(t){return t.install=e=>{var{name:n}=t;n&&(e.component(n,t),e.component((0,r._A)("-".concat(n)),t))},t}},63022:function(t,e,n){"use strict";n("82116"),n("17989"),n("56115"),n("59644"),n("89176");var r=n("80681"),o=n("62568"),u=n("78335"),a=n("12308"),l=n("20358"),[i,c]=(0,o.do)("badge"),s={dot:Boolean,max:u.Or,tag:(0,u.SQ)("div"),color:String,offset:Array,content:u.Or,showZero:u.J5,position:(0,u.SQ)("top-right")};e.Z=(0,r.aZ)({name:i,props:s,setup(t,e){var{slots:n}=e,o=()=>{if(n.content)return!0;var{content:e,showZero:r}=t;return(0,a.Xq)(e)&&""!==e&&(r||0!==e&&"0"!==e)},u=()=>{var{dot:e,max:r,content:u}=t;if(!e&&o())return n.content?n.content():(0,a.Xq)(r)&&(0,a.kE)(u)&&+u>+r?"".concat(r,"+"):u},i=t=>t.startsWith("-")?t.replace("-",""):"-".concat(t),s=(0,r.Fl)(()=>{var e={background:t.color};if(t.offset){var[r,o]=t.offset,{position:u}=t,[a,c]=u.split("-");n.default?("number"==typeof o?e[a]=(0,l.Nn)("top"===a?o:-o):e[a]="top"===a?(0,l.Nn)(o):i(o),"number"==typeof r?e[c]=(0,l.Nn)("left"===c?r:-r):e[c]="left"===c?(0,l.Nn)(r):i(r)):(e.marginTop=(0,l.Nn)(o),e.marginLeft=(0,l.Nn)(r))}return e}),d=()=>{if(o()||t.dot)return(0,r.Wm)("div",{class:c([t.position,{dot:t.dot,fixed:!!n.default}]),style:s.value},[u()])};return()=>{if(n.default){var{tag:e}=t;return(0,r.Wm)(e,{class:c("wrapper")},{default:()=>[n.default(),d()]})}return d()}}})},53419:function(t,e,n){"use strict";n.d(e,{q9:function(){return d}}),n("82116"),n("17989"),n("86795"),n("56115"),n("59644"),n("31564"),n("8649"),n("70629");var r=n("80681"),o=n("62568"),u=n("78335"),a=n("20358"),l=n("12308"),i=n("14517"),[c,s]=(0,o.do)("config-provider"),d=Symbol(c),f={tag:(0,u.SQ)("div"),theme:(0,u.SQ)("light"),zIndex:Number,themeVars:Object,themeVarsDark:Object,themeVarsLight:Object,themeVarsScope:(0,u.SQ)("local"),iconPrefix:String};function m(){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(n=>{t[n]!==e[n]&&document.documentElement.style.setProperty(n,t[n])}),Object.keys(e).forEach(e=>{!t[e]&&document.documentElement.style.removeProperty(e)})}e.ZP=(0,r.aZ)({name:c,props:f,setup(t,e){var{slots:n}=e,o=(0,r.Fl)(()=>{var e,n;return e=(0,l.l7)({},t.themeVars,"dark"===t.theme?t.themeVarsDark:t.themeVarsLight),n={},Object.keys(e).forEach(t=>{var r=(0,a.GL)(t).replace(/([a-zA-Z])(\d)/g,"$1-$2");n["--van-".concat(r)]=e[t]}),n});if(l._f){var u=()=>{document.documentElement.classList.add("van-theme-".concat(t.theme))},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.theme;document.documentElement.classList.remove("van-theme-".concat(e))};(0,r.YP)(()=>t.theme,(t,e)=>{e&&c(e),u()},{immediate:!0}),(0,r.dl)(u),(0,r.se)(c),(0,r.Jd)(c),(0,r.YP)(o,(e,n)=>{"global"===t.themeVarsScope&&m(e,n)}),(0,r.YP)(()=>t.themeVarsScope,(t,e)=>{"global"===e&&m({},o.value),"global"===t&&m(o.value,{})}),"global"===t.themeVarsScope&&m(o.value,{})}return(0,r.JJ)(d,t),(0,r.m0)(()=>{void 0!==t.zIndex&&(0,i.H)(t.zIndex)}),()=>(0,r.Wm)(t.tag,{class:s(),style:"local"===t.themeVarsScope?o.value:void 0},{default:()=>{var t;return[null===(t=n.default)||void 0===t?void 0:t.call(n)]}})}})},49605:function(t,e,n){"use strict";n("82116"),n("17989"),n("58294");var r=n("80681"),o=n("62568"),u=n("12308"),a=n("78335"),l=n("20358"),i=n("8051"),c=n("69014"),s=n("22300"),d=n("6149"),f=n("96528"),m=n("72555"),[v,p]=(0,o.do)("grid-item"),g=(0,u.l7)({},d.g2,{dot:Boolean,text:String,icon:String,badge:a.Or,iconColor:String,iconPrefix:String,badgeProps:Object});e.Z=(0,r.aZ)({name:v,props:g,setup(t,e){var{slots:n}=e,{parent:o,index:u}=(0,s.NB)(c.Sb),a=(0,d.yj)();if(o){var v=(0,r.Fl)(()=>{var{square:t,gutter:e,columnNum:n}=o.props,r="".concat(100/+n,"%"),a={flexBasis:r};if(t)a.paddingTop=r;else if(e){var i=(0,l.Nn)(e);a.paddingRight=i,u.value>=+n&&(a.marginTop=i)}return a}),g=(0,r.Fl)(()=>{var{square:t,gutter:e}=o.props;if(t&&e){var n=(0,l.Nn)(e);return{right:n,bottom:n,height:"auto"}}}),S=()=>n.icon?(0,r.Wm)(m.Ct,(0,r.dG)({dot:t.dot,content:t.badge},t.badgeProps),{default:n.icon}):t.icon?(0,r.Wm)(f.JO,{dot:t.dot,name:t.icon,size:o.props.iconSize,badge:t.badge,class:p("icon"),color:t.iconColor,badgeProps:t.badgeProps,classPrefix:t.iconPrefix},null):void 0,h=()=>n.text?n.text():t.text?(0,r.Wm)("span",{class:p("text")},[t.text]):void 0,b=()=>n.default?n.default():[S(),h()];return()=>{var{center:t,border:e,square:n,gutter:u,reverse:l,direction:c,clickable:s}=o.props,d=[p("content",[c,{center:t,square:n,reverse:l,clickable:s,surround:e&&u}]),{[i.T5]:e}];return(0,r.Wm)("div",{class:[p({square:n})],style:v.value},[(0,r.Wm)("div",{role:s?"button":void 0,class:d,style:g.value,tabindex:s?0:void 0,onClick:a},[b()])])}}}})},69014:function(t,e,n){"use strict";n.d(e,{Sb:function(){return f}}),n("82116"),n("17989"),n("86795");var r=n("80681"),o=n("62568"),u=n("78335"),a=n("20358"),l=n("8051"),i=n("22300"),[c,s]=(0,o.do)("grid"),d={square:Boolean,center:u.J5,border:u.J5,gutter:u.Or,reverse:Boolean,iconSize:u.Or,direction:String,clickable:Boolean,columnNum:(0,u.SI)(4)},f=Symbol(c);e.ZP=(0,r.aZ)({name:c,props:d,setup(t,e){var{slots:n}=e,{linkChildren:o}=(0,i.$E)(f);return o({props:t}),()=>{var e;return(0,r.Wm)("div",{style:{paddingLeft:(0,a.Nn)(t.gutter)},class:[s(),{[l.k7]:t.border&&!t.gutter}]},[null===(e=n.default)||void 0===e?void 0:e.call(n)])}}})},28779:function(t,e,n){"use strict";n("82116"),n("17989"),n("24660");var r=n("80681"),o=n("62568"),u=n("78335"),a=n("20358"),l=n("72555"),i=n("53419"),[c,s]=(0,o.do)("icon"),d=t=>null==t?void 0:t.includes("/"),f={dot:Boolean,tag:(0,u.SQ)("i"),name:String,size:u.Or,badge:u.Or,color:String,badgeProps:Object,classPrefix:String};e.Z=(0,r.aZ)({name:c,props:f,setup(t,e){var{slots:n}=e,o=(0,r.f3)(i.q9,null),u=(0,r.Fl)(()=>t.classPrefix||(null==o?void 0:o.iconPrefix)||s());return()=>{var{tag:e,dot:o,name:i,size:c,badge:f,color:m}=t,v=d(i);return(0,r.Wm)(l.Ct,(0,r.dG)({dot:o,tag:e,class:[u.value,v?"":"".concat(u.value,"-").concat(i)],style:{color:m,fontSize:(0,a.Nn)(c)},content:f},t.badgeProps),{default:()=>{var t;return[null===(t=n.default)||void 0===t?void 0:t.call(n),v&&(0,r.Wm)("img",{class:s("image"),src:i},null)]}})}}})},46858:function(t,e,n){"use strict";n("82116"),n("17989");var r=n("80681"),o=n("11848"),u=n("62568"),a=n("78335"),l=n("20358"),i=n("12308"),c=n("96528"),[s,d]=(0,u.do)("image"),f={src:String,alt:String,fit:String,position:String,round:Boolean,block:Boolean,width:a.Or,height:a.Or,radius:a.Or,lazyLoad:Boolean,iconSize:a.Or,showError:a.J5,errorIcon:(0,a.SQ)("photo-fail"),iconPrefix:String,showLoading:a.J5,loadingIcon:(0,a.SQ)("photo"),crossorigin:String,referrerpolicy:String};e.Z=(0,r.aZ)({name:s,props:f,emits:["load","error"],setup(t,e){var{emit:n,slots:u}=e,a=(0,o.iH)(!1),s=(0,o.iH)(!0),f=(0,o.iH)(),{$Lazyload:m}=(0,r.FN)().proxy,v=(0,r.Fl)(()=>{var e={width:(0,l.Nn)(t.width),height:(0,l.Nn)(t.height)};return(0,i.Xq)(t.radius)&&(e.overflow="hidden",e.borderRadius=(0,l.Nn)(t.radius)),e});(0,r.YP)(()=>t.src,()=>{a.value=!1,s.value=!0});var p=t=>{s.value&&(s.value=!1,n("load",t))},g=()=>{var t=new Event("load");Object.defineProperty(t,"target",{value:f.value,enumerable:!0}),p(t)},S=t=>{a.value=!0,s.value=!1,n("error",t)},h=(e,n,o)=>o?o():(0,r.Wm)(c.JO,{name:e,size:t.iconSize,class:n,classPrefix:t.iconPrefix},null),b=()=>s.value&&t.showLoading?(0,r.Wm)("div",{class:d("loading")},[h(t.loadingIcon,d("loading-icon"),u.loading)]):a.value&&t.showError?(0,r.Wm)("div",{class:d("error")},[h(t.errorIcon,d("error-icon"),u.error)]):void 0,x=()=>{if(!a.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,r.wy)((0,r.Wm)("img",(0,r.dG)({ref:f},e),null),[[(0,r.Q2)("lazy"),t.src]]):(0,r.Wm)("img",(0,r.dG)({ref:f,src:t.src,onLoad:p,onError:S},e),null)}},P=t=>{var{el:e}=t,n=()=>{e===f.value&&s.value&&g()};f.value?n():(0,r.Y3)(n)},W=t=>{var{el:e}=t;e===f.value&&!a.value&&S()};return m&&i._f&&(m.$on("loaded",P),m.$on("error",W),(0,r.Jd)(()=>{m.$off("loaded",P),m.$off("error",W)})),(0,r.bv)(()=>{(0,r.Y3)(()=>{var e;(null===(e=f.value)||void 0===e?void 0:e.complete)&&!t.lazyLoad&&g()})}),()=>{var e;return(0,r.Wm)("div",{class:d({round:t.round,block:t.block}),style:v.value},[x(),b(),null===(e=u.default)||void 0===e?void 0:e.call(u)])}}})}}]); |