mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-23 08:35:35 +08:00
1 line
8.4 KiB
JavaScript
1 line
8.4 KiB
JavaScript
|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[9,3,17,20],{664:function(t,e,r){"use strict";r.d(e,"d",(function(){return n})),r.d(e,"a",(function(){return s})),r.d(e,"f",(function(){return a})),r.d(e,"b",(function(){return u})),r.d(e,"e",(function(){return c})),r.d(e,"h",(function(){return p})),r.d(e,"i",(function(){return d})),r.d(e,"c",(function(){return h})),r.d(e,"g",(function(){return f}));r(391);const n=/#.*$/,i=/\.(md|html)$/,s=/\/$/,a=/^[a-z]+:/i;function o(t){return decodeURI(t).replace(n,"").replace(i,"")}function l(t){return a.test(t)}function u(t){if(l(t))return t;const e=t.match(n),r=e?e[0]:"",i=o(t);return s.test(i)?t:i+".html"+r}function c(t,e){const r=t.hash,i=function(t){const e=t.match(n);if(e)return e[0]}(e);if(i&&r!==i)return!1;return o(t.path)===o(e)}function p(t,e,r){if(l(e))return{type:"external",path:e};r&&(e=function(t,e,r){const n=t.charAt(0);if("/"===n)return t;if("?"===n||"#"===n)return e+t;const i=e.split("/");r&&i[i.length-1]||i.pop();const s=t.replace(/^\//,"").split("/");for(let t=0;t<s.length;t++){const e=s[t];".."===e?i.pop():"."!==e&&i.push(e)}""!==i[0]&&i.unshift("");return i.join("/")}(e,r));const n=o(e);for(let e=0;e<t.length;e++)if(o(t[e].regularPath)===n)return Object.assign({},t[e],{type:"page",path:u(t[e].path)});return console.error(`[vuepress] No matching page found for sidebar item "${e}"`),{}}function d(t,e,r,n){const{pages:i,themeConfig:s}=r,a=n&&s.locales&&s.locales[n]||s;if("auto"===(t.frontmatter.sidebar||a.sidebar||s.sidebar))return function(t){const e=h(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}(t);const o=a.sidebar||s.sidebar;if(o){const{base:t,config:r}=function(t,e){if(Array.isArray(e))return{base:"/",config:e};for(const n in e)if(0===(r=t,/(\.html|\/)$/.test(r)?r:r+"/").indexOf(encodeURI(n)))return{base:n,config:e[n]};var r;return{}}(e,o);return r?r.map(e=>function t(e,r,n,i=1){if("string"==typeof e)return p(r,e,n);if(Array.isArray(e))return Object.assign(p(r,e[0],n),{title:e[1]});{i>3&&console.error("[vuepress] detected a too deep nested sidebar group.");const s=e.children||[];return 0===s.length&&e.path?Object.assign(p(r,e.path,n),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,children:s.map(e=>t(e,r,n,i+1)),collapsable:!1!==e.collapsable}}}(e,i,t)):[]}return[]}function h(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function f(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},666:function(t,e,r){},668:function(t,e,r){},669:function(t,e,r){},674:function(t,e,r){"use strict";r(666)},675:function(t,e,r){"use strict";r.r(e);var n=r(690),i=r(677),s=r(664);function a(t,e){return"group"===e.type&&e.children.some(e=>"group"===e.type?a(t,e):"page"===e.type&&Object(s.e)(t,e.path))}var o={name:"SidebarLinks",components:{SidebarGroup:n.default,SidebarLink:i.default},props:["items","depth","sidebarDepth"],data:()=>({openGroupIndex:0}),watch:{$route(){this.refreshIndex()}},created(){this.refreshIndex()},methods:{refreshIndex(){const t=function(t,e){for(let r=0;r<e.length;r++){const n=e[r];if(a(t,n))return r}return-1}(this.$route,this.items);t>-1&&(this.openGroupIndex=t)},toggleGroup(t){this.openGroupIndex=t===this.openGroupIndex?-1:t},isActive(t){return Object(s.e)(this.$route,t.regularPath)}}},l=r(84),u=Object(l.a)(o,(function(){var t=this,e=t._self._c;return t.items.length?e("ul",{staticClass:"sidebar-links"},t._l(t.items,(function(r,n){return e("li",{key:n},["group"===r.type?e("SidebarGroup",{attrs:{item:r,open:n===t.openGroupIndex,collapsable:r.collapsable||r.collapsible,depth:t.depth},on:{toggle:function(e){return t.toggleGroup(n)}}}):e("SidebarLink",{attrs:{"sidebar-depth":t.sidebarDepth,item:r}})],1)})),0):t._e()}),[],!1,null,null,null);e.default=u.exports},677:function(t,e,r){"use strict";r.r(e);var n=r(664);function i(t,e,r,n,i){const s={props:{to:e,activeCl
|