mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
/*! For license information please see 9070.473fa34b.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["9070"],{5234:function(t,e,n){"use strict";n.r(e);var r=n("72994");n("91938");let a=r.Z;e.default=a},72994:function(t,e,n){"use strict";var r=n("80681"),a=n("11848"),o=n("57122"),l=n("83115"),i=n("53963"),u=n("13627"),s=n("41936"),c=n("54369"),d=n("24647"),v={class:"demo-preview"},f=["src"],m={class:"demo-content"},p={style:{display:"flex",width:"100%"}},h={style:{flex:1,marginLeft:"16px"}};e.Z=(0,r.aZ)({__name:"index",setup(t){var e=(0,c.q)({"zh-CN":{showAvatar:"\u663E\u793A\u5934\u50CF",showChildren:"\u663E\u793A\u5B50\u7EC4\u4EF6",title:"\u5173\u4E8E Vant",desc:"Vant \u662F\u4E00\u5957\u8F7B\u91CF\u3001\u53EF\u5B9A\u5236\u7684\u79FB\u52A8\u7AEF Vue \u7EC4\u4EF6\u5E93\uFF0C\u63D0\u4F9B\u4E86\u4E30\u5BCC\u7684\u57FA\u7840\u7EC4\u4EF6\u548C\u4E1A\u52A1\u7EC4\u4EF6\uFF0C\u5E2E\u52A9\u5F00\u53D1\u8005\u5FEB\u901F\u642D\u5EFA\u79FB\u52A8\u5E94\u7528\u3002",customContent:"\u81EA\u5B9A\u4E49\u5C55\u793A\u5185\u5BB9"},"en-US":{showAvatar:"Show Avatar",showChildren:"Show Children",title:"About Vant",desc:"Vant is a set of Mobile UI Components built on Vue.",customContent:"Custom Content"}}),n=(0,a.iH)(!1);return(t,c)=>{var g=(0,r.up)("demo-block");return(0,r.wg)(),(0,r.iD)(r.HY,null,[(0,r.Wm)(g,{title:(0,a.SU)(e)("basicUsage")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(l.ZP),{title:"",row:3})]),_:1},8,["title"]),(0,r.Wm)(g,{title:(0,a.SU)(e)("showAvatar")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(l.ZP),{title:"",avatar:"",row:3})]),_:1},8,["title"]),(0,r.Wm)(g,{title:(0,a.SU)(e)("showChildren")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(s.ZP),{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=t=>n.value=t)},null,8,["modelValue"]),(0,r.Wm)((0,a.SU)(l.ZP),{title:"",avatar:"",row:3,loading:!n.value},{default:(0,r.w5)(()=>[(0,r._)("div",v,[(0,r._)("img",{src:(0,a.SU)(d.RQ)("logo.png")},null,8,f),(0,r._)("div",m,[(0,r._)("h3",null,(0,o.zw)((0,a.SU)(e)("title")),1),(0,r._)("p",null,(0,o.zw)((0,a.SU)(e)("desc")),1)])])]),_:1},8,["loading"])]),_:1},8,["title"]),(0,r.Wm)(g,{title:(0,a.SU)(e)("customContent")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(l.ZP),null,{template:(0,r.w5)(()=>[(0,r._)("div",p,[(0,r.Wm)((0,a.SU)(i.MD)),(0,r._)("div",h,[(0,r.Wm)((0,a.SU)(u.Bp),{"row-width":"60%"}),(0,r.Wm)((0,a.SU)(u.Bp)),(0,r.Wm)((0,a.SU)(u.Bp)),(0,r.Wm)((0,a.SU)(u.Bp))])])]),_: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 o}});var r=n("63112"),a=n("63022"),o=(0,r.n)(a.Z);e.ZP=o},14517:function(t,e,n){"use strict";n.d(e,{H:function(){return o},t:function(){return a}});var r=2e3,a=()=>++r,o=t=>{r=t}},96528:function(t,e,n){"use strict";n.d(e,{JO:function(){return o}});var r=n("63112"),a=n("28779"),o=(0,r.n)(a.Z);e.ZP=o},95786:function(t,e,n){"use strict";n.d(e,{gb:function(){return o}});var r=n("63112"),a=n("2309"),o=(0,r.n)(a.Z);e.ZP=o},49948:function(t,e,n){"use strict";var r=n("63112"),a=n("50499"),o=(0,r.n)(a.Z);e.ZP=o},53963:function(t,e,n){"use strict";n.d(e,{MD:function(){return a}});var r=n("13777"),a=(0,n("63112").n)(r.Z)},13627:function(t,e,n){"use strict";n.d(e,{Bp:function(){return a}});var r=n("83430"),a=(0,n("63112").n)(r.ZP);e.ZP=a},6530:function(t,e,n){"use strict";var r=n("64759"),a=(0,n("63112").n)(r.Z);e.ZP=a},83115:function(t,e,n){"use strict";var r=n("17463"),a=(0,n("63112").n)(r.Z);e.ZP=a},41936:function(t,e,n){"use strict";n.d(e,{rs:function(){return o}});var r=n("63112"),a=n("79960"),o=(0,r.n)(a.Z);e.ZP=o},78335:function(t,e,n){"use strict";n.d(e,{Ce:function(){return i},J5:function(){return o},Or:function(){return a},SI:function(){return s},SQ:function(){return c},Vg:function(){return r},ir:function(){return l},qM:function(){return u}});var r=null,a=[Number,String],o={type:Boolean,default:!0},l=t=>({type:t,required:!0}),i=()=>({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,n){"use strict";n.d(e,{n:function(){return a}});var r=n("20358");function a(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"),a=n("62568"),o=n("78335"),l=n("12308"),i=n("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,r.aZ)({name:u,props:c,setup(t,e){var{slots:n}=e,a=()=>{if(n.content)return!0;var{content:e,showZero:r}=t;return(0,l.Xq)(e)&&""!==e&&(r||0!==e&&"0"!==e)},o=()=>{var{dot:e,max:r,content:o}=t;if(!e&&a())return n.content?n.content():(0,l.Xq)(r)&&(0,l.kE)(o)&&+o>+r?"".concat(r,"+"):o},u=t=>t.startsWith("-")?t.replace("-",""):"-".concat(t),c=(0,r.Fl)(()=>{var e={background:t.color};if(t.offset){var[r,a]=t.offset,{position:o}=t,[l,s]=o.split("-");n.default?("number"==typeof a?e[l]=(0,i.Nn)("top"===l?a:-a):e[l]="top"===l?(0,i.Nn)(a):u(a),"number"==typeof r?e[s]=(0,i.Nn)("left"===s?r:-r):e[s]="left"===s?(0,i.Nn)(r):u(r)):(e.marginTop=(0,i.Nn)(a),e.marginLeft=(0,i.Nn)(r))}return e}),d=()=>{if(a()||t.dot)return(0,r.Wm)("div",{class:s([t.position,{dot:t.dot,fixed:!!n.default}]),style:c.value},[o()])};return()=>{if(n.default){var{tag:e}=t;return(0,r.Wm)(e,{class:s("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"),a=n("62568"),o=n("78335"),l=n("20358"),i=n("12308"),u=n("14517"),[s,c]=(0,a.do)("config-provider"),d=Symbol(s),v={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 f(){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:s,props:v,setup(t,e){var{slots:n}=e,a=(0,r.Fl)(()=>{var e,n;return e=(0,i.l7)({},t.themeVars,"dark"===t.theme?t.themeVarsDark:t.themeVarsLight),n={},Object.keys(e).forEach(t=>{var r=(0,l.GL)(t).replace(/([a-zA-Z])(\d)/g,"$1-$2");n["--van-".concat(r)]=e[t]}),n});if(i._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,r.YP)(()=>t.theme,(t,e)=>{e&&s(e),o()},{immediate:!0}),(0,r.dl)(o),(0,r.se)(s),(0,r.Jd)(s),(0,r.YP)(a,(e,n)=>{"global"===t.themeVarsScope&&f(e,n)}),(0,r.YP)(()=>t.themeVarsScope,(t,e)=>{"global"===e&&f({},a.value),"global"===t&&f(a.value,{})}),"global"===t.themeVarsScope&&f(a.value,{})}return(0,r.JJ)(d,t),(0,r.m0)(()=>{void 0!==t.zIndex&&(0,u.H)(t.zIndex)}),()=>(0,r.Wm)(t.tag,{class:c(),style:"local"===t.themeVarsScope?a.value:void 0},{default:()=>{var t;return[null===(t=n.default)||void 0===t?void 0:t.call(n)]}})}})},28779:function(t,e,n){"use strict";n("82116"),n("17989"),n("24660");var r=n("80681"),a=n("62568"),o=n("78335"),l=n("20358"),i=n("72555"),u=n("53419"),[s,c]=(0,a.do)("icon"),d=t=>null==t?void 0:t.includes("/"),v={dot:Boolean,tag:(0,o.SQ)("i"),name:String,size:o.Or,badge:o.Or,color:String,badgeProps:Object,classPrefix:String};e.Z=(0,r.aZ)({name:s,props:v,setup(t,e){var{slots:n}=e,a=(0,r.f3)(u.q9,null),o=(0,r.Fl)(()=>t.classPrefix||(null==a?void 0:a.iconPrefix)||c());return()=>{var{tag:e,dot:a,name:u,size:s,badge:v,color:f}=t,m=d(u);return(0,r.Wm)(i.Ct,(0,r.dG)({dot:a,tag:e,class:[o.value,m?"":"".concat(o.value,"-").concat(u)],style:{color:f,fontSize:(0,l.Nn)(s)},content:v},t.badgeProps),{default:()=>{var t;return[null===(t=n.default)||void 0===t?void 0:t.call(n),m&&(0,r.Wm)("img",{class:c("image"),src:u},null)]}})}}})},2309:function(t,e,n){"use strict";n("82116"),n("17989"),n("66786"),n("14529");var r=n("80681"),a=n("62568"),o=n("78335"),l=n("12308"),i=n("20358"),[u,s]=(0,a.do)("loading"),c=Array(12).fill(null).map((t,e)=>(0,r.Wm)("i",{class:s("line",String(e+1))},null)),d=(0,r.Wm)("svg",{class:s("circular"),viewBox:"25 25 50 50"},[(0,r.Wm)("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),v={size:o.Or,type:(0,o.SQ)("circular"),color:String,vertical:Boolean,textSize:o.Or,textColor:String};e.Z=(0,r.aZ)({name:u,props:v,setup(t,e){var{slots:n}=e,a=(0,r.Fl)(()=>(0,l.l7)({color:t.color},(0,i.Xn)(t.size))),o=()=>{var e="spinner"===t.type?c:d;return(0,r.Wm)("span",{class:s("spinner",t.type),style:a.value},[n.icon?n.icon():e])},u=()=>{if(n.default){var e;return(0,r.Wm)("span",{class:s("text"),style:{fontSize:(0,i.Nn)(t.textSize),color:null!==(e=t.textColor)&&void 0!==e?e:t.color}},[n.default()])}};return()=>{var{type:e,vertical:n}=t;return(0,r.Wm)("div",{class:s([e,{vertical:n}]),"aria-live":"polite","aria-busy":!0},[o(),u()])}}})},50499:function(t,e,n){"use strict";n("82116"),n("17989");var r=n("80681"),a=n("62568"),o=n("78335"),l=n("20358"),[i,u]=(0,a.do)("skeleton-avatar"),s={avatarSize:o.Or,avatarShape:(0,o.SQ)("round")};e.Z=(0,r.aZ)({name:i,props:s,setup:t=>()=>(0,r.Wm)("div",{class:u([t.avatarShape]),style:(0,l.Xn)(t.avatarSize)},null)})},13777:function(t,e,n){"use strict";n("82116"),n("17989");var r=n("80681"),a=n("62568"),o=n("78335"),l=n("20358"),i=n("96528"),[u,s]=(0,a.do)("skeleton-image"),c={imageSize:o.Or,imageShape:(0,o.SQ)("square")};e.Z=(0,r.aZ)({name:u,props:c,setup:t=>()=>(0,r.Wm)("div",{class:s([t.imageShape]),style:(0,l.Xn)(t.imageSize)},[(0,r.Wm)(i.JO,{name:"photo",class:s("icon")},null)])})},83430:function(t,e,n){"use strict";n.d(e,{gF:function(){return l}}),n("82116"),n("17989");var r=n("80681"),a=n("78335"),o=n("62568"),l="100%",i={round:Boolean,rowWidth:{type:a.Or,default:l}},[u,s]=(0,o.do)("skeleton-paragraph");e.ZP=(0,r.aZ)({name:u,props:i,setup:t=>()=>(0,r.Wm)("div",{class:s([{round:t.round}]),style:{width:t.rowWidth}},null)})},64759:function(t,e,n){"use strict";n("82116"),n("17989");var r=n("80681"),a=n("62568"),o=n("78335"),l=n("20358"),[i,u]=(0,a.do)("skeleton-title"),s={round:Boolean,titleWidth:o.Or};e.Z=(0,r.aZ)({name:i,props:s,setup:t=>()=>(0,r.Wm)("h3",{class:u([{round:t.round}]),style:{width:(0,l.Nn)(t.titleWidth)}},null)})},17463:function(t,e,n){"use strict";n("82116"),n("17989"),n("66786"),n("14529");var r=n("80681"),a=n("62568"),o=n("78335"),l=n("20358"),i=n("6530"),u=n("49948"),s=n("83430"),c=n("13627"),[d,v]=(0,a.do)("skeleton"),f={row:(0,o.SI)(0),round:Boolean,title:Boolean,titleWidth:o.Or,avatar:Boolean,avatarSize:o.Or,avatarShape:(0,o.SQ)("round"),loading:o.J5,animate:o.J5,rowWidth:{type:[Number,String,Array],default:s.gF}};e.Z=(0,r.aZ)({name:d,inheritAttrs:!1,props:f,setup(t,e){var{slots:n,attrs:a}=e,o=()=>{if(t.avatar)return(0,r.Wm)(u.ZP,{avatarShape:t.avatarShape,avatarSize:t.avatarSize},null)},d=()=>{if(t.title)return(0,r.Wm)(i.ZP,{round:t.round,titleWidth:t.titleWidth},null)},f=e=>{var{rowWidth:n}=t;return n===s.gF&&e===+t.row-1?"60%":Array.isArray(n)?n[e]:n},m=()=>Array(+t.row).fill("").map((e,n)=>(0,r.Wm)(c.ZP,{key:n,round:t.round,rowWidth:(0,l.Nn)(f(n))},null)),p=()=>n.template?n.template():(0,r.Wm)(r.HY,null,[o(),(0,r.Wm)("div",{class:v("content")},[d(),m()])]);return()=>{if(!t.loading){var e;return null===(e=n.default)||void 0===e?void 0:e.call(n)}return(0,r.Wm)("div",(0,r.dG)({class:v({animate:t.animate,round:t.round})},a),[p()])}}})},79960:function(t,e,n){"use strict";n("82116"),n("17989");var r=n("80681"),a=n("62568"),o=n("78335"),l=n("20358"),i=n("22300"),u=n("95786"),[s,c]=(0,a.do)("switch"),d={size:o.Or,loading:Boolean,disabled:Boolean,modelValue:o.Vg,activeColor:String,inactiveColor:String,activeValue:{type:o.Vg,default:!0},inactiveValue:{type:o.Vg,default:!1}};e.Z=(0,r.aZ)({name:s,props:d,emits:["change","update:modelValue"],setup(t,e){var{emit:n,slots:a}=e,o=()=>t.modelValue===t.activeValue,s=()=>{if(!t.disabled&&!t.loading){var e=o()?t.inactiveValue:t.activeValue;n("update:modelValue",e),n("change",e)}},d=()=>{if(t.loading){var e=o()?t.activeColor:t.inactiveColor;return(0,r.Wm)(u.gb,{class:c("loading"),color:e},null)}if(a.node)return a.node()};return(0,i.aM)(()=>t.modelValue),()=>{var e,{size:n,loading:i,disabled:u,activeColor:v,inactiveColor:f}=t,m=o(),p={fontSize:(0,l.Nn)(n),backgroundColor:m?v:f};return(0,r.Wm)("div",{role:"switch",class:c({on:m,loading:i,disabled:u}),style:p,tabindex:u?void 0:0,"aria-checked":m,onClick:s},[(0,r.Wm)("div",{class:c("node")},[d()]),null===(e=a.background)||void 0===e?void 0:e.call(a)])}}})},91938:function(t,e,n){"use strict";n.r(t.exports={})},14818:function(t,e,n){"use strict";n.r(t.exports={})}}]); |