mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
2 lines
6.9 KiB
JavaScript
2 lines
6.9 KiB
JavaScript
import{_ as e,e as t,a as n,l as o,g as a,f as s}from"./iframe-router.66c5235e.js";import{a as c,t as r,f as l,i,o as u,n as m,d,r as p,F as h,b as v,c as f,w as g,h as y,e as w,l as _,m as b,x as k,q as E,j as $,v as T,y as B,K as L,s as X}from"./vue-libs.7d12dd47.js";const Y={name:"DemoBlock",props:{card:Boolean,title:String}},K={class:"van-doc-demo-block"},O={key:0,class:"van-doc-demo-block__title"},j={key:1,class:"van-doc-demo-block__card"};var x=e(Y,[["render",function(e,t,n,o,a,s){return u(),c("div",K,[n.title?(u(),c("h2",O,r(n.title),1)):l("v-if",!0),n.card?(u(),c("div",j,[i(e.$slots,"default")])):i(e.$slots,"default",{key:2})])}]]);var z=e({name:"DemoSection",computed:{demoName(){const{meta:e}=this.$route||{};return e&&e.name?`demo-${t(e.name)}`:""}}},[["render",function(e,t,n,o,a,s){return u(),c("section",{class:m(["van-doc-demo-section",s.demoName])},[i(e.$slots,"default")],2)}]]);const N={},D={versions:[{label:"0.x",link:"/vant-weapp/0.x"}],title:"Vant Weapp",description:"轻量、可靠的小程序 UI 组件库",logo:"https://img.yzcdn.cn/vant/logo.png",simulator:{url:"https://vant-contrib.gitee.io/vant/mobile.html?weapp=1",syncPathFromSimulator:!1},links:[{logo:"https://img.yzcdn.cn/vant/vant-o.svg",url:"https://vant-contrib.gitee.io/vant/"},{logo:"https://b.yzcdn.cn/vant/logo/github.svg",url:"https://github.com/youzan/vant-weapp"}],baiduAnalytics:{seed:"ad6b5732c36321f2dafed737ac2da92f"},nav:[]},S={},F={viewBox:"0 0 1024 1024"},M=[d("path",{fill:"#B6C3D2",d:"M601.1 556.5L333.8 289.3c-24.5-24.5-24.5-64.6 0-89.1s64.6-24.5 89.1 0l267.3 267.3c24.5 24.5 24.5 64.6 0 89.1-24.5 24.4-64.6 24.4-89.1-.1z"},null,-1),d("path",{fill:"#B6C3D2",d:"M690.2 556.5L422.9 823.8c-24.5 24.5-64.6 24.5-89.1 0s-24.5-64.6 0-89.1l267.3-267.3c24.5-24.5 64.6-24.5 89.1 0 24.5 24.6 24.5 64.6 0 89.1z"},null,-1)];const C={class:"demo-home-nav"},R={class:"demo-home-nav__title"},A={class:"demo-home-nav__group"};const q={class:"demo-home"},H=["src"],I={key:0,class:"demo-home__desc"};var P=e({components:{DemoHomeNav:e({components:{ArrowRight:e(S,[["render",function(e,t){return u(),c("svg",F,M)}]])},props:{lang:String,group:Object},data:()=>({active:[]}),computed:{base(){return this.lang?`/${this.lang}`:""}}},[["render",function(e,t,n,o,a,s){const l=p("arrow-right"),i=p("router-link");return u(),c("div",C,[d("div",R,r(n.group.title),1),d("div",A,[(u(!0),c(h,null,v(n.group.items,(e=>(u(),f(i,{class:"demo-home-nav__block",key:e.path,to:`${s.base}/${e.path}`},{default:g((()=>[y(r(e.title)+" ",1),w(l,{class:"demo-home-nav__icon"})])),_:2},1032,["to"])))),128))])])}]])},computed:{lang(){const{lang:e}=this.$route.meta;return e},config(){const{locales:e}=D;return e?e[this.lang]:D},smallTitle(){return this.config.title.length>=8}}},[["render",function(e,t,n,o,a,s){const i=p("demo-home-nav");return u(),c("div",q,[d("h1",{class:m(["demo-home__title",{"demo-home__title--small":s.smallTitle}])},[d("img",{src:s.config.logo},null,8,H),d("span",null,r(s.config.title),1)],2),s.config.description?(u(),c("h2",I,r(s.config.description),1)):l("v-if",!0),(u(!0),c(h,null,v(s.config.nav,((e,t)=>(u(),f(i,{key:t,lang:s.lang,group:e},null,8,["lang","group"])))),128))])}]]);const{locales:U,defaultLang:V}=D;function W(e){const t=e.path.split("/")[1];return-1!==Object.keys(U).indexOf(t)?t:a()}n(V);const G=_({history:b(),routes:function(){const e=[],n=Object.keys(N),o=U?Object.keys(U):[];return o.length?(e.push({name:"NotFound",path:"/:path(.*)+",redirect:e=>({name:W(e)})}),o.forEach((t=>{e.push({name:t,path:`/${t}`,component:P,meta:{lang:t}})}))):(e.push({name:"NotFound",path:"/:path(.*)+",redirect:{name:"home"}}),e.push({name:"home",path:"/",component:P})),n.forEach((n=>{const a=t(n);o.length?o.forEach((t=>{e.push({name:`${t}/${a}`,path:`/${t}/${a}`,component:N[n],meta:{name:n,lang:t}})})):e.push({name:a,path:`/${a}`,component:N[n],meta:{name:n}})})),e}(),scrollBehavior:(e,t,n)=>n||{x:0,y:0}});k(G.currentRoute,(()=>{G.currentRoute.value.redirectedFrom||E(s)})),o(G),window.vueRouter=G;const J={class:"demo-nav"},Q={class:"demo-nav__title"},Z=["d"];var ee=e({components:{DemoNav:e({data:()=>({path:"M296.114 508.035c-3.22-13.597.473-28.499 11.079-39.105l333.912-333.912c16.271-16.272 42.653-16.272 58.925 0s16.272 42.654 0 58.926L395.504 498.47l304.574 304.574c16.272 16.272 16.272 42.654 0 58.926s-42.654 16.272-58.926 0L307.241 528.058a41.472 41.472 0 0 1-11.127-20.023z"}),computed:{title(){const{name:e}=this.$route.meta||{};return e?e.replace(/-/g,""):""}},methods:{onBack(){history.length>1?history.back():this.$router.replace("/")}}},[["render",function(e,t,n,o,a,s){return $((u(),c("div",J,[d("div",Q,r(s.title),1),(u(),c("svg",{class:"demo-nav__back",viewBox:"0 0 1000 1000",onClick:t[0]||(t[0]=(...e)=>s.onBack&&s.onBack(...e))},[d("path",{fill:"#969799","fill-rule":"evenodd",d:a.path},null,8,Z)]))],512)),[[T,s.title]])}]])}},[["render",function(e,t,n,o,a,s){const r=p("demo-nav"),l=p("demo-section"),i=p("router-view");return u(),c(h,null,[w(r),w(i,null,{default:g((({Component:e})=>[(u(),f(L,null,[w(l,null,{default:g((()=>[(u(),f(B(e)))])),_:2},1024)],1024))])),_:1})],64)}]]);!function(){if("undefined"!=typeof window){var e,t="ontouchstart"in window;document.createTouch||(document.createTouch=function(e,t,o,a,s,c,r){return new n(t,o,{pageX:a,pageY:s,screenX:c,screenY:r,clientX:a-window.pageXOffset,clientY:s-window.pageYOffset},0,0)}),document.createTouchList||(document.createTouchList=function(){for(var e=a(),t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length=arguments.length,e}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null});var n=function(e,t,n,o,a){o=o||0,a=a||0,this.identifier=t,this.target=e,this.clientX=n.clientX+o,this.clientY=n.clientY+a,this.screenX=n.screenX+o,this.screenY=n.screenY+a,this.pageX=n.pageX+o,this.pageY=n.pageY+a},o=!1;l.multiTouchOffset=75,t||new l}function a(){var e=[];return e.item=function(e){return this[e]||null},e.identifiedTouch=function(e){return this[e+1]||null},e}function s(t){return function(n){var a,s,l;("mousedown"===n.type&&(o=!0),"mouseup"===n.type&&(o=!1),"mousemove"!==n.type||o)&&(("mousedown"===n.type||!e||e&&!e.dispatchEvent)&&(e=n.target),null==e.closest("[data-no-touch-simulate]")&&(a=t,s=n,(l=document.createEvent("Event")).initEvent(a,!0,!0),l.altKey=s.altKey,l.ctrlKey=s.ctrlKey,l.metaKey=s.metaKey,l.shiftKey=s.shiftKey,l.touches=r(s),l.targetTouches=r(s),l.changedTouches=c(s),e.dispatchEvent(l)),"mouseup"===n.type&&(e=null))}}function c(t){var o=a();return o.push(new n(e,1,t,0,0)),o}function r(e){return"mouseup"===e.type?a():c(e)}function l(){window.addEventListener("mousedown",s("touchstart"),!0),window.addEventListener("mousemove",s("touchmove"),!0),window.addEventListener("mouseup",s("touchend"),!0)}}(),window.app=X(ee).use(G).component(x.name,x).component(z.name,z),setTimeout((()=>{window.app.mount("#app")}),0);
|