mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-22 16:15:34 +08:00
1 line
6.5 KiB
JavaScript
1 line
6.5 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[3,17],{664:function(e,t,n){"use strict";n.d(t,"d",(function(){return r})),n.d(t,"a",(function(){return s})),n.d(t,"f",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"e",(function(){return u})),n.d(t,"h",(function(){return p})),n.d(t,"i",(function(){return d})),n.d(t,"c",(function(){return h})),n.d(t,"g",(function(){return f}));n(391);const r=/#.*$/,i=/\.(md|html)$/,s=/\/$/,a=/^[a-z]+:/i;function o(e){return decodeURI(e).replace(r,"").replace(i,"")}function l(e){return a.test(e)}function c(e){if(l(e))return e;const t=e.match(r),n=t?t[0]:"",i=o(e);return s.test(i)?e:i+".html"+n}function u(e,t){const n=e.hash,i=function(e){const t=e.match(r);if(t)return t[0]}(t);if(i&&n!==i)return!1;return o(e.path)===o(t)}function p(e,t,n){if(l(t))return{type:"external",path:t};n&&(t=function(e,t,n){const r=e.charAt(0);if("/"===r)return e;if("?"===r||"#"===r)return t+e;const i=t.split("/");n&&i[i.length-1]||i.pop();const s=e.replace(/^\//,"").split("/");for(let e=0;e<s.length;e++){const t=s[e];".."===t?i.pop():"."!==t&&i.push(t)}""!==i[0]&&i.unshift("");return i.join("/")}(t,n));const r=o(t);for(let t=0;t<e.length;t++)if(o(e[t].regularPath)===r)return Object.assign({},e[t],{type:"page",path:c(e[t].path)});return console.error(`[vuepress] No matching page found for sidebar item "${t}"`),{}}function d(e,t,n,r){const{pages:i,themeConfig:s}=n,a=r&&s.locales&&s.locales[r]||s;if("auto"===(e.frontmatter.sidebar||a.sidebar||s.sidebar))return function(e){const t=h(e.headers||[]);return[{type:"group",collapsable:!1,title:e.title,path:null,children:t.map(t=>({type:"auto",title:t.title,basePath:e.path,path:e.path+"#"+t.slug,children:t.children||[]}))}]}(e);const o=a.sidebar||s.sidebar;if(o){const{base:e,config:n}=function(e,t){if(Array.isArray(t))return{base:"/",config:t};for(const r in t)if(0===(n=e,/(\.html|\/)$/.test(n)?n:n+"/").indexOf(encodeURI(r)))return{base:r,config:t[r]};var n;return{}}(t,o);return n?n.map(t=>function e(t,n,r,i=1){if("string"==typeof t)return p(n,t,r);if(Array.isArray(t))return Object.assign(p(n,t[0],r),{title:t[1]});{i>3&&console.error("[vuepress] detected a too deep nested sidebar group.");const s=t.children||[];return 0===s.length&&t.path?Object.assign(p(n,t.path,r),{title:t.title}):{type:"group",path:t.path,title:t.title,sidebarDepth:t.sidebarDepth,children:s.map(t=>e(t,n,r,i+1)),collapsable:!1!==t.collapsable}}}(t,i,e)):[]}return[]}function h(e){let t;return(e=e.map(e=>Object.assign({},e))).forEach(e=>{2===e.level?t=e:t&&(t.children||(t.children=[])).push(e)}),e.filter(e=>2===e.level)}function f(e){return Object.assign(e,{type:e.items&&e.items.length?"links":"link"})}},666:function(e,t,n){},668:function(e,t,n){},674:function(e,t,n){"use strict";n(666)},675:function(e,t,n){"use strict";n.r(t);var r=n(690),i=n(677),s=n(664);function a(e,t){return"group"===t.type&&t.children.some(t=>"group"===t.type?a(e,t):"page"===t.type&&Object(s.e)(e,t.path))}var o={name:"SidebarLinks",components:{SidebarGroup:r.default,SidebarLink:i.default},props:["items","depth","sidebarDepth"],data:()=>({openGroupIndex:0}),watch:{$route(){this.refreshIndex()}},created(){this.refreshIndex()},methods:{refreshIndex(){const e=function(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(a(e,r))return n}return-1}(this.$route,this.items);e>-1&&(this.openGroupIndex=e)},toggleGroup(e){this.openGroupIndex=e===this.openGroupIndex?-1:e},isActive(e){return Object(s.e)(this.$route,e.regularPath)}}},l=n(84),c=Object(l.a)(o,(function(){var e=this,t=e._self._c;return e.items.length?t("ul",{staticClass:"sidebar-links"},e._l(e.items,(function(n,r){return t("li",{key:r},["group"===n.type?t("SidebarGroup",{attrs:{item:n,open:r===e.openGroupIndex,collapsable:n.collapsable||n.collapsible,depth:e.depth},on:{toggle:function(t){return e.toggleGroup(r)}}}):t("SidebarLink",{attrs:{"sidebar-depth":e.sidebarDepth,item:n}})],1)})),0):e._e()}),[],!1,null,null,null);t.default=c.exports},677:function(e,t,n){"use strict";n.r(t);var r=n(664);function i(e,t,n,r,i){const s={props:{to:t,activeClass:"",exactActiveClass:""},attrs:{title:n},class:{active:r,"sidebar-link":!0}};return i>2&&(s.style={"padding-left":i+"rem"}),e("RouterLink",s,n)}function s(e,t,n,a,o,l=1){return!t||l>o?null:e("ul",{class:"sidebar-sub-headers"},t.map(t=>{const c=Object(r.e)(a,n+"#"+t.slug);return e("li",{class:"sidebar-sub-header"},[i(e,n+"#"+t.slug,t.title,c,t.level-1),s(e,t.children,n,a,o,l+1)])}))}var a={functional:!0,props:["item","sidebarDepth"],render(e,{parent:{$page:t,$site:n,$route:a,$themeConfig:o,$themeLocaleConfig:l},props:{item:c,sidebarDepth:u}}){const p=Object(r.e)(a,c.path),d="auto"===c.type?p||c.children.some(e=>Object(r.e)(a,c.basePath+"#"+e.slug)):p,h="external"===c.type?function(e,t,n){return e("a",{attrs:{href:t,target:"_blank",rel:"noopener noreferrer"},class:{"sidebar-link":!0}},[n,e("OutboundLink")])}(e,c.path,c.title||c.path):i(e,c.path,c.title||c.path,d),f=[t.frontmatter.sidebarDepth,u,l.sidebarDepth,o.sidebarDepth,1].find(e=>void 0!==e),b=l.displayAllHeaders||o.displayAllHeaders;if("auto"===c.type)return[h,s(e,c.children,c.basePath,a,f)];if((d||b)&&c.headers&&!r.d.test(c.path)){return[h,s(e,Object(r.c)(c.headers),c.path,a,f)]}return h}},o=(n(674),n(84)),l=Object(o.a)(a,void 0,void 0,!1,null,null,null);t.default=l.exports},681:function(e,t,n){"use strict";n(668)},690:function(e,t,n){"use strict";n.r(t);var r={name:"SidebarGroup",props:["item","open","collapsable","depth"],beforeCreate(){this.$options.components.SidebarLinks=n(675).default},methods:{isActive:n(664).e}},i=(n(681),n(84)),s=Object(i.a)(r,(function(){var e=this,t=e._self._c;return t("section",{staticClass:"sidebar-group",class:[{collapsable:e.collapsable,"is-sub-group":0!==e.depth},"depth-"+e.depth]},[e.item.path?t("RouterLink",{staticClass:"sidebar-heading clickable",class:{open:e.open,active:e.isActive(e.$route,e.item.path)},attrs:{to:e.item.path},nativeOn:{click:function(t){return e.$emit("toggle")}}},[t("span",[e._v(e._s(e.item.title))]),e._v(" "),e.collapsable?t("span",{staticClass:"arrow",class:e.open?"down":"right"},[t("a-icon",{attrs:{type:"down"}})],1):e._e()]):t("p",{staticClass:"sidebar-heading",class:{open:e.open},on:{click:function(t){return e.$emit("toggle")}}},[t("span",[e._v(e._s(e.item.title))]),e._v(" "),e.collapsable?t("span",{staticClass:"arrow",class:e.open?"down":"right"},[t("a-icon",{attrs:{type:"down"}})],1):e._e()]),e._v(" "),e.open||!e.collapsable?t("SidebarLinks",{staticClass:"sidebar-group-items",attrs:{items:e.item.children,"sidebar-depth":e.item.sidebarDepth,depth:e.depth+1}}):e._e()],1)}),[],!1,null,null,null);t.default=s.exports}}]); |