diff --git a/404.html b/404.html index ce036f2b..28a6b34e 100644 --- a/404.html +++ b/404.html @@ -5,11 +5,11 @@ Fes.js - - + +

404

看起来我们进入了错误的链接
返回首页
- + diff --git a/assets/css/styles.b00c68fc.css b/assets/css/styles.8abd66bb.css similarity index 100% rename from assets/css/styles.b00c68fc.css rename to assets/css/styles.8abd66bb.css diff --git a/assets/js/205.d4ef4058.js b/assets/js/205.d4ef4058.js new file mode 100644 index 00000000..6b499c52 --- /dev/null +++ b/assets/js/205.d4ef4058.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[205],{5205:(e,n,t)=>{t.r(n),t.d(n,{register:()=>i,unregister:()=>u});var r,o=function(){return Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))};function i(e,n){void 0===n&&(n={});var t=n.registrationOptions;void 0===t&&(t={}),delete n.registrationOptions;var i=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];n&&n[e]&&n[e].apply(n,t)};"serviceWorker"in navigator&&r.then((function(){o()?(function(e,n,t){fetch(e).then((function(r){404===r.status?(n("error",new Error("Service worker not found at "+e)),u()):-1===r.headers.get("content-type").indexOf("javascript")?(n("error",new Error("Expected "+e+" to have javascript content-type, but received "+r.headers.get("content-type"))),u()):c(e,n,t)})).catch((function(e){return a(n,e)}))}(e,i,t),navigator.serviceWorker.ready.then((function(e){i("ready",e)})).catch((function(e){return a(i,e)}))):(c(e,i,t),navigator.serviceWorker.ready.then((function(e){i("ready",e)})).catch((function(e){return a(i,e)})))}))}function a(e,n){navigator.onLine||e("offline"),e("error",n)}function c(e,n,t){navigator.serviceWorker.register(e,t).then((function(e){n("registered",e),e.waiting?n("updated",e):e.onupdatefound=function(){n("updatefound",e);var t=e.installing;t.onstatechange=function(){"installed"===t.state&&(navigator.serviceWorker.controller?n("updated",e):n("cached",e))}}})).catch((function(e){return a(n,e)}))}function u(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){return a(emit,e)}))}"undefined"!=typeof window&&(r="undefined"!=typeof Promise?new Promise((function(e){return window.addEventListener("load",e)})):{then:function(e){return window.addEventListener("load",e)}})}}]); \ No newline at end of file diff --git a/assets/js/205.fc028656.js b/assets/js/205.fc028656.js deleted file mode 100644 index a8f6e7ff..00000000 --- a/assets/js/205.fc028656.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[205],{5205:(e,n,t)=>{var r;function o(e,n){void 0===n&&(n={});var t=n.registrationOptions;void 0===t&&(t={}),delete n.registrationOptions;var o=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];n&&n[e]&&n[e].apply(n,t)};"serviceWorker"in navigator&&r.then((function(){Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))?(function(e,n,t){fetch(e).then((function(r){404===r.status?(n("error",new Error("Service worker not found at "+e)),c()):-1===r.headers.get("content-type").indexOf("javascript")?(n("error",new Error("Expected "+e+" to have javascript content-type, but received "+r.headers.get("content-type"))),c()):a(e,n,t)})).catch((function(e){return i(n,e)}))}(e,o,t),navigator.serviceWorker.ready.then((function(e){o("ready",e)})).catch((function(e){return i(o,e)}))):(a(e,o,t),navigator.serviceWorker.ready.then((function(e){o("ready",e)})).catch((function(e){return i(o,e)})))}))}function i(e,n){navigator.onLine||e("offline"),e("error",n)}function a(e,n,t){navigator.serviceWorker.register(e,t).then((function(e){n("registered",e),e.waiting?n("updated",e):e.onupdatefound=function(){n("updatefound",e);var t=e.installing;t.onstatechange=function(){"installed"===t.state&&(navigator.serviceWorker.controller?n("updated",e):n("cached",e))}}})).catch((function(e){return i(n,e)}))}function c(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){return i(emit,e)}))}t.r(n),t.d(n,{register:()=>o,unregister:()=>c}),"undefined"!=typeof window&&(r="undefined"!=typeof Promise?new Promise((function(e){return window.addEventListener("load",e)})):{then:function(e){return window.addEventListener("load",e)}})}}]); \ No newline at end of file diff --git a/assets/js/293.a51fb332.js b/assets/js/293.f5289c13.js similarity index 65% rename from assets/js/293.a51fb332.js rename to assets/js/293.f5289c13.js index 7adffbea..125a6801 100644 --- a/assets/js/293.a51fb332.js +++ b/assets/js/293.f5289c13.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[293],{3293:(e,l,t)=>{t.r(l),t.d(l,{default:()=>_e});var a=t(6252),n=t(3577),i=t(2262),u=t(9963),r=t(7621),o=t(2201),s=t(7788),c=t(5885);const v=["href","rel","target","aria-label"],d=(0,a.aZ)({inheritAttrs:!1}),p=(0,a.aZ)({...d,__name:"NavLink",props:{item:{type:Object,required:!0}},setup(e){const l=e,t=(0,o.yj)(),u=(0,r.WF)(),{item:c}=(0,i.BK)(l),d=(0,a.Fl)((()=>(0,s.ak)(c.value.link))),p=(0,a.Fl)((()=>(0,s.B2)(c.value.link)||(0,s.R5)(c.value.link))),h=(0,a.Fl)((()=>{if(!p.value)return c.value.target?c.value.target:d.value?"_blank":void 0})),g=(0,a.Fl)((()=>"_blank"===h.value)),m=(0,a.Fl)((()=>!d.value&&!p.value&&!g.value)),k=(0,a.Fl)((()=>{if(!p.value)return c.value.rel?c.value.rel:g.value?"noopener noreferrer":void 0})),b=(0,a.Fl)((()=>c.value.ariaLabel||c.value.text)),w=(0,a.Fl)((()=>{const e=Object.keys(u.value.locales);return e.length?!e.some((e=>e===c.value.link)):"/"!==c.value.link})),f=(0,a.Fl)((()=>!!w.value&&t.path.startsWith(c.value.link))),U=(0,a.Fl)((()=>!!m.value&&(c.value.activeMatch?new RegExp(c.value.activeMatch).test(t.path):f.value)));return(e,l)=>{const t=(0,a.up)("RouterLink"),u=(0,a.up)("OutboundLink");return(0,i.SU)(m)?((0,a.wg)(),(0,a.j4)(t,(0,a.dG)({key:0,class:["nav-link",{"router-link-active":(0,i.SU)(U)}],to:(0,i.SU)(c).link,"aria-label":(0,i.SU)(b)},e.$attrs),{default:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"before"),(0,a.Uk)(" "+(0,n.zw)((0,i.SU)(c).text)+" ",1),(0,a.WI)(e.$slots,"after")])),_:3},16,["class","to","aria-label"])):((0,a.wg)(),(0,a.iD)("a",(0,a.dG)({key:1,class:"nav-link external",href:(0,i.SU)(c).link,rel:(0,i.SU)(k),target:(0,i.SU)(h),"aria-label":(0,i.SU)(b)},e.$attrs),[(0,a.WI)(e.$slots,"before"),(0,a.Uk)(" "+(0,n.zw)((0,i.SU)(c).text)+" ",1),(0,i.SU)(g)?((0,a.wg)(),(0,a.j4)(u,{key:0})):(0,a.kq)("",!0),(0,a.WI)(e.$slots,"after")],16,v))}}}),h=["aria-labelledby"],g={class:"hero"},m=["src","alt"],k={key:0,id:"main-title"},b={key:1,class:"description"},w={key:2,class:"actions"},f={key:0,class:"features"},U={class:"theme-default-content custom"},S=["innerHTML"],y=["textContent"],_=(0,a.aZ)({__name:"Home",setup(e){const l=(0,r.I2)(),t=(0,r.I5)(),u=(0,c.vs)(),o=(0,a.Fl)((()=>u.value&&void 0!==l.value.heroImageDark?l.value.heroImageDark:l.value.heroImage)),v=(0,a.Fl)((()=>null===l.value.heroText?null:l.value.heroText||t.value.title||"Hello")),d=(0,a.Fl)((()=>l.value.heroAlt||v.value||"hero")),_=(0,a.Fl)((()=>null===l.value.tagline?null:l.value.tagline||t.value.description||"Welcome to your VuePress site")),D=(0,a.Fl)((()=>(0,s.kJ)(l.value.actions)?l.value.actions.map((({text:e,link:l,type:t="primary"})=>({text:e,link:l,type:t}))):[])),F=(0,a.Fl)((()=>(0,s.kJ)(l.value.features)?l.value.features:[])),W=(0,a.Fl)((()=>l.value.footer)),x=(0,a.Fl)((()=>l.value.footerHtml));return(e,l)=>{const t=(0,a.up)("ClientOnly"),u=(0,a.up)("Content");return(0,a.wg)(),(0,a.iD)("main",{class:"home","aria-labelledby":(0,i.SU)(v)?"main-title":void 0},[(0,a._)("header",g,[(0,a.Wm)(t,null,{default:(0,a.w5)((()=>[(0,i.SU)(o)?((0,a.wg)(),(0,a.iD)("img",{key:0,src:(0,i.SU)(r.pJ)((0,i.SU)(o)),alt:(0,i.SU)(d)},null,8,m)):(0,a.kq)("",!0)])),_:1}),(0,i.SU)(v)?((0,a.wg)(),(0,a.iD)("h1",k,(0,n.zw)((0,i.SU)(v)),1)):(0,a.kq)("",!0),(0,i.SU)(_)?((0,a.wg)(),(0,a.iD)("p",b,(0,n.zw)((0,i.SU)(_)),1)):(0,a.kq)("",!0),(0,i.SU)(D).length?((0,a.wg)(),(0,a.iD)("p",w,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,i.SU)(D),(e=>((0,a.wg)(),(0,a.j4)(p,{key:e.text,class:(0,n.C_)(["action-button",[e.type]]),item:e},null,8,["class","item"])))),128))])):(0,a.kq)("",!0)]),(0,i.SU)(F).length?((0,a.wg)(),(0,a.iD)("div",f,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,i.SU)(F),(e=>((0,a.wg)(),(0,a.iD)("div",{key:e.title,class:"feature"},[(0,a._)("h2",null,(0,n.zw)(e.title),1),(0,a._)("p",null,(0,n.zw)(e.details),1)])))),128))])):(0,a.kq)("",!0),(0,a._)("div",U,[(0,a.Wm)(u)]),(0,i.SU)(W)?((0,a.wg)(),(0,a.iD)(a.HY,{key:1},[(0,i.SU)(x)?((0,a.wg)(),(0,a.iD)("div",{key:0,class:"footer",innerHTML:(0,i.SU)(W)},null,8,S)):((0,a.wg)(),(0,a.iD)("div",{key:1,class:"footer",textContent:(0,n.zw)((0,i.SU)(W))},null,8,y))],64)):(0,a.kq)("",!0)],8,h)}}}),D=e=>!(0,s.ak)(e)||/github\.com/.test(e)?"GitHub":/bitbucket\.org/.test(e)?"Bitbucket":/gitlab\.com/.test(e)?"GitLab":/gitee\.com/.test(e)?"Gitee":null,F={GitHub:":repo/edit/:branch/:path",GitLab:":repo/-/edit/:branch/:path",Gitee:":repo/edit/:branch/:path",Bitbucket:":repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default"},W=(0,a.aZ)({__name:"DropdownTransition",setup(e){const l=e=>{e.style.height=e.scrollHeight+"px"},t=e=>{e.style.height=""};return(e,n)=>((0,a.wg)(),(0,a.j4)(u.uT,{name:"dropdown",onEnter:l,onAfterEnter:t,onBeforeLeave:l},{default:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"default")])),_:3}))}}),x=["aria-label"],I={class:"title"},L=(0,a._)("span",{class:"arrow down"},null,-1),C=["aria-label"],$={class:"title"},H={class:"nav-dropdown"},j={class:"dropdown-subtitle"},z={key:1},q={class:"dropdown-subitem-wrapper"},T=(0,a.aZ)({__name:"DropdownLink",props:{item:{type:Object,required:!0}},setup(e){const l=e,{item:t}=(0,i.BK)(l),r=(0,a.Fl)((()=>t.value.ariaLabel||t.value.text)),s=(0,i.iH)(!1),c=(0,o.yj)();(0,a.YP)((()=>c.path),(()=>{s.value=!1}));const v=e=>{const l=0===e.detail;s.value=!!l&&!s.value},d=(e,l)=>l[l.length-1]===e;return(e,l)=>((0,a.wg)(),(0,a.iD)("div",{class:(0,n.C_)(["dropdown-wrapper",{open:s.value}])},[(0,a._)("button",{class:"dropdown-title",type:"button","aria-label":(0,i.SU)(r),onClick:v},[(0,a._)("span",I,(0,n.zw)((0,i.SU)(t).text),1),L],8,x),(0,a._)("button",{class:"mobile-dropdown-title",type:"button","aria-label":(0,i.SU)(r),onClick:l[0]||(l[0]=e=>s.value=!s.value)},[(0,a._)("span",$,(0,n.zw)((0,i.SU)(t).text),1),(0,a._)("span",{class:(0,n.C_)(["arrow",s.value?"down":"right"])},null,2)],8,C),(0,a.Wm)(W,null,{default:(0,a.w5)((()=>[(0,a.wy)((0,a._)("ul",H,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,i.SU)(t).children,((e,l)=>((0,a.wg)(),(0,a.iD)("li",{key:e.link||l,class:"dropdown-item"},[e.children?((0,a.wg)(),(0,a.iD)(a.HY,{key:0},[(0,a._)("h4",j,[e.link?((0,a.wg)(),(0,a.j4)(p,{key:0,item:e,onFocusout:l=>d(e,(0,i.SU)(t).children)&&0===e.children.length&&(s.value=!1)},null,8,["item","onFocusout"])):((0,a.wg)(),(0,a.iD)("span",z,(0,n.zw)(e.text),1))]),(0,a._)("ul",q,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(e.children,(l=>((0,a.wg)(),(0,a.iD)("li",{key:l.link,class:"dropdown-subitem"},[(0,a.Wm)(p,{item:l,onFocusout:a=>d(l,e.children)&&d(e,(0,i.SU)(t).children)&&(s.value=!1)},null,8,["item","onFocusout"])])))),128))])],64)):((0,a.wg)(),(0,a.j4)(p,{key:1,item:e,onFocusout:l=>d(e,(0,i.SU)(t).children)&&(s.value=!1)},null,8,["item","onFocusout"]))])))),128))],512),[[u.F8,s.value]])])),_:1})],2))}}),M={key:0,class:"navbar-links"},B=(0,a.aZ)({__name:"NavbarLinks",setup(e){const l=e=>(0,s.HD)(e)?(0,c.sC)(e):e.children?{...e,children:e.children.map(l)}:e,t=(()=>{const e=(0,c.X6)();return(0,a.Fl)((()=>(e.value.navbar||[]).map(l)))})(),n=(()=>{const e=(0,o.tv)(),l=(0,r.I)(),t=(0,r.I5)(),n=(0,c.X6)();return(0,a.Fl)((()=>{var a,i;const u=Object.keys(t.value.locales);if(u.length<2)return[];const r=e.currentRoute.value.path,o=e.currentRoute.value.fullPath;return[{text:null!=(a=n.value.selectLanguageText)?a:"unkown language",ariaLabel:null!=(i=n.value.selectLanguageAriaLabel)?i:"unkown language",children:u.map((a=>{var i,u,s,c,v,d;const p=null!=(u=null==(i=t.value.locales)?void 0:i[a])?u:{},h=null!=(c=null==(s=n.value.locales)?void 0:s[a])?c:{},g=`${p.lang}`,m=null!=(v=h.selectLanguageName)?v:g;let k;if(g===t.value.lang)k=o;else{const t=r.replace(l.value,a);k=e.getRoutes().some((e=>e.path===t))?t:null!=(d=h.home)?d:a}return{text:m,link:k}}))}]}))})(),u=(()=>{const e=(0,c.X6)(),l=(0,a.Fl)((()=>e.value.repo)),t=(0,a.Fl)((()=>l.value?D(l.value):null)),n=(0,a.Fl)((()=>l.value&&!(0,s.ak)(l.value)?`https://github.com/${l.value}`:l.value)),i=(0,a.Fl)((()=>n.value?e.value.repoLabel?e.value.repoLabel:null===t.value?"Source":t.value:null));return(0,a.Fl)((()=>n.value&&i.value?[{text:i.value,link:n.value}]:[]))})(),v=(0,a.Fl)((()=>[...t.value,...n.value,...u.value]));return(e,l)=>(0,i.SU)(v).length?((0,a.wg)(),(0,a.iD)("nav",M,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,i.SU)(v),(e=>((0,a.wg)(),(0,a.iD)("div",{key:e.text,class:"navbar-links-item"},[e.children?((0,a.wg)(),(0,a.j4)(T,{key:0,item:e},null,8,["item"])):((0,a.wg)(),(0,a.j4)(p,{key:1,item:e},null,8,["item"]))])))),128))])):(0,a.kq)("",!0)}}),P=["title"],R={class:"icon",focusable:"false",viewBox:"0 0 32 32"},Y=[(0,a.uE)('',9)],Z={class:"icon",focusable:"false",viewBox:"0 0 32 32"},X=[(0,a._)("path",{d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z",fill:"currentColor"},null,-1)],N=(0,a.aZ)({__name:"ToggleDarkModeButton",setup(e){const l=(0,c.X6)(),t=(0,c.vs)(),n=()=>{t.value=!t.value};return(e,r)=>((0,a.wg)(),(0,a.iD)("button",{class:"toggle-dark-button",title:(0,i.SU)(l).toggleDarkMode,onClick:n},[(0,a.wy)(((0,a.wg)(),(0,a.iD)("svg",R,Y,512)),[[u.F8,!(0,i.SU)(t)]]),(0,a.wy)(((0,a.wg)(),(0,a.iD)("svg",Z,X,512)),[[u.F8,(0,i.SU)(t)]])],8,P))}}),E=["title"],O=[(0,a._)("div",{class:"icon","aria-hidden":"true"},[(0,a._)("span"),(0,a._)("span"),(0,a._)("span")],-1)],K=(0,a.aZ)({__name:"ToggleSidebarButton",emits:["toggle"],setup(e){const l=(0,c.X6)();return(e,t)=>((0,a.wg)(),(0,a.iD)("div",{class:"toggle-sidebar-button",title:(0,i.SU)(l).toggleSidebar,"aria-expanded":"false",role:"button",tabindex:"0",onClick:t[0]||(t[0]=l=>e.$emit("toggle"))},O,8,E))}}),V=["src","alt"],G=(0,a.aZ)({__name:"Navbar",emits:["toggle-sidebar"],setup(e){const l=(0,r.I)(),t=(0,r.I5)(),u=(0,c.X6)(),o=(0,c.vs)(),s=(0,i.iH)(null),v=(0,i.iH)(null),d=(0,a.Fl)((()=>u.value.home||l.value)),p=(0,a.Fl)((()=>o.value&&void 0!==u.value.logoDark?u.value.logoDark:u.value.logo)),h=(0,a.Fl)((()=>t.value.title)),g=(0,i.iH)(0),m=(0,a.Fl)((()=>g.value?{maxWidth:g.value+"px"}:{})),k=(0,a.Fl)((()=>u.value.darkMode));function b(e,l){var t,a,n;const i=null==(n=null==(a=null==(t=null==e?void 0:e.ownerDocument)?void 0:t.defaultView)?void 0:a.getComputedStyle(e,null))?void 0:n[l],u=Number.parseInt(i,10);return Number.isNaN(u)?0:u}return(0,a.bv)((()=>{const e=b(s.value,"paddingLeft")+b(s.value,"paddingRight"),l=()=>{var l;window.innerWidth<=719?g.value=0:g.value=s.value.offsetWidth-e-((null==(l=v.value)?void 0:l.offsetWidth)||0)};l(),window.addEventListener("resize",l,!1),window.addEventListener("orientationchange",l,!1)})),(e,l)=>{const t=(0,a.up)("ClientOnly"),u=(0,a.up)("RouterLink"),o=(0,a.up)("NavbarSearch");return(0,a.wg)(),(0,a.iD)("header",{ref_key:"navbar",ref:s,class:"navbar"},[(0,a.Wm)(K,{onToggle:l[0]||(l[0]=l=>e.$emit("toggle-sidebar"))}),(0,a._)("span",{ref_key:"siteBrand",ref:v},[(0,a.Wm)(u,{to:(0,i.SU)(d)},{default:(0,a.w5)((()=>[(0,a.Wm)(t,null,{default:(0,a.w5)((()=>[(0,i.SU)(p)?((0,a.wg)(),(0,a.iD)("img",{key:0,class:"logo",src:(0,i.SU)(r.pJ)((0,i.SU)(p)),alt:(0,i.SU)(h)},null,8,V)):(0,a.kq)("",!0)])),_:1}),(0,i.SU)(h)?((0,a.wg)(),(0,a.iD)("span",{key:0,class:(0,n.C_)(["site-name",{"can-hide":(0,i.SU)(p)}])},(0,n.zw)((0,i.SU)(h)),3)):(0,a.kq)("",!0)])),_:1},8,["to"])],512),(0,a._)("div",{class:"navbar-links-wrapper",style:(0,n.j5)((0,i.SU)(m))},[(0,a.WI)(e.$slots,"before"),(0,a.Wm)(B,{class:"can-hide"}),(0,a.WI)(e.$slots,"after"),(0,i.SU)(k)?((0,a.wg)(),(0,a.j4)(N,{key:0})):(0,a.kq)("",!0),(0,a.Wm)(o)],4)],512)}}}),A={class:"page-meta"},J={key:0,class:"meta-item edit-link"},Q={key:1,class:"meta-item last-updated"},ee={class:"meta-item-label"},le={class:"meta-item-info"},te={key:2,class:"meta-item contributors"},ae={class:"meta-item-label"},ne={class:"meta-item-info"},ie=["title"],ue=(0,a.Uk)(", "),re=(0,a.aZ)({__name:"PageMeta",setup(e){const l=(0,c.X6)(),t=(()=>{const e=(0,c.X6)(),l=(0,r.Vi)(),t=(0,r.I2)();return(0,a.Fl)((()=>{var a,n,i;if(null!=(n=null!=(a=t.value.editLink)?a:e.value.editLink)&&!n)return null;const{repo:u,docsRepo:r=u,docsBranch:o="main",docsDir:c="",editLinkText:v}=e.value;if(!r)return null;const d=(({docsRepo:e,docsBranch:l,docsDir:t,filePathRelative:a,editLinkPattern:n})=>{if(!a)return null;const i=(({docsRepo:e,editLinkPattern:l})=>{if(l)return l;const t=D(e);return null!==t?F[t]:null})({docsRepo:e,editLinkPattern:n});return i?i.replace(/:repo/,(0,s.ak)(e)?e:`https://github.com/${e}`).replace(/:branch/,l).replace(/:path/,(0,s.FY)(`${(0,s.U1)(t)}/${a}`)):null})({docsRepo:r,docsBranch:o,docsDir:c,filePathRelative:l.value.filePathRelative,editLinkPattern:null!=(i=t.value.editLinkPattern)?i:e.value.editLinkPattern});return d?{text:null!=v?v:"Edit this page",link:d}:null}))})(),u=(()=>{(0,r.I5)();const e=(0,c.X6)(),l=(0,r.Vi)(),t=(0,r.I2)();return(0,a.Fl)((()=>{var a,n,i,u;return(null==(n=null!=(a=t.value.lastUpdated)?a:e.value.lastUpdated)||n)&&(null==(i=l.value.git)?void 0:i.updatedTime)?new Date(null==(u=l.value.git)?void 0:u.updatedTime).toLocaleString():null}))})(),o=(()=>{const e=(0,c.X6)(),l=(0,r.Vi)(),t=(0,r.I2)();return(0,a.Fl)((()=>{var a,n,i,u;return null!=(n=null!=(a=t.value.contributors)?a:e.value.contributors)&&!n||null==(u=null==(i=l.value.git)?void 0:i.contributors)?null:u}))})();return(e,r)=>{const s=(0,a.up)("ClientOnly");return(0,a.wg)(),(0,a.iD)("footer",A,[(0,i.SU)(t)?((0,a.wg)(),(0,a.iD)("div",J,[(0,a.Wm)(p,{class:"meta-item-label",item:(0,i.SU)(t)},null,8,["item"])])):(0,a.kq)("",!0),(0,i.SU)(u)?((0,a.wg)(),(0,a.iD)("div",Q,[(0,a._)("span",ee,(0,n.zw)((0,i.SU)(l).lastUpdatedText)+": ",1),(0,a.Wm)(s,null,{default:(0,a.w5)((()=>[(0,a._)("span",le,(0,n.zw)((0,i.SU)(u)),1)])),_:1})])):(0,a.kq)("",!0),(0,i.SU)(o)&&(0,i.SU)(o).length?((0,a.wg)(),(0,a.iD)("div",te,[(0,a._)("span",ae,(0,n.zw)((0,i.SU)(l).contributorsText)+": ",1),(0,a._)("span",ne,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,i.SU)(o),((e,l)=>((0,a.wg)(),(0,a.iD)(a.HY,{key:l},[(0,a._)("span",{class:"contributor",title:`email: ${e.email}`},(0,n.zw)(e.name),9,ie),l!==(0,i.SU)(o).length-1?((0,a.wg)(),(0,a.iD)(a.HY,{key:0},[ue],64)):(0,a.kq)("",!0)],64)))),128))])])):(0,a.kq)("",!0)])}}}),oe={key:0,class:"page-nav"},se={class:"inner"},ce={key:0,class:"prev"},ve={key:1,class:"next"},de=(0,a.aZ)({__name:"PageNav",setup(e){const l=e=>!1===e?null:(0,s.HD)(e)?(0,c.sC)(e):!!(0,s.PO)(e)&&e,t=(e,l,a)=>{const n=e.findIndex((e=>e.link===l));if(-1!==n){const l=e[n+a];return(null==l?void 0:l.link)?l:null}for(const n of e)if(n.children){const e=t(n.children,l,a);if(e)return e}return null},n=(0,r.I2)(),u=(0,c.VU)(),v=(0,o.yj)(),d=(0,a.Fl)((()=>{const e=l(n.value.prev);return!1!==e?e:t(u.value,v.path,-1)})),h=(0,a.Fl)((()=>{const e=l(n.value.next);return!1!==e?e:t(u.value,v.path,1)}));return(e,l)=>(0,i.SU)(d)||(0,i.SU)(h)?((0,a.wg)(),(0,a.iD)("nav",oe,[(0,a._)("p",se,[(0,i.SU)(d)?((0,a.wg)(),(0,a.iD)("span",ce,[(0,a.Wm)(p,{item:(0,i.SU)(d)},null,8,["item"])])):(0,a.kq)("",!0),(0,i.SU)(h)?((0,a.wg)(),(0,a.iD)("span",ve,[(0,a.Wm)(p,{item:(0,i.SU)(h)},null,8,["item"])])):(0,a.kq)("",!0)])])):(0,a.kq)("",!0)}}),pe={class:"page"},he={class:"theme-default-content"},ge=(0,a.aZ)({__name:"Page",setup:e=>(e,l)=>{const t=(0,a.up)("Content");return(0,a.wg)(),(0,a.iD)("main",pe,[(0,a.WI)(e.$slots,"top"),(0,a._)("div",he,[(0,a.Wm)(t)]),(0,a.Wm)(re),(0,a.Wm)(de),(0,a.WI)(e.$slots,"bottom")])}}),me=e=>decodeURI(e).replace(/#.*$/,"").replace(/(index)?\.(md|html)$/,""),ke=(e,l)=>!!((e,l)=>void 0!==l&&(e.hash===l||me(e.path)===me(l)))(e,l.link)||!!l.children&&l.children.some((l=>ke(e,l))),be=(e,l)=>e.link?(0,a.h)(p,{...l,item:e}):(0,a.h)("p",l,e.text),we=(e,l)=>{var t;return(null===(t=e.children)||void 0===t?void 0:t.length)?(0,a.h)("ul",{class:{"sidebar-sub-items":l>0}},e.children.map((e=>(0,a.h)("li",(0,a.h)(fe,{item:e,depth:l+1}))))):null},fe=({item:e,depth:l=0})=>{const t=(0,o.yj)(),a=ke(t,e);return[be(e,{class:{"sidebar-heading":0===l,"sidebar-item":!0,active:a}}),we(e,l)]};fe.displayName="SidebarChild",fe.props={item:{type:Object,required:!0},depth:{type:Number,required:!1}};const Ue={class:"sidebar"},Se={class:"sidebar-links"},ye=(0,a.aZ)({__name:"Sidebar",setup(e){const l=(0,c.VU)();return(e,t)=>((0,a.wg)(),(0,a.iD)("aside",Ue,[(0,a.Wm)(B),(0,a.WI)(e.$slots,"top"),(0,a._)("ul",Se,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,i.SU)(l),(e=>((0,a.wg)(),(0,a.j4)((0,i.SU)(fe),{key:e.link||e.text,item:e},null,8,["item"])))),128))]),(0,a.WI)(e.$slots,"bottom")]))}}),_e=(0,a.aZ)({__name:"Layout",setup(e){const l=(0,r.Vi)(),t=(0,r.I2)(),s=(0,c.X6)(),v=(0,a.Fl)((()=>!1!==t.value.navbar&&!1!==s.value.navbar)),d=(0,c.VU)(),p=(0,i.iH)(!1),h=e=>{p.value="boolean"==typeof e?e:!p.value},g={x:0,y:0},m=e=>{g.x=e.changedTouches[0].clientX,g.y=e.changedTouches[0].clientY},k=e=>{const l=e.changedTouches[0].clientX-g.x,t=e.changedTouches[0].clientY-g.y;Math.abs(l)>Math.abs(t)&&Math.abs(l)>40&&(l>0&&g.x<=80?h(!0):h(!1))},b=(0,a.Fl)((()=>[{"no-navbar":!v.value,"no-sidebar":!d.value.length,"sidebar-open":p.value},t.value.pageClass]));let w;(0,a.bv)((()=>{const e=(0,o.tv)();w=e.afterEach((()=>{h(!1)}))})),(0,a.Ah)((()=>{w()}));const f=(0,c.P$)(),U=f.resolve,S=f.pending;return(e,r)=>((0,a.wg)(),(0,a.iD)("div",{class:(0,n.C_)(["theme-container",(0,i.SU)(b)]),onTouchstart:m,onTouchend:k},[(0,a.WI)(e.$slots,"navbar",{},(()=>[(0,i.SU)(v)?((0,a.wg)(),(0,a.j4)(G,{key:0,onToggleSidebar:h},{before:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"navbar-before")])),after:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"navbar-after")])),_:3})):(0,a.kq)("",!0)])),(0,a._)("div",{class:"sidebar-mask",onClick:r[0]||(r[0]=e=>h(!1))}),(0,a.WI)(e.$slots,"sidebar",{},(()=>[(0,a.Wm)(ye,null,{top:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"sidebar-top")])),bottom:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"sidebar-bottom")])),_:3})])),(0,a.WI)(e.$slots,"page",{},(()=>[(0,i.SU)(t).home?((0,a.wg)(),(0,a.j4)(_,{key:0})):((0,a.wg)(),(0,a.j4)(u.uT,{key:1,name:"fade-slide-y",mode:"out-in",onBeforeEnter:(0,i.SU)(U),onBeforeLeave:(0,i.SU)(S)},{default:(0,a.w5)((()=>[((0,a.wg)(),(0,a.j4)(ge,{key:(0,i.SU)(l).path},{top:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"page-top")])),bottom:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"page-bottom")])),_:3}))])),_:3},8,["onBeforeEnter","onBeforeLeave"]))]))],34))}})}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[293],{3293:(e,l,t)=>{t.r(l),t.d(l,{default:()=>ye});var a=t(6252),n=t(3577),i=t(2262),u=t(9963),r=t(7621),o=t(2201),s=t(7788),c=t(5885);const v=["href","rel","target","aria-label"],d=(0,a.aZ)({inheritAttrs:!1}),p=(0,a.aZ)({...d,__name:"NavLink",props:{item:{type:Object,required:!0}},setup(e){const l=e,t=(0,o.yj)(),u=(0,r.WF)(),{item:c}=(0,i.BK)(l),d=(0,a.Fl)((()=>(0,s.ak)(c.value.link))),p=(0,a.Fl)((()=>(0,s.B2)(c.value.link)||(0,s.R5)(c.value.link))),h=(0,a.Fl)((()=>{if(!p.value)return c.value.target?c.value.target:d.value?"_blank":void 0})),g=(0,a.Fl)((()=>"_blank"===h.value)),m=(0,a.Fl)((()=>!d.value&&!p.value&&!g.value)),k=(0,a.Fl)((()=>{if(!p.value)return c.value.rel?c.value.rel:g.value?"noopener noreferrer":void 0})),b=(0,a.Fl)((()=>c.value.ariaLabel||c.value.text)),w=(0,a.Fl)((()=>{const e=Object.keys(u.value.locales);return e.length?!e.some((e=>e===c.value.link)):"/"!==c.value.link})),f=(0,a.Fl)((()=>!!w.value&&t.path.startsWith(c.value.link))),U=(0,a.Fl)((()=>!!m.value&&(c.value.activeMatch?new RegExp(c.value.activeMatch).test(t.path):f.value)));return(e,l)=>{const t=(0,a.up)("RouterLink"),u=(0,a.up)("OutboundLink");return(0,i.SU)(m)?((0,a.wg)(),(0,a.j4)(t,(0,a.dG)({key:0,class:["nav-link",{"router-link-active":(0,i.SU)(U)}],to:(0,i.SU)(c).link,"aria-label":(0,i.SU)(b)},e.$attrs),{default:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"before"),(0,a.Uk)(" "+(0,n.zw)((0,i.SU)(c).text)+" ",1),(0,a.WI)(e.$slots,"after")])),_:3},16,["class","to","aria-label"])):((0,a.wg)(),(0,a.iD)("a",(0,a.dG)({key:1,class:"nav-link external",href:(0,i.SU)(c).link,rel:(0,i.SU)(k),target:(0,i.SU)(h),"aria-label":(0,i.SU)(b)},e.$attrs),[(0,a.WI)(e.$slots,"before"),(0,a.Uk)(" "+(0,n.zw)((0,i.SU)(c).text)+" ",1),(0,i.SU)(g)?((0,a.wg)(),(0,a.j4)(u,{key:0})):(0,a.kq)("",!0),(0,a.WI)(e.$slots,"after")],16,v))}}}),h=["aria-labelledby"],g={class:"hero"},m=["src","alt"],k={key:0,id:"main-title"},b={key:1,class:"description"},w={key:2,class:"actions"},f={key:0,class:"features"},U={class:"theme-default-content custom"},S=["innerHTML"],y=["textContent"],_=(0,a.aZ)({__name:"Home",setup(e){const l=(0,r.I2)(),t=(0,r.I5)(),u=(0,c.vs)(),o=(0,a.Fl)((()=>u.value&&void 0!==l.value.heroImageDark?l.value.heroImageDark:l.value.heroImage)),v=(0,a.Fl)((()=>null===l.value.heroText?null:l.value.heroText||t.value.title||"Hello")),d=(0,a.Fl)((()=>l.value.heroAlt||v.value||"hero")),_=(0,a.Fl)((()=>null===l.value.tagline?null:l.value.tagline||t.value.description||"Welcome to your VuePress site")),D=(0,a.Fl)((()=>(0,s.kJ)(l.value.actions)?l.value.actions.map((({text:e,link:l,type:t="primary"})=>({text:e,link:l,type:t}))):[])),F=(0,a.Fl)((()=>(0,s.kJ)(l.value.features)?l.value.features:[])),W=(0,a.Fl)((()=>l.value.footer)),x=(0,a.Fl)((()=>l.value.footerHtml));return(e,l)=>{const t=(0,a.up)("ClientOnly"),u=(0,a.up)("Content");return(0,a.wg)(),(0,a.iD)("main",{class:"home","aria-labelledby":(0,i.SU)(v)?"main-title":void 0},[(0,a._)("header",g,[(0,a.Wm)(t,null,{default:(0,a.w5)((()=>[(0,i.SU)(o)?((0,a.wg)(),(0,a.iD)("img",{key:0,src:(0,i.SU)(r.pJ)((0,i.SU)(o)),alt:(0,i.SU)(d)},null,8,m)):(0,a.kq)("",!0)])),_:1}),(0,i.SU)(v)?((0,a.wg)(),(0,a.iD)("h1",k,(0,n.zw)((0,i.SU)(v)),1)):(0,a.kq)("",!0),(0,i.SU)(_)?((0,a.wg)(),(0,a.iD)("p",b,(0,n.zw)((0,i.SU)(_)),1)):(0,a.kq)("",!0),(0,i.SU)(D).length?((0,a.wg)(),(0,a.iD)("p",w,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,i.SU)(D),(e=>((0,a.wg)(),(0,a.j4)(p,{key:e.text,class:(0,n.C_)(["action-button",[e.type]]),item:e},null,8,["class","item"])))),128))])):(0,a.kq)("",!0)]),(0,i.SU)(F).length?((0,a.wg)(),(0,a.iD)("div",f,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,i.SU)(F),(e=>((0,a.wg)(),(0,a.iD)("div",{key:e.title,class:"feature"},[(0,a._)("h2",null,(0,n.zw)(e.title),1),(0,a._)("p",null,(0,n.zw)(e.details),1)])))),128))])):(0,a.kq)("",!0),(0,a._)("div",U,[(0,a.Wm)(u)]),(0,i.SU)(W)?((0,a.wg)(),(0,a.iD)(a.HY,{key:1},[(0,i.SU)(x)?((0,a.wg)(),(0,a.iD)("div",{key:0,class:"footer",innerHTML:(0,i.SU)(W)},null,8,S)):((0,a.wg)(),(0,a.iD)("div",{key:1,class:"footer",textContent:(0,n.zw)((0,i.SU)(W))},null,8,y))],64)):(0,a.kq)("",!0)],8,h)}}}),D=e=>!(0,s.ak)(e)||/github\.com/.test(e)?"GitHub":/bitbucket\.org/.test(e)?"Bitbucket":/gitlab\.com/.test(e)?"GitLab":/gitee\.com/.test(e)?"Gitee":null,F={GitHub:":repo/edit/:branch/:path",GitLab:":repo/-/edit/:branch/:path",Gitee:":repo/edit/:branch/:path",Bitbucket:":repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default"},W=(0,a.aZ)({__name:"DropdownTransition",setup(e){const l=e=>{e.style.height=e.scrollHeight+"px"},t=e=>{e.style.height=""};return(e,n)=>((0,a.wg)(),(0,a.j4)(u.uT,{name:"dropdown",onEnter:l,onAfterEnter:t,onBeforeLeave:l},{default:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"default")])),_:3}))}}),x=["aria-label"],I={class:"title"},L=(0,a._)("span",{class:"arrow down"},null,-1),C=["aria-label"],$={class:"title"},H={class:"nav-dropdown"},j={class:"dropdown-subtitle"},z={key:1},q={class:"dropdown-subitem-wrapper"},T=(0,a.aZ)({__name:"DropdownLink",props:{item:{type:Object,required:!0}},setup(e){const l=e,{item:t}=(0,i.BK)(l),r=(0,a.Fl)((()=>t.value.ariaLabel||t.value.text)),s=(0,i.iH)(!1),c=(0,o.yj)();(0,a.YP)((()=>c.path),(()=>{s.value=!1}));const v=e=>{const l=0===e.detail;s.value=!!l&&!s.value},d=(e,l)=>l[l.length-1]===e;return(e,l)=>((0,a.wg)(),(0,a.iD)("div",{class:(0,n.C_)(["dropdown-wrapper",{open:s.value}])},[(0,a._)("button",{class:"dropdown-title",type:"button","aria-label":(0,i.SU)(r),onClick:v},[(0,a._)("span",I,(0,n.zw)((0,i.SU)(t).text),1),L],8,x),(0,a._)("button",{class:"mobile-dropdown-title",type:"button","aria-label":(0,i.SU)(r),onClick:l[0]||(l[0]=e=>s.value=!s.value)},[(0,a._)("span",$,(0,n.zw)((0,i.SU)(t).text),1),(0,a._)("span",{class:(0,n.C_)(["arrow",s.value?"down":"right"])},null,2)],8,C),(0,a.Wm)(W,null,{default:(0,a.w5)((()=>[(0,a.wy)((0,a._)("ul",H,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,i.SU)(t).children,((e,l)=>((0,a.wg)(),(0,a.iD)("li",{key:e.link||l,class:"dropdown-item"},[e.children?((0,a.wg)(),(0,a.iD)(a.HY,{key:0},[(0,a._)("h4",j,[e.link?((0,a.wg)(),(0,a.j4)(p,{key:0,item:e,onFocusout:l=>d(e,(0,i.SU)(t).children)&&0===e.children.length&&(s.value=!1)},null,8,["item","onFocusout"])):((0,a.wg)(),(0,a.iD)("span",z,(0,n.zw)(e.text),1))]),(0,a._)("ul",q,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(e.children,(l=>((0,a.wg)(),(0,a.iD)("li",{key:l.link,class:"dropdown-subitem"},[(0,a.Wm)(p,{item:l,onFocusout:a=>d(l,e.children)&&d(e,(0,i.SU)(t).children)&&(s.value=!1)},null,8,["item","onFocusout"])])))),128))])],64)):((0,a.wg)(),(0,a.j4)(p,{key:1,item:e,onFocusout:l=>d(e,(0,i.SU)(t).children)&&(s.value=!1)},null,8,["item","onFocusout"]))])))),128))],512),[[u.F8,s.value]])])),_:1})],2))}}),M={key:0,class:"navbar-links"},B=(0,a.aZ)({__name:"NavbarLinks",setup(e){const l=e=>(0,s.HD)(e)?(0,c.sC)(e):e.children?{...e,children:e.children.map(l)}:e,t=(()=>{const e=(0,c.X6)();return(0,a.Fl)((()=>(e.value.navbar||[]).map(l)))})(),n=(()=>{const e=(0,o.tv)(),l=(0,r.I)(),t=(0,r.I5)(),n=(0,c.X6)();return(0,a.Fl)((()=>{var a,i;const u=Object.keys(t.value.locales);if(u.length<2)return[];const r=e.currentRoute.value.path,o=e.currentRoute.value.fullPath;return[{text:null!=(a=n.value.selectLanguageText)?a:"unkown language",ariaLabel:null!=(i=n.value.selectLanguageAriaLabel)?i:"unkown language",children:u.map((a=>{var i,u,s,c,v,d;const p=null!=(u=null==(i=t.value.locales)?void 0:i[a])?u:{},h=null!=(c=null==(s=n.value.locales)?void 0:s[a])?c:{},g=`${p.lang}`,m=null!=(v=h.selectLanguageName)?v:g;let k;if(g===t.value.lang)k=o;else{const t=r.replace(l.value,a);k=e.getRoutes().some((e=>e.path===t))?t:null!=(d=h.home)?d:a}return{text:m,link:k}}))}]}))})(),u=(()=>{const e=(0,c.X6)(),l=(0,a.Fl)((()=>e.value.repo)),t=(0,a.Fl)((()=>l.value?D(l.value):null)),n=(0,a.Fl)((()=>l.value&&!(0,s.ak)(l.value)?`https://github.com/${l.value}`:l.value)),i=(0,a.Fl)((()=>n.value?e.value.repoLabel?e.value.repoLabel:null===t.value?"Source":t.value:null));return(0,a.Fl)((()=>n.value&&i.value?[{text:i.value,link:n.value}]:[]))})(),v=(0,a.Fl)((()=>[...t.value,...n.value,...u.value]));return(e,l)=>(0,i.SU)(v).length?((0,a.wg)(),(0,a.iD)("nav",M,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,i.SU)(v),(e=>((0,a.wg)(),(0,a.iD)("div",{key:e.text,class:"navbar-links-item"},[e.children?((0,a.wg)(),(0,a.j4)(T,{key:0,item:e},null,8,["item"])):((0,a.wg)(),(0,a.j4)(p,{key:1,item:e},null,8,["item"]))])))),128))])):(0,a.kq)("",!0)}}),P=["title"],R={class:"icon",focusable:"false",viewBox:"0 0 32 32"},Y=[(0,a.uE)('',9)],Z={class:"icon",focusable:"false",viewBox:"0 0 32 32"},X=[(0,a._)("path",{d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z",fill:"currentColor"},null,-1)],N=(0,a.aZ)({__name:"ToggleDarkModeButton",setup(e){const l=(0,c.X6)(),t=(0,c.vs)(),n=()=>{t.value=!t.value};return(e,r)=>((0,a.wg)(),(0,a.iD)("button",{class:"toggle-dark-button",title:(0,i.SU)(l).toggleDarkMode,onClick:n},[(0,a.wy)(((0,a.wg)(),(0,a.iD)("svg",R,Y,512)),[[u.F8,!(0,i.SU)(t)]]),(0,a.wy)(((0,a.wg)(),(0,a.iD)("svg",Z,X,512)),[[u.F8,(0,i.SU)(t)]])],8,P))}}),E=["title"],O=[(0,a._)("div",{class:"icon","aria-hidden":"true"},[(0,a._)("span"),(0,a._)("span"),(0,a._)("span")],-1)],K=(0,a.aZ)({__name:"ToggleSidebarButton",emits:["toggle"],setup(e){const l=(0,c.X6)();return(e,t)=>((0,a.wg)(),(0,a.iD)("div",{class:"toggle-sidebar-button",title:(0,i.SU)(l).toggleSidebar,"aria-expanded":"false",role:"button",tabindex:"0",onClick:t[0]||(t[0]=l=>e.$emit("toggle"))},O,8,E))}}),V=["src","alt"],G=(0,a.aZ)({__name:"Navbar",emits:["toggle-sidebar"],setup(e){const l=(0,r.I)(),t=(0,r.I5)(),u=(0,c.X6)(),o=(0,c.vs)(),s=(0,i.iH)(null),v=(0,i.iH)(null),d=(0,a.Fl)((()=>u.value.home||l.value)),p=(0,a.Fl)((()=>o.value&&void 0!==u.value.logoDark?u.value.logoDark:u.value.logo)),h=(0,a.Fl)((()=>t.value.title)),g=(0,i.iH)(0),m=(0,a.Fl)((()=>g.value?{maxWidth:g.value+"px"}:{})),k=(0,a.Fl)((()=>u.value.darkMode));function b(e,l){var t,a,n;const i=null==(n=null==(a=null==(t=null==e?void 0:e.ownerDocument)?void 0:t.defaultView)?void 0:a.getComputedStyle(e,null))?void 0:n[l],u=Number.parseInt(i,10);return Number.isNaN(u)?0:u}return(0,a.bv)((()=>{const e=b(s.value,"paddingLeft")+b(s.value,"paddingRight"),l=()=>{var l;window.innerWidth<=719?g.value=0:g.value=s.value.offsetWidth-e-((null==(l=v.value)?void 0:l.offsetWidth)||0)};l(),window.addEventListener("resize",l,!1),window.addEventListener("orientationchange",l,!1)})),(e,l)=>{const t=(0,a.up)("ClientOnly"),u=(0,a.up)("RouterLink"),o=(0,a.up)("NavbarSearch");return(0,a.wg)(),(0,a.iD)("header",{ref_key:"navbar",ref:s,class:"navbar"},[(0,a.Wm)(K,{onToggle:l[0]||(l[0]=l=>e.$emit("toggle-sidebar"))}),(0,a._)("span",{ref_key:"siteBrand",ref:v},[(0,a.Wm)(u,{to:(0,i.SU)(d)},{default:(0,a.w5)((()=>[(0,a.Wm)(t,null,{default:(0,a.w5)((()=>[(0,i.SU)(p)?((0,a.wg)(),(0,a.iD)("img",{key:0,class:"logo",src:(0,i.SU)(r.pJ)((0,i.SU)(p)),alt:(0,i.SU)(h)},null,8,V)):(0,a.kq)("",!0)])),_:1}),(0,i.SU)(h)?((0,a.wg)(),(0,a.iD)("span",{key:0,class:(0,n.C_)(["site-name",{"can-hide":(0,i.SU)(p)}])},(0,n.zw)((0,i.SU)(h)),3)):(0,a.kq)("",!0)])),_:1},8,["to"])],512),(0,a._)("div",{class:"navbar-links-wrapper",style:(0,n.j5)((0,i.SU)(m))},[(0,a.WI)(e.$slots,"before"),(0,a.Wm)(B,{class:"can-hide"}),(0,a.WI)(e.$slots,"after"),(0,i.SU)(k)?((0,a.wg)(),(0,a.j4)(N,{key:0})):(0,a.kq)("",!0),(0,a.Wm)(o)],4)],512)}}}),A={class:"page-meta"},J={key:0,class:"meta-item edit-link"},Q={key:1,class:"meta-item last-updated"},ee={class:"meta-item-label"},le={class:"meta-item-info"},te={key:2,class:"meta-item contributors"},ae={class:"meta-item-label"},ne={class:"meta-item-info"},ie=["title"],ue=(0,a.aZ)({__name:"PageMeta",setup(e){const l=(0,c.X6)(),t=(()=>{const e=(0,c.X6)(),l=(0,r.Vi)(),t=(0,r.I2)();return(0,a.Fl)((()=>{var a,n,i;if(null!=(n=null!=(a=t.value.editLink)?a:e.value.editLink)&&!n)return null;const{repo:u,docsRepo:r=u,docsBranch:o="main",docsDir:c="",editLinkText:v}=e.value;if(!r)return null;const d=(({docsRepo:e,docsBranch:l,docsDir:t,filePathRelative:a,editLinkPattern:n})=>{if(!a)return null;const i=(({docsRepo:e,editLinkPattern:l})=>{if(l)return l;const t=D(e);return null!==t?F[t]:null})({docsRepo:e,editLinkPattern:n});return i?i.replace(/:repo/,(0,s.ak)(e)?e:`https://github.com/${e}`).replace(/:branch/,l).replace(/:path/,(0,s.FY)(`${(0,s.U1)(t)}/${a}`)):null})({docsRepo:r,docsBranch:o,docsDir:c,filePathRelative:l.value.filePathRelative,editLinkPattern:null!=(i=t.value.editLinkPattern)?i:e.value.editLinkPattern});return d?{text:null!=v?v:"Edit this page",link:d}:null}))})(),u=(()=>{(0,r.I5)();const e=(0,c.X6)(),l=(0,r.Vi)(),t=(0,r.I2)();return(0,a.Fl)((()=>{var a,n,i,u;return(null==(n=null!=(a=t.value.lastUpdated)?a:e.value.lastUpdated)||n)&&(null==(i=l.value.git)?void 0:i.updatedTime)?new Date(null==(u=l.value.git)?void 0:u.updatedTime).toLocaleString():null}))})(),o=(()=>{const e=(0,c.X6)(),l=(0,r.Vi)(),t=(0,r.I2)();return(0,a.Fl)((()=>{var a,n,i,u;return null!=(n=null!=(a=t.value.contributors)?a:e.value.contributors)&&!n||null==(u=null==(i=l.value.git)?void 0:i.contributors)?null:u}))})();return(e,r)=>{const s=(0,a.up)("ClientOnly");return(0,a.wg)(),(0,a.iD)("footer",A,[(0,i.SU)(t)?((0,a.wg)(),(0,a.iD)("div",J,[(0,a.Wm)(p,{class:"meta-item-label",item:(0,i.SU)(t)},null,8,["item"])])):(0,a.kq)("",!0),(0,i.SU)(u)?((0,a.wg)(),(0,a.iD)("div",Q,[(0,a._)("span",ee,(0,n.zw)((0,i.SU)(l).lastUpdatedText)+": ",1),(0,a.Wm)(s,null,{default:(0,a.w5)((()=>[(0,a._)("span",le,(0,n.zw)((0,i.SU)(u)),1)])),_:1})])):(0,a.kq)("",!0),(0,i.SU)(o)&&(0,i.SU)(o).length?((0,a.wg)(),(0,a.iD)("div",te,[(0,a._)("span",ae,(0,n.zw)((0,i.SU)(l).contributorsText)+": ",1),(0,a._)("span",ne,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,i.SU)(o),((e,l)=>((0,a.wg)(),(0,a.iD)(a.HY,{key:l},[(0,a._)("span",{class:"contributor",title:`email: ${e.email}`},(0,n.zw)(e.name),9,ie),l!==(0,i.SU)(o).length-1?((0,a.wg)(),(0,a.iD)(a.HY,{key:0},[(0,a.Uk)(", ")],64)):(0,a.kq)("",!0)],64)))),128))])])):(0,a.kq)("",!0)])}}}),re={key:0,class:"page-nav"},oe={class:"inner"},se={key:0,class:"prev"},ce={key:1,class:"next"},ve=(0,a.aZ)({__name:"PageNav",setup(e){const l=e=>!1===e?null:(0,s.HD)(e)?(0,c.sC)(e):!!(0,s.PO)(e)&&e,t=(e,l,a)=>{const n=e.findIndex((e=>e.link===l));if(-1!==n){const l=e[n+a];return(null==l?void 0:l.link)?l:null}for(const n of e)if(n.children){const e=t(n.children,l,a);if(e)return e}return null},n=(0,r.I2)(),u=(0,c.VU)(),v=(0,o.yj)(),d=(0,a.Fl)((()=>{const e=l(n.value.prev);return!1!==e?e:t(u.value,v.path,-1)})),h=(0,a.Fl)((()=>{const e=l(n.value.next);return!1!==e?e:t(u.value,v.path,1)}));return(e,l)=>(0,i.SU)(d)||(0,i.SU)(h)?((0,a.wg)(),(0,a.iD)("nav",re,[(0,a._)("p",oe,[(0,i.SU)(d)?((0,a.wg)(),(0,a.iD)("span",se,[(0,a.Wm)(p,{item:(0,i.SU)(d)},null,8,["item"])])):(0,a.kq)("",!0),(0,i.SU)(h)?((0,a.wg)(),(0,a.iD)("span",ce,[(0,a.Wm)(p,{item:(0,i.SU)(h)},null,8,["item"])])):(0,a.kq)("",!0)])])):(0,a.kq)("",!0)}}),de={class:"page"},pe={class:"theme-default-content"},he=(0,a.aZ)({__name:"Page",setup:e=>(e,l)=>{const t=(0,a.up)("Content");return(0,a.wg)(),(0,a.iD)("main",de,[(0,a.WI)(e.$slots,"top"),(0,a._)("div",pe,[(0,a.Wm)(t)]),(0,a.Wm)(ue),(0,a.Wm)(ve),(0,a.WI)(e.$slots,"bottom")])}}),ge=e=>decodeURI(e).replace(/#.*$/,"").replace(/(index)?\.(md|html)$/,""),me=(e,l)=>!!((e,l)=>void 0!==l&&(e.hash===l||ge(e.path)===ge(l)))(e,l.link)||!!l.children&&l.children.some((l=>me(e,l))),ke=(e,l)=>e.link?(0,a.h)(p,{...l,item:e}):(0,a.h)("p",l,e.text),be=(e,l)=>{var t;return(null===(t=e.children)||void 0===t?void 0:t.length)?(0,a.h)("ul",{class:{"sidebar-sub-items":l>0}},e.children.map((e=>(0,a.h)("li",(0,a.h)(we,{item:e,depth:l+1}))))):null},we=({item:e,depth:l=0})=>{const t=(0,o.yj)(),a=me(t,e);return[ke(e,{class:{"sidebar-heading":0===l,"sidebar-item":!0,active:a}}),be(e,l)]};we.displayName="SidebarChild",we.props={item:{type:Object,required:!0},depth:{type:Number,required:!1}};const fe={class:"sidebar"},Ue={class:"sidebar-links"},Se=(0,a.aZ)({__name:"Sidebar",setup(e){const l=(0,c.VU)();return(e,t)=>((0,a.wg)(),(0,a.iD)("aside",fe,[(0,a.Wm)(B),(0,a.WI)(e.$slots,"top"),(0,a._)("ul",Ue,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,i.SU)(l),(e=>((0,a.wg)(),(0,a.j4)((0,i.SU)(we),{key:e.link||e.text,item:e},null,8,["item"])))),128))]),(0,a.WI)(e.$slots,"bottom")]))}}),ye=(0,a.aZ)({__name:"Layout",setup(e){const l=(0,r.Vi)(),t=(0,r.I2)(),s=(0,c.X6)(),v=(0,a.Fl)((()=>!1!==t.value.navbar&&!1!==s.value.navbar)),d=(0,c.VU)(),p=(0,i.iH)(!1),h=e=>{p.value="boolean"==typeof e?e:!p.value},g={x:0,y:0},m=e=>{g.x=e.changedTouches[0].clientX,g.y=e.changedTouches[0].clientY},k=e=>{const l=e.changedTouches[0].clientX-g.x,t=e.changedTouches[0].clientY-g.y;Math.abs(l)>Math.abs(t)&&Math.abs(l)>40&&(l>0&&g.x<=80?h(!0):h(!1))},b=(0,a.Fl)((()=>[{"no-navbar":!v.value,"no-sidebar":!d.value.length,"sidebar-open":p.value},t.value.pageClass]));let w;(0,a.bv)((()=>{const e=(0,o.tv)();w=e.afterEach((()=>{h(!1)}))})),(0,a.Ah)((()=>{w()}));const f=(0,c.P$)(),U=f.resolve,S=f.pending;return(e,r)=>((0,a.wg)(),(0,a.iD)("div",{class:(0,n.C_)(["theme-container",(0,i.SU)(b)]),onTouchstart:m,onTouchend:k},[(0,a.WI)(e.$slots,"navbar",{},(()=>[(0,i.SU)(v)?((0,a.wg)(),(0,a.j4)(G,{key:0,onToggleSidebar:h},{before:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"navbar-before")])),after:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"navbar-after")])),_:3})):(0,a.kq)("",!0)])),(0,a._)("div",{class:"sidebar-mask",onClick:r[0]||(r[0]=e=>h(!1))}),(0,a.WI)(e.$slots,"sidebar",{},(()=>[(0,a.Wm)(Se,null,{top:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"sidebar-top")])),bottom:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"sidebar-bottom")])),_:3})])),(0,a.WI)(e.$slots,"page",{},(()=>[(0,i.SU)(t).home?((0,a.wg)(),(0,a.j4)(_,{key:0})):((0,a.wg)(),(0,a.j4)(u.uT,{key:1,name:"fade-slide-y",mode:"out-in",onBeforeEnter:(0,i.SU)(U),onBeforeLeave:(0,i.SU)(S)},{default:(0,a.w5)((()=>[((0,a.wg)(),(0,a.j4)(he,{key:(0,i.SU)(l).path},{top:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"page-top")])),bottom:(0,a.w5)((()=>[(0,a.WI)(e.$slots,"page-bottom")])),_:3}))])),_:3},8,["onBeforeEnter","onBeforeLeave"]))]))],34))}})}}]); \ No newline at end of file diff --git a/assets/js/399.ae8be0a6.js b/assets/js/399.ae8be0a6.js new file mode 100644 index 00000000..8fe473ac --- /dev/null +++ b/assets/js/399.ae8be0a6.js @@ -0,0 +1,2 @@ +/*! For license information please see 399.ae8be0a6.js.LICENSE.txt */ +(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[399],{2262:(e,t,n)=>{"use strict";n.d(t,{BK:()=>Me,Bj:()=>i,EB:()=>c,Fl:()=>qe,IU:()=>Se,Jd:()=>w,OT:()=>ye,PG:()=>ge,SU:()=>Te,Um:()=>ve,WL:()=>Le,X$:()=>P,X3:()=>we,XI:()=>Ae,Xl:()=>Ee,dq:()=>Ie,iH:()=>xe,j:()=>E,lk:()=>S,nZ:()=>l,qj:()=>me,qq:()=>_,yT:()=>Oe});var r=n(3577);let o;class i{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=o,!e&&o&&(this.index=(o.scopes||(o.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=o;try{return o=this,e()}finally{o=t}}}on(){o=this}off(){o=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t{const t=new Set(e);return t.w=0,t.n=0,t},s=e=>(e.w&d)>0,u=e=>(e.n&d)>0,f=new WeakMap;let p=0,d=1;const h=30;let m;const v=Symbol(""),y=Symbol("");class _{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,function(e,t=o){t&&t.active&&t.effects.push(e)}(this,n)}run(){if(!this.active)return this.fn();let e=m,t=b;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=m,m=this,b=!0,d=1<<++p,p<=h?(({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r{("length"===n||n>=e)&&s.push(t)}))}else switch(void 0!==n&&s.push(c.get(n)),t){case"add":(0,r.kJ)(e)?(0,r.S0)(n)&&s.push(c.get("length")):(s.push(c.get(v)),(0,r._N)(e)&&s.push(c.get(y)));break;case"delete":(0,r.kJ)(e)||(s.push(c.get(v)),(0,r._N)(e)&&s.push(c.get(y)));break;case"set":(0,r._N)(e)&&s.push(c.get(v))}if(1===s.length)s[0]&&k(s[0]);else{const e=[];for(const t of s)t&&e.push(...t);k(a(e))}}function k(e,t){const n=(0,r.kJ)(e)?e:[...e];for(const e of n)e.computed&&C(e);for(const e of n)e.computed||C(e)}function C(e,t){(e!==m||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const I=(0,r.fY)("__proto__,__v_isRef,__isVue"),x=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(r.yk)),A=M(),D=M(!1,!0),N=M(!0),T=R();function R(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=Se(this);for(let e=0,t=this.length;e{e[t]=function(...e){w();const n=Se(this)[t].apply(this,e);return S(),n}})),e}function L(e){const t=Se(this);return E(t,0,e),t.hasOwnProperty(e)}function M(e=!1,t=!1){return function(n,o,i){if("__v_isReactive"===o)return!e;if("__v_isReadonly"===o)return e;if("__v_isShallow"===o)return t;if("__v_raw"===o&&i===(e?t?he:de:t?pe:fe).get(n))return n;const l=(0,r.kJ)(n);if(!e){if(l&&(0,r.RI)(T,o))return Reflect.get(T,o,i);if("hasOwnProperty"===o)return L}const c=Reflect.get(n,o,i);return((0,r.yk)(o)?x.has(o):I(o))?c:(e||E(n,0,o),t?c:Ie(c)?l&&(0,r.S0)(o)?c:c.value:(0,r.Kn)(c)?e?ye(c):me(c):c)}}const F=U(),H=U(!0);function U(e=!1){return function(t,n,o,i){let l=t[n];if(be(l)&&Ie(l)&&!Ie(o))return!1;if(!e&&(Oe(o)||be(o)||(l=Se(l),o=Se(o)),!(0,r.kJ)(t)&&Ie(l)&&!Ie(o)))return l.value=o,!0;const c=(0,r.kJ)(t)&&(0,r.S0)(n)?Number(n)!0,deleteProperty:(e,t)=>!0},$=(0,r.l7)({},z,{get:D,set:H}),B=e=>e,V=e=>Reflect.getPrototypeOf(e);function J(e,t,n=!1,r=!1){const o=Se(e=e.__v_raw),i=Se(t);n||(t!==i&&E(o,0,t),E(o,0,i));const{has:l}=V(o),c=r?B:n?Pe:je;return l.call(o,t)?c(e.get(t)):l.call(o,i)?c(e.get(i)):void(e!==o&&e.get(t))}function W(e,t=!1){const n=this.__v_raw,r=Se(n),o=Se(e);return t||(e!==o&&E(r,0,e),E(r,0,o)),e===o?n.has(e):n.has(e)||n.has(o)}function K(e,t=!1){return e=e.__v_raw,!t&&E(Se(e),0,v),Reflect.get(e,"size",e)}function G(e){e=Se(e);const t=Se(this);return V(t).has.call(t,e)||(t.add(e),P(t,"add",e,e)),this}function Y(e,t){t=Se(t);const n=Se(this),{has:o,get:i}=V(n);let l=o.call(n,e);l||(e=Se(e),l=o.call(n,e));const c=i.call(n,e);return n.set(e,t),l?(0,r.aU)(t,c)&&P(n,"set",e,t):P(n,"add",e,t),this}function Z(e){const t=Se(this),{has:n,get:r}=V(t);let o=n.call(t,e);o||(e=Se(e),o=n.call(t,e)),r&&r.call(t,e);const i=t.delete(e);return o&&P(t,"delete",e,void 0),i}function X(){const e=Se(this),t=0!==e.size,n=e.clear();return t&&P(e,"clear",void 0,void 0),n}function Q(e,t){return function(n,r){const o=this,i=o.__v_raw,l=Se(i),c=t?B:e?Pe:je;return!e&&E(l,0,v),i.forEach(((e,t)=>n.call(r,c(e),c(t),o)))}}function ee(e,t,n){return function(...o){const i=this.__v_raw,l=Se(i),c=(0,r._N)(l),a="entries"===e||e===Symbol.iterator&&c,s="keys"===e&&c,u=i[e](...o),f=n?B:t?Pe:je;return!t&&E(l,0,s?y:v),{next(){const{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:a?[f(e[0]),f(e[1])]:f(e),done:t}},[Symbol.iterator](){return this}}}}function te(e){return function(...t){return"delete"!==e&&this}}function ne(){const e={get(e){return J(this,e)},get size(){return K(this)},has:W,add:G,set:Y,delete:Z,clear:X,forEach:Q(!1,!1)},t={get(e){return J(this,e,!1,!0)},get size(){return K(this)},has:W,add:G,set:Y,delete:Z,clear:X,forEach:Q(!1,!0)},n={get(e){return J(this,e,!0)},get size(){return K(this,!0)},has(e){return W.call(this,e,!0)},add:te("add"),set:te("set"),delete:te("delete"),clear:te("clear"),forEach:Q(!0,!1)},r={get(e){return J(this,e,!0,!0)},get size(){return K(this,!0)},has(e){return W.call(this,e,!0)},add:te("add"),set:te("set"),delete:te("delete"),clear:te("clear"),forEach:Q(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((o=>{e[o]=ee(o,!1,!1),n[o]=ee(o,!0,!1),t[o]=ee(o,!1,!0),r[o]=ee(o,!0,!0)})),[e,n,t,r]}const[re,oe,ie,le]=ne();function ce(e,t){const n=t?e?le:ie:e?oe:re;return(t,o,i)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get((0,r.RI)(n,o)&&o in t?n:t,o,i)}const ae={get:ce(!1,!1)},se={get:ce(!1,!0)},ue={get:ce(!0,!1)},fe=new WeakMap,pe=new WeakMap,de=new WeakMap,he=new WeakMap;function me(e){return be(e)?e:_e(e,!1,z,ae,fe)}function ve(e){return _e(e,!1,$,se,pe)}function ye(e){return _e(e,!0,q,ue,de)}function _e(e,t,n,o,i){if(!(0,r.Kn)(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const l=i.get(e);if(l)return l;const c=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((0,r.W7)(a));var a;if(0===c)return e;const s=new Proxy(e,2===c?o:n);return i.set(e,s),s}function ge(e){return be(e)?ge(e.__v_raw):!(!e||!e.__v_isReactive)}function be(e){return!(!e||!e.__v_isReadonly)}function Oe(e){return!(!e||!e.__v_isShallow)}function we(e){return ge(e)||be(e)}function Se(e){const t=e&&e.__v_raw;return t?Se(t):e}function Ee(e){return(0,r.Nj)(e,"__v_skip",!0),e}const je=e=>(0,r.Kn)(e)?me(e):e,Pe=e=>(0,r.Kn)(e)?ye(e):e;function ke(e){b&&m&&j((e=Se(e)).dep||(e.dep=a()))}function Ce(e,t){const n=(e=Se(e)).dep;n&&k(n)}function Ie(e){return!(!e||!0!==e.__v_isRef)}function xe(e){return De(e,!1)}function Ae(e){return De(e,!0)}function De(e,t){return Ie(e)?e:new Ne(e,t)}class Ne{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:Se(e),this._value=t?e:je(e)}get value(){return ke(this),this._value}set value(e){const t=this.__v_isShallow||Oe(e)||be(e);e=t?e:Se(e),(0,r.aU)(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:je(e),Ce(this))}}function Te(e){return Ie(e)?e.value:e}const Re={get:(e,t,n)=>Te(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Ie(o)&&!Ie(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function Le(e){return ge(e)?e:new Proxy(e,Re)}function Me(e){const t=(0,r.kJ)(e)?new Array(e.length):{};for(const n in e)t[n]=He(e,n);return t}class Fe{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=Se(this._object),t=this._key,null===(n=f.get(e))||void 0===n?void 0:n.get(t);var e,t,n}}function He(e,t,n){const r=e[t];return Ie(r)?r:new Fe(e,t,n)}var Ue;class ze{constructor(e,t,n,r){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this[Ue]=!1,this._dirty=!0,this.effect=new _(e,(()=>{this._dirty||(this._dirty=!0,Ce(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=n}get value(){const e=Se(this);return ke(e),!e._dirty&&e._cacheable||(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function qe(e,t,n=!1){let o,i;const l=(0,r.mf)(e);return l?(o=e,i=r.dG):(o=e.get,i=e.set),new ze(o,i,l||!i,n)}Ue="__v_isReadonly"},6252:(e,t,n)=>{"use strict";n.d(t,{$d:()=>l,Ah:()=>ve,Eo:()=>dt,FN:()=>Wt,Fl:()=>rn,HY:()=>vt,JJ:()=>M,Jd:()=>me,Ko:()=>ke,P$:()=>W,Q6:()=>Q,RC:()=>ne,U2:()=>G,Uk:()=>Lt,WI:()=>Ce,Wm:()=>Tt,Y3:()=>y,Y8:()=>V,YP:()=>U,_:()=>Nt,aZ:()=>ee,bv:()=>pe,dG:()=>qt,f3:()=>F,h:()=>on,iD:()=>Pt,ic:()=>he,j4:()=>kt,kq:()=>Ft,nK:()=>X,uE:()=>Mt,up:()=>Ee,w5:()=>A,wg:()=>wt,wy:()=>Oe});var r=n(2262),o=n(3577);function i(e,t,n,r){let o;try{o=r?e(...r):e()}catch(e){c(e,t,n)}return o}function l(e,t,n,r){if((0,o.mf)(e)){const l=i(e,t,n,r);return l&&(0,o.tI)(l)&&l.catch((e=>{c(e,t,n)})),l}const a=[];for(let o=0;o>>1;w(u[r])w(e)-w(t))),h=0;hnull==e.id?1/0:e.id,S=(e,t)=>{const n=w(e)-w(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function E(e){s=!1,a=!0,u.sort(S),o.dG;try{for(f=0;f(0,o.HD)(e)?e.trim():e))),t&&(i=n.map(o.h5))}let s,u=r[s=(0,o.hR)(t)]||r[s=(0,o.hR)((0,o._A)(t))];!u&&c&&(u=r[s=(0,o.hR)((0,o.rs)(t))]),u&&l(u,e,6,i);const f=r[s+"Once"];if(f){if(e.emitted){if(e.emitted[s])return}else e.emitted={};e.emitted[s]=!0,l(f,e,6,i)}}function P(e,t,n=!1){const r=t.emitsCache,i=r.get(e);if(void 0!==i)return i;const l=e.emits;let c={},a=!1;if(!(0,o.mf)(e)){const r=e=>{const n=P(e,t,!0);n&&(a=!0,(0,o.l7)(c,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return l||a?((0,o.kJ)(l)?l.forEach((e=>c[e]=null)):(0,o.l7)(c,l),(0,o.Kn)(e)&&r.set(e,c),c):((0,o.Kn)(e)&&r.set(e,null),null)}function k(e,t){return!(!e||!(0,o.F7)(t))&&(t=t.slice(2).replace(/Once$/,""),(0,o.RI)(e,t[0].toLowerCase()+t.slice(1))||(0,o.RI)(e,(0,o.rs)(t))||(0,o.RI)(e,t))}new Set,new Map;let C=null,I=null;function x(e){const t=C;return C=e,I=e&&e.type.__scopeId||null,t}function A(e,t=C,n){if(!t)return e;if(e._n)return e;const r=(...n)=>{r._d&&Et(-1);const o=x(t);let i;try{i=e(...n)}finally{x(o),r._d&&Et(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function D(e){const{type:t,vnode:n,proxy:r,withProxy:i,props:l,propsOptions:[a],slots:s,attrs:u,emit:f,render:p,renderCache:d,data:h,setupState:m,ctx:v,inheritAttrs:y}=e;let _,g;const b=x(e);try{if(4&n.shapeFlag){const e=i||r;_=Ht(p.call(e,e,d,l,m,h,v)),g=u}else{const e=t;_=Ht(e.length>1?e(l,{attrs:u,slots:s,emit:f}):e(l,null)),g=t.props?u:N(u)}}catch(t){bt.length=0,c(t,e,1),_=Tt(_t)}let O=_;if(g&&!1!==y){const e=Object.keys(g),{shapeFlag:t}=O;e.length&&7&t&&(a&&e.some(o.tR)&&(g=T(g,a)),O=Rt(O,g))}return n.dirs&&(O=Rt(O),O.dirs=O.dirs?O.dirs.concat(n.dirs):n.dirs),n.transition&&(O.transition=n.transition),_=O,x(b),_}const N=e=>{let t;for(const n in e)("class"===n||"style"===n||(0,o.F7)(n))&&((t||(t={}))[n]=e[n]);return t},T=(e,t)=>{const n={};for(const r in e)(0,o.tR)(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function R(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o1)return n&&(0,o.mf)(t)?t.call(r.proxy):t}}const H={};function U(e,t,n){return z(e,t,n)}function z(e,t,{immediate:n,deep:c,flush:a,onTrack:s,onTrigger:u}=o.kT){const f=(0,r.nZ)()===(null==Jt?void 0:Jt.scope)?Jt:null;let p,d,h=!1,m=!1;if((0,r.dq)(e)?(p=()=>e.value,h=(0,r.yT)(e)):(0,r.PG)(e)?(p=()=>e,c=!0):(0,o.kJ)(e)?(m=!0,h=e.some((e=>(0,r.PG)(e)||(0,r.yT)(e))),p=()=>e.map((e=>(0,r.dq)(e)?e.value:(0,r.PG)(e)?B(e):(0,o.mf)(e)?i(e,f,2):void 0))):p=(0,o.mf)(e)?t?()=>i(e,f,2):()=>{if(!f||!f.isUnmounted)return d&&d(),l(e,f,3,[y])}:o.dG,t&&c){const e=p;p=()=>B(e())}let v,y=e=>{d=w.onStop=()=>{i(e,f,4)}};if(Qt){if(y=o.dG,t?n&&l(t,f,3,[p(),m?[]:void 0,y]):p(),"sync"!==a)return o.dG;{const e=cn();v=e.__watcherHandles||(e.__watcherHandles=[])}}let g=m?new Array(e.length).fill(H):H;const b=()=>{if(w.active)if(t){const e=w.run();(c||h||(m?e.some(((e,t)=>(0,o.aU)(e,g[t]))):(0,o.aU)(e,g)))&&(d&&d(),l(t,f,3,[e,g===H?void 0:m&&g[0]===H?[]:g,y]),g=e)}else w.run()};let O;b.allowRecurse=!!t,"sync"===a?O=b:"post"===a?O=()=>pt(b,f&&f.suspense):(b.pre=!0,f&&(b.id=f.uid),O=()=>_(b));const w=new r.qq(p,O);t?n?b():g=w.run():"post"===a?pt(w.run.bind(w),f&&f.suspense):w.run();const S=()=>{w.stop(),f&&f.scope&&(0,o.Od)(f.scope.effects,w)};return v&&v.push(S),S}function q(e,t,n){const r=this.proxy,i=(0,o.HD)(e)?e.includes(".")?$(r,e):()=>r[e]:e.bind(r,r);let l;(0,o.mf)(t)?l=t:(l=t.handler,n=t);const c=Jt;Kt(this);const a=z(i,l.bind(r),n);return c?Kt(c):Gt(),a}function $(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{B(e,t)}));else if((0,o.PO)(e))for(const n in e)B(e[n],t);return e}function V(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return pe((()=>{e.isMounted=!0})),me((()=>{e.isUnmounting=!0})),e}const J=[Function,Array],W={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:J,onEnter:J,onAfterEnter:J,onEnterCancelled:J,onBeforeLeave:J,onLeave:J,onAfterLeave:J,onLeaveCancelled:J,onBeforeAppear:J,onAppear:J,onAfterAppear:J,onAppearCancelled:J},setup(e,{slots:t}){const n=Wt(),o=V();let i;return()=>{const l=t.default&&Q(t.default(),!0);if(!l||!l.length)return;let c=l[0];if(l.length>1){let e=!1;for(const t of l)if(t.type!==_t){c=t,e=!0;break}}const a=(0,r.IU)(e),{mode:s}=a;if(o.isLeaving)return Y(c);const u=Z(c);if(!u)return Y(c);const f=G(u,a,o,n);X(u,f);const p=n.subTree,d=p&&Z(p);let h=!1;const{getTransitionKey:m}=u.type;if(m){const e=m();void 0===i?i=e:e!==i&&(i=e,h=!0)}if(d&&d.type!==_t&&(!It(u,d)||h)){const e=G(d,a,o,n);if(X(d,e),"out-in"===s)return o.isLeaving=!0,e.afterLeave=()=>{o.isLeaving=!1,!1!==n.update.active&&n.update()},Y(c);"in-out"===s&&u.type!==_t&&(e.delayLeave=(e,t,n)=>{K(o,d)[String(d.key)]=d,e._leaveCb=()=>{t(),e._leaveCb=void 0,delete f.delayedLeave},f.delayedLeave=n})}return c}}};function K(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function G(e,t,n,r){const{appear:i,mode:c,persisted:a=!1,onBeforeEnter:s,onEnter:u,onAfterEnter:f,onEnterCancelled:p,onBeforeLeave:d,onLeave:h,onAfterLeave:m,onLeaveCancelled:v,onBeforeAppear:y,onAppear:_,onAfterAppear:g,onAppearCancelled:b}=t,O=String(e.key),w=K(n,e),S=(e,t)=>{e&&l(e,r,9,t)},E=(e,t)=>{const n=t[1];S(e,t),(0,o.kJ)(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},j={mode:c,persisted:a,beforeEnter(t){let r=s;if(!n.isMounted){if(!i)return;r=y||s}t._leaveCb&&t._leaveCb(!0);const o=w[O];o&&It(e,o)&&o.el._leaveCb&&o.el._leaveCb(),S(r,[t])},enter(e){let t=u,r=f,o=p;if(!n.isMounted){if(!i)return;t=_||u,r=g||f,o=b||p}let l=!1;const c=e._enterCb=t=>{l||(l=!0,S(t?o:r,[e]),j.delayedLeave&&j.delayedLeave(),e._enterCb=void 0)};t?E(t,[e,c]):c()},leave(t,r){const o=String(e.key);if(t._enterCb&&t._enterCb(!0),n.isUnmounting)return r();S(d,[t]);let i=!1;const l=t._leaveCb=n=>{i||(i=!0,r(),S(n?v:m,[t]),t._leaveCb=void 0,w[o]===e&&delete w[o])};w[o]=e,h?E(h,[t,l]):l()},clone:e=>G(e,t,n,r)};return j}function Y(e){if(oe(e))return(e=Rt(e)).children=null,e}function Z(e){return oe(e)?e.children?e.children[0]:void 0:e}function X(e,t){6&e.shapeFlag&&e.component?X(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Q(e,t=!1,n){let r=[],o=0;for(let i=0;i1)for(let e=0;e!!e.type.__asyncLoader;function ne(e){(0,o.mf)(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:i,delay:l=200,timeout:a,suspensible:s=!0,onError:u}=e;let f,p=null,d=0;const h=()=>{let e;return p||(e=p=t().catch((e=>{if(e=e instanceof Error?e:new Error(String(e)),u)return new Promise(((t,n)=>{u(e,(()=>t((d++,p=null,h()))),(()=>n(e)),d+1)}));throw e})).then((t=>e!==p&&p?p:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),f=t,t))))};return ee({name:"AsyncComponentWrapper",__asyncLoader:h,get __asyncResolved(){return f},setup(){const e=Jt;if(f)return()=>re(f,e);const t=t=>{p=null,c(t,e,13,!i)};if(s&&e.suspense||Qt)return h().then((t=>()=>re(t,e))).catch((e=>(t(e),()=>i?Tt(i,{error:e}):null)));const o=(0,r.iH)(!1),u=(0,r.iH)(),d=(0,r.iH)(!!l);return l&&setTimeout((()=>{d.value=!1}),l),null!=a&&setTimeout((()=>{if(!o.value&&!u.value){const e=new Error(`Async component timed out after ${a}ms.`);t(e),u.value=e}}),a),h().then((()=>{o.value=!0,e.parent&&oe(e.parent.vnode)&&_(e.parent.update)})).catch((e=>{t(e),u.value=e})),()=>o.value&&f?re(f,e):u.value&&i?Tt(i,{error:u.value}):n&&!d.value?Tt(n):void 0}})}function re(e,t){const{ref:n,props:r,children:o,ce:i}=t.vnode,l=Tt(e,r,o);return l.ref=n,l.ce=i,delete t.vnode.ce,l}const oe=e=>e.type.__isKeepAlive;function ie(e,t){ce(e,"a",t)}function le(e,t){ce(e,"da",t)}function ce(e,t,n=Jt){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(se(t,r,n),n){let e=n.parent;for(;e&&e.parent;)oe(e.parent.vnode)&&ae(r,t,n,e),e=e.parent}}function ae(e,t,n,r){const i=se(t,e,r,!0);ve((()=>{(0,o.Od)(r[t],i)}),n)}function se(e,t,n=Jt,o=!1){if(n){const i=n[e]||(n[e]=[]),c=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;(0,r.Jd)(),Kt(n);const i=l(t,n,e,o);return Gt(),(0,r.lk)(),i});return o?i.unshift(c):i.push(c),c}}RegExp,RegExp;const ue=e=>(t,n=Jt)=>(!Qt||"sp"===e)&&se(e,((...e)=>t(...e)),n),fe=ue("bm"),pe=ue("m"),de=ue("bu"),he=ue("u"),me=ue("bum"),ve=ue("um"),ye=ue("sp"),_e=ue("rtg"),ge=ue("rtc");function be(e,t=Jt){se("ec",e,t)}function Oe(e,t){const n=C;if(null===n)return e;const r=nn(n)||n.proxy,i=e.dirs||(e.dirs=[]);for(let e=0;et(e,n,void 0,l&&l[n])));else{const n=Object.keys(e);i=new Array(n.length);for(let r=0,o=n.length;r!Ct(e)||e.type!==_t&&!(e.type===vt&&!Ie(e.children))))?e:null}const xe=e=>e?Yt(e)?nn(e)||e.proxy:xe(e.parent):null,Ae=(0,o.l7)(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>xe(e.parent),$root:e=>xe(e.root),$emit:e=>e.emit,$options:e=>Me(e),$forceUpdate:e=>e.f||(e.f=()=>_(e.update)),$nextTick:e=>e.n||(e.n=y.bind(e.proxy)),$watch:e=>q.bind(e)}),De=(e,t)=>e!==o.kT&&!e.__isScriptSetup&&(0,o.RI)(e,t),Ne={get({_:e},t){const{ctx:n,setupState:i,data:l,props:c,accessCache:a,type:s,appContext:u}=e;let f;if("$"!==t[0]){const r=a[t];if(void 0!==r)switch(r){case 1:return i[t];case 2:return l[t];case 4:return n[t];case 3:return c[t]}else{if(De(i,t))return a[t]=1,i[t];if(l!==o.kT&&(0,o.RI)(l,t))return a[t]=2,l[t];if((f=e.propsOptions[0])&&(0,o.RI)(f,t))return a[t]=3,c[t];if(n!==o.kT&&(0,o.RI)(n,t))return a[t]=4,n[t];Te&&(a[t]=0)}}const p=Ae[t];let d,h;return p?("$attrs"===t&&(0,r.j)(e,"get",t),p(e)):(d=s.__cssModules)&&(d=d[t])?d:n!==o.kT&&(0,o.RI)(n,t)?(a[t]=4,n[t]):(h=u.config.globalProperties,(0,o.RI)(h,t)?h[t]:void 0)},set({_:e},t,n){const{data:r,setupState:i,ctx:l}=e;return De(i,t)?(i[t]=n,!0):r!==o.kT&&(0,o.RI)(r,t)?(r[t]=n,!0):!((0,o.RI)(e.props,t)||"$"===t[0]&&t.slice(1)in e||(l[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:l}},c){let a;return!!n[c]||e!==o.kT&&(0,o.RI)(e,c)||De(t,c)||(a=l[0])&&(0,o.RI)(a,c)||(0,o.RI)(r,c)||(0,o.RI)(Ae,c)||(0,o.RI)(i.config.globalProperties,c)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:(0,o.RI)(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};let Te=!0;function Re(e,t,n){l((0,o.kJ)(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function Le(e,t,n,r){const i=r.includes(".")?$(n,r):()=>n[r];if((0,o.HD)(e)){const n=t[e];(0,o.mf)(n)&&U(i,n)}else if((0,o.mf)(e))U(i,e.bind(n));else if((0,o.Kn)(e))if((0,o.kJ)(e))e.forEach((e=>Le(e,t,n,r)));else{const r=(0,o.mf)(e.handler)?e.handler.bind(n):t[e.handler];(0,o.mf)(r)&&U(i,r,e)}}function Me(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:l,config:{optionMergeStrategies:c}}=e.appContext,a=l.get(t);let s;return a?s=a:i.length||n||r?(s={},i.length&&i.forEach((e=>Fe(s,e,c,!0))),Fe(s,t,c)):s=t,(0,o.Kn)(t)&&l.set(t,s),s}function Fe(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&Fe(e,i,n,!0),o&&o.forEach((t=>Fe(e,t,n,!0)));for(const o in t)if(r&&"expose"===o);else{const r=He[o]||n&&n[o];e[o]=r?r(e[o],t[o]):t[o]}return e}const He={data:Ue,props:$e,emits:$e,methods:$e,computed:$e,beforeCreate:qe,created:qe,beforeMount:qe,mounted:qe,beforeUpdate:qe,updated:qe,beforeDestroy:qe,beforeUnmount:qe,destroyed:qe,unmounted:qe,activated:qe,deactivated:qe,errorCaptured:qe,serverPrefetch:qe,components:$e,directives:$e,watch:function(e,t){if(!e)return t;if(!t)return e;const n=(0,o.l7)(Object.create(null),e);for(const r in t)n[r]=qe(e[r],t[r]);return n},provide:Ue,inject:function(e,t){return $e(ze(e),ze(t))}};function Ue(e,t){return t?e?function(){return(0,o.l7)((0,o.mf)(e)?e.call(this,this):e,(0,o.mf)(t)?t.call(this,this):t)}:t:e}function ze(e){if((0,o.kJ)(e)){const t={};for(let n=0;n{s=!0;const[n,r]=Je(e,t,!0);(0,o.l7)(c,n),r&&a.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!l&&!s)return(0,o.Kn)(e)&&r.set(e,o.Z6),o.Z6;if((0,o.kJ)(l))for(let e=0;e-1,r[1]=n<0||e-1||(0,o.RI)(r,"default"))&&a.push(t)}}}const u=[c,a];return(0,o.Kn)(e)&&r.set(e,u),u}function We(e){return"$"!==e[0]}function Ke(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:null===e?"null":""}function Ge(e,t){return Ke(e)===Ke(t)}function Ye(e,t){return(0,o.kJ)(t)?t.findIndex((t=>Ge(t,e))):(0,o.mf)(t)&&Ge(t,e)?0:-1}const Ze=e=>"_"===e[0]||"$stable"===e,Xe=e=>(0,o.kJ)(e)?e.map(Ht):[Ht(e)],Qe=(e,t,n)=>{if(t._n)return t;const r=A(((...e)=>Xe(t(...e))),n);return r._c=!1,r},et=(e,t,n)=>{const r=e._ctx;for(const n in e){if(Ze(n))continue;const i=e[n];if((0,o.mf)(i))t[n]=Qe(0,i,r);else if(null!=i){const e=Xe(i);t[n]=()=>e}}},tt=(e,t)=>{const n=Xe(t);e.slots.default=()=>n},nt=(e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=(0,r.IU)(t),(0,o.Nj)(t,"_",n)):et(t,e.slots={})}else e.slots={},t&&tt(e,t);(0,o.Nj)(e.slots,xt,1)},rt=(e,t,n)=>{const{vnode:r,slots:i}=e;let l=!0,c=o.kT;if(32&r.shapeFlag){const e=t._;e?n&&1===e?l=!1:((0,o.l7)(i,t),n||1!==e||delete i._):(l=!t.$stable,et(t,i)),c=t}else t&&(tt(e,t),c={default:1});if(l)for(const e in i)Ze(e)||e in c||delete i[e]};function ot(){return{app:null,config:{isNativeTag:o.NO,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let it=0;function lt(e,t){return function(n,r=null){(0,o.mf)(n)||(n=Object.assign({},n)),null==r||(0,o.Kn)(r)||(r=null);const i=ot(),l=new Set;let c=!1;const a=i.app={_uid:it++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:an,get config(){return i.config},set config(e){},use:(e,...t)=>(l.has(e)||(e&&(0,o.mf)(e.install)?(l.add(e),e.install(a,...t)):(0,o.mf)(e)&&(l.add(e),e(a,...t))),a),mixin:e=>(i.mixins.includes(e)||i.mixins.push(e),a),component:(e,t)=>t?(i.components[e]=t,a):i.components[e],directive:(e,t)=>t?(i.directives[e]=t,a):i.directives[e],mount(o,l,s){if(!c){const u=Tt(n,r);return u.appContext=i,l&&t?t(u,o):e(u,o,s),c=!0,a._container=o,o.__vue_app__=a,nn(u.component)||u.component.proxy}},unmount(){c&&(e(null,a._container),delete a._container.__vue_app__)},provide:(e,t)=>(i.provides[e]=t,a)};return a}}function ct(e,t,n,l,c=!1){if((0,o.kJ)(e))return void e.forEach(((e,r)=>ct(e,t&&((0,o.kJ)(t)?t[r]:t),n,l,c)));if(te(l)&&!c)return;const a=4&l.shapeFlag?nn(l.component)||l.component.proxy:l.el,s=c?null:a,{i:u,r:f}=e,p=t&&t.r,d=u.refs===o.kT?u.refs={}:u.refs,h=u.setupState;if(null!=p&&p!==f&&((0,o.HD)(p)?(d[p]=null,(0,o.RI)(h,p)&&(h[p]=null)):(0,r.dq)(p)&&(p.value=null)),(0,o.mf)(f))i(f,u,12,[s,d]);else{const t=(0,o.HD)(f),i=(0,r.dq)(f);if(t||i){const r=()=>{if(e.f){const n=t?(0,o.RI)(h,f)?h[f]:d[f]:f.value;c?(0,o.kJ)(n)&&(0,o.Od)(n,a):(0,o.kJ)(n)?n.includes(a)||n.push(a):t?(d[f]=[a],(0,o.RI)(h,f)&&(h[f]=d[f])):(f.value=[a],e.k&&(d[e.k]=f.value))}else t?(d[f]=s,(0,o.RI)(h,f)&&(h[f]=s)):i&&(f.value=s,e.k&&(d[e.k]=s))};s?(r.id=-1,pt(r,n)):r()}}}let at=!1;const st=e=>/svg/.test(e.namespaceURI)&&"foreignObject"!==e.tagName,ut=e=>8===e.nodeType;function ft(e){const{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:l,parentNode:c,remove:a,insert:s,createComment:u}}=e,f=(n,r,o,a,u,y=!1)=>{const _=ut(n)&&"["===n.data,g=()=>m(n,r,o,a,u,_),{type:b,ref:O,shapeFlag:w,patchFlag:S}=r;let E=n.nodeType;r.el=n,-2===S&&(y=!1,r.dynamicChildren=null);let j=null;switch(b){case yt:3!==E?""===r.children?(s(r.el=i(""),c(n),n),j=n):j=g():(n.data!==r.children&&(at=!0,n.data=r.children),j=l(n));break;case _t:j=8!==E||_?g():l(n);break;case gt:if(_&&(E=(n=l(n)).nodeType),1===E||3===E){j=n;const e=!r.children.length;for(let t=0;t{c=c||!!t.dynamicChildren;const{type:s,props:u,patchFlag:f,shapeFlag:p,dirs:h}=t,m="input"===s&&h||"option"===s;if(m||-1!==f){if(h&&we(t,null,n,"created"),u)if(m||!c||48&f)for(const t in u)(m&&t.endsWith("value")||(0,o.F7)(t)&&!(0,o.Gg)(t))&&r(e,t,null,u[t],!1,void 0,n);else u.onClick&&r(e,"onClick",null,u.onClick,!1,void 0,n);let s;if((s=u&&u.onVnodeBeforeMount)&&$t(s,n,t),h&&we(t,null,n,"beforeMount"),((s=u&&u.onVnodeMounted)||h)&&L((()=>{s&&$t(s,n,t),h&&we(t,null,n,"mounted")}),i),16&p&&(!u||!u.innerHTML&&!u.textContent)){let r=d(e.firstChild,t,e,n,i,l,c);for(;r;){at=!0;const e=r;r=r.nextSibling,a(e)}}else 8&p&&e.textContent!==t.children&&(at=!0,e.textContent=t.children)}return e.nextSibling},d=(e,t,r,o,i,l,c)=>{c=c||!!t.dynamicChildren;const a=t.children,s=a.length;for(let t=0;t{const{slotScopeIds:a}=t;a&&(o=o?o.concat(a):a);const f=c(e),p=d(l(e),t,f,n,r,o,i);return p&&ut(p)&&"]"===p.data?l(t.anchor=p):(at=!0,s(t.anchor=u("]"),f,p),p)},m=(e,t,r,o,i,s)=>{if(at=!0,t.el=null,s){const t=v(e);for(;;){const n=l(e);if(!n||n===t)break;a(n)}}const u=l(e),f=c(e);return a(e),n(null,t,f,u,r,o,st(f),i),u},v=e=>{let t=0;for(;e;)if((e=l(e))&&ut(e)&&("["===e.data&&t++,"]"===e.data)){if(0===t)return l(e);t--}return e};return[(e,t)=>{if(!t.hasChildNodes())return n(null,e,t),O(),void(t._vnode=e);at=!1,f(t.firstChild,e,null,null,null),O(),t._vnode=e,at&&console.error("Hydration completed but contains mismatches.")},f]}const pt=L;function dt(e){return function(e,t){(0,o.E9)().__VUE__=!0;const{insert:n,remove:l,patchProp:a,createElement:s,createText:p,createComment:d,setText:h,setElementText:m,parentNode:v,nextSibling:y,setScopeId:g=o.dG,insertStaticContent:w}=e,S=(e,t,n,r=null,o=null,i=null,l=!1,c=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!It(e,t)&&(r=ne(e),Y(e,o,i,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);const{type:s,ref:u,shapeFlag:f}=t;switch(s){case yt:E(e,t,n,r);break;case _t:C(e,t,n,r);break;case gt:null==e&&I(t,n,r,l);break;case vt:U(e,t,n,r,o,i,l,c,a);break;default:1&f?A(e,t,n,r,o,i,l,c,a):6&f?z(e,t,n,r,o,i,l,c,a):(64&f||128&f)&&s.process(e,t,n,r,o,i,l,c,a,ie)}null!=u&&o&&ct(u,e&&e.ref,i,t||e,!t)},E=(e,t,r,o)=>{if(null==e)n(t.el=p(t.children),r,o);else{const n=t.el=e.el;t.children!==e.children&&h(n,t.children)}},C=(e,t,r,o)=>{null==e?n(t.el=d(t.children||""),r,o):t.el=e.el},I=(e,t,n,r)=>{[e.el,e.anchor]=w(e.children,t,n,r,e.el,e.anchor)},x=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=y(e),l(e),e=n;l(t)},A=(e,t,n,r,o,i,l,c,a)=>{l=l||"svg"===t.type,null==e?N(t,n,r,o,i,l,c,a):M(e,t,o,i,l,c,a)},N=(e,t,r,i,l,c,u,f)=>{let p,d;const{type:h,props:v,shapeFlag:y,transition:_,dirs:g}=e;if(p=e.el=s(e.type,c,v&&v.is,v),8&y?m(p,e.children):16&y&&L(e.children,p,null,i,l,c&&"foreignObject"!==h,u,f),g&&we(e,null,i,"created"),T(p,e,e.scopeId,u,i),v){for(const t in v)"value"===t||(0,o.Gg)(t)||a(p,t,null,v[t],c,e.children,i,l,ee);"value"in v&&a(p,"value",null,v.value),(d=v.onVnodeBeforeMount)&&$t(d,i,e)}g&&we(e,null,i,"beforeMount");const b=(!l||l&&!l.pendingBranch)&&_&&!_.persisted;b&&_.beforeEnter(p),n(p,t,r),((d=v&&v.onVnodeMounted)||b||g)&&pt((()=>{d&&$t(d,i,e),b&&_.enter(p),g&&we(e,null,i,"mounted")}),l)},T=(e,t,n,r,o)=>{if(n&&g(e,n),r)for(let t=0;t{for(let s=a;s{const s=t.el=e.el;let{patchFlag:u,dynamicChildren:f,dirs:p}=t;u|=16&e.patchFlag;const d=e.props||o.kT,h=t.props||o.kT;let v;n&&ht(n,!1),(v=h.onVnodeBeforeUpdate)&&$t(v,n,t,e),p&&we(t,e,n,"beforeUpdate"),n&&ht(n,!0);const y=i&&"foreignObject"!==t.type;if(f?F(e.dynamicChildren,f,s,n,r,y,l):c||J(e,t,s,null,n,r,y,l,!1),u>0){if(16&u)H(s,t,d,h,n,r,i);else if(2&u&&d.class!==h.class&&a(s,"class",null,h.class,i),4&u&&a(s,"style",d.style,h.style,i),8&u){const o=t.dynamicProps;for(let t=0;t{v&&$t(v,n,t,e),p&&we(t,e,n,"updated")}),r)},F=(e,t,n,r,o,i,l)=>{for(let c=0;c{if(n!==r){if(n!==o.kT)for(const s in n)(0,o.Gg)(s)||s in r||a(e,s,n[s],null,c,t.children,i,l,ee);for(const s in r){if((0,o.Gg)(s))continue;const u=r[s],f=n[s];u!==f&&"value"!==s&&a(e,s,f,u,c,t.children,i,l,ee)}"value"in r&&a(e,"value",n.value,r.value)}},U=(e,t,r,o,i,l,c,a,s)=>{const u=t.el=e?e.el:p(""),f=t.anchor=e?e.anchor:p("");let{patchFlag:d,dynamicChildren:h,slotScopeIds:m}=t;m&&(a=a?a.concat(m):m),null==e?(n(u,r,o),n(f,r,o),L(t.children,r,f,i,l,c,a,s)):d>0&&64&d&&h&&e.dynamicChildren?(F(e.dynamicChildren,h,r,i,l,c,a),(null!=t.key||i&&t===i.subTree)&&mt(e,t,!0)):J(e,t,r,f,i,l,c,a,s)},z=(e,t,n,r,o,i,l,c,a)=>{t.slotScopeIds=c,null==e?512&t.shapeFlag?o.ctx.activate(t,n,r,l,a):q(t,n,r,o,i,l,a):$(e,t,a)},q=(e,t,n,l,a,s,u)=>{const f=e.component=function(e,t,n){const i=e.type,l=(t?t.appContext:e.appContext)||Bt,c={uid:Vt++,vnode:e,type:i,parent:t,appContext:l,root:null,next:null,subTree:null,effect:null,update:null,scope:new r.Bj(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(l.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Je(i,l),emitsOptions:P(i,l),emit:null,emitted:null,propsDefaults:o.kT,inheritAttrs:i.inheritAttrs,ctx:o.kT,data:o.kT,props:o.kT,attrs:o.kT,slots:o.kT,refs:o.kT,setupState:o.kT,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return c.ctx={_:c},c.root=t?t.root:c,c.emit=j.bind(null,c),e.ce&&e.ce(c),c}(e,l,a);if(oe(e)&&(f.ctx.renderer=ie),function(e,t=!1){Qt=t;const{props:n,children:l}=e.vnode,a=Yt(e);!function(e,t,n,i=!1){const l={},c={};(0,o.Nj)(c,xt,1),e.propsDefaults=Object.create(null),Be(e,t,l,c);for(const t in e.propsOptions[0])t in l||(l[t]=void 0);n?e.props=i?l:(0,r.Um)(l):e.type.props?e.props=l:e.props=c,e.attrs=c}(e,n,a,t),nt(e,l);const s=a?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=(0,r.Xl)(new Proxy(e.ctx,Ne));const{setup:l}=n;if(l){const n=e.setupContext=l.length>1?function(e){const t=t=>{e.exposed=t||{}};let n;return{get attrs(){return n||(n=function(e){return new Proxy(e.attrs,{get:(t,n)=>((0,r.j)(e,"get","$attrs"),t[n])})}(e))},slots:e.slots,emit:e.emit,expose:t}}(e):null;Kt(e),(0,r.Jd)();const a=i(l,e,0,[e.props,n]);if((0,r.lk)(),Gt(),(0,o.tI)(a)){if(a.then(Gt,Gt),t)return a.then((n=>{en(e,n,t)})).catch((t=>{c(t,e,0)}));e.asyncDep=a}else en(e,a,t)}else tn(e,t)}(e,t):void 0;Qt=!1}(f),f.asyncDep){if(a&&a.registerDep(f,B),!e.el){const e=f.subTree=Tt(_t);C(null,e,t,n)}}else B(f,e,t,n,a,s,u)},$=(e,t,n)=>{const r=t.component=e.component;if(function(e,t,n){const{props:r,children:o,component:i}=e,{props:l,children:c,patchFlag:a}=t,s=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&a>=0))return!(!o&&!c||c&&c.$stable)||r!==l&&(r?!l||R(r,l,s):!!l);if(1024&a)return!0;if(16&a)return r?R(r,l,s):!!l;if(8&a){const e=t.dynamicProps;for(let t=0;tf&&u.splice(t,1)}(r.update),r.update()}else t.el=e.el,r.vnode=t},B=(e,t,n,i,l,c,a)=>{const s=e.effect=new r.qq((()=>{if(e.isMounted){let t,{next:n,bu:r,u:i,parent:s,vnode:u}=e,f=n;ht(e,!1),n?(n.el=u.el,V(e,n,a)):n=u,r&&(0,o.ir)(r),(t=n.props&&n.props.onVnodeBeforeUpdate)&&$t(t,s,n,u),ht(e,!0);const p=D(e),d=e.subTree;e.subTree=p,S(d,p,v(d.el),ne(d),e,l,c),n.el=p.el,null===f&&function({vnode:e,parent:t},n){for(;t&&t.subTree===e;)(e=t.vnode).el=n,t=t.parent}(e,p.el),i&&pt(i,l),(t=n.props&&n.props.onVnodeUpdated)&&pt((()=>$t(t,s,n,u)),l)}else{let r;const{el:a,props:s}=t,{bm:u,m:f,parent:p}=e,d=te(t);if(ht(e,!1),u&&(0,o.ir)(u),!d&&(r=s&&s.onVnodeBeforeMount)&&$t(r,p,t),ht(e,!0),a&&ce){const n=()=>{e.subTree=D(e),ce(a,e.subTree,e,l,null)};d?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const r=e.subTree=D(e);S(null,r,n,i,e,l,c),t.el=r.el}if(f&&pt(f,l),!d&&(r=s&&s.onVnodeMounted)){const e=t;pt((()=>$t(r,p,e)),l)}(256&t.shapeFlag||p&&te(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&pt(e.a,l),e.isMounted=!0,t=n=i=null}}),(()=>_(u)),e.scope),u=e.update=()=>s.run();u.id=e.uid,ht(e,!0),u()},V=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,i){const{props:l,attrs:c,vnode:{patchFlag:a}}=e,s=(0,r.IU)(l),[u]=e.propsOptions;let f=!1;if(!(i||a>0)||16&a){let r;Be(e,t,l,c)&&(f=!0);for(const i in s)t&&((0,o.RI)(t,i)||(r=(0,o.rs)(i))!==i&&(0,o.RI)(t,r))||(u?!n||void 0===n[i]&&void 0===n[r]||(l[i]=Ve(u,s,i,void 0,e,!0)):delete l[i]);if(c!==s)for(const e in c)t&&(0,o.RI)(t,e)||(delete c[e],f=!0)}else if(8&a){const n=e.vnode.dynamicProps;for(let r=0;r{const s=e&&e.children,u=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:d}=t;if(p>0){if(128&p)return void K(s,f,n,r,o,i,l,c,a);if(256&p)return void W(s,f,n,r,o,i,l,c,a)}8&d?(16&u&&ee(s,o,i),f!==s&&m(n,f)):16&u?16&d?K(s,f,n,r,o,i,l,c,a):ee(s,o,i,!0):(8&u&&m(n,""),16&d&&L(f,n,r,o,i,l,c,a))},W=(e,t,n,r,i,l,c,a,s)=>{e=e||o.Z6,t=t||o.Z6;const u=e.length,f=t.length,p=Math.min(u,f);let d;for(d=0;df?ee(e,i,l,!0,!1,p):L(t,n,r,i,l,c,a,s,p)},K=(e,t,n,r,i,l,c,a,s)=>{let u=0;const f=t.length;let p=e.length-1,d=f-1;for(;u<=p&&u<=d;){const r=e[u],o=t[u]=s?Ut(t[u]):Ht(t[u]);if(!It(r,o))break;S(r,o,n,null,i,l,c,a,s),u++}for(;u<=p&&u<=d;){const r=e[p],o=t[d]=s?Ut(t[d]):Ht(t[d]);if(!It(r,o))break;S(r,o,n,null,i,l,c,a,s),p--,d--}if(u>p){if(u<=d){const e=d+1,o=ed)for(;u<=p;)Y(e[u],i,l,!0),u++;else{const h=u,m=u,v=new Map;for(u=m;u<=d;u++){const e=t[u]=s?Ut(t[u]):Ht(t[u]);null!=e.key&&v.set(e.key,u)}let y,_=0;const g=d-m+1;let b=!1,O=0;const w=new Array(g);for(u=0;u=g){Y(r,i,l,!0);continue}let o;if(null!=r.key)o=v.get(r.key);else for(y=m;y<=d;y++)if(0===w[y-m]&&It(r,t[y])){o=y;break}void 0===o?Y(r,i,l,!0):(w[o-m]=u+1,o>=O?O=o:b=!0,S(r,t[o],n,null,i,l,c,a,s),_++)}const E=b?function(e){const t=e.slice(),n=[0];let r,o,i,l,c;const a=e.length;for(r=0;r>1,e[n[c]]0&&(t[r]=n[i-1]),n[i]=r)}}for(i=n.length,l=n[i-1];i-- >0;)n[i]=l,l=t[l];return n}(w):o.Z6;for(y=E.length-1,u=g-1;u>=0;u--){const e=m+u,o=t[e],p=e+1{const{el:l,type:c,transition:a,children:s,shapeFlag:u}=e;if(6&u)G(e.component.subTree,t,r,o);else if(128&u)e.suspense.move(t,r,o);else if(64&u)c.move(e,t,r,ie);else if(c!==vt)if(c!==gt)if(2!==o&&1&u&&a)if(0===o)a.beforeEnter(l),n(l,t,r),pt((()=>a.enter(l)),i);else{const{leave:e,delayLeave:o,afterLeave:i}=a,c=()=>n(l,t,r),s=()=>{e(l,(()=>{c(),i&&i()}))};o?o(l,c,s):s()}else n(l,t,r);else(({el:e,anchor:t},r,o)=>{let i;for(;e&&e!==t;)i=y(e),n(e,r,o),e=i;n(t,r,o)})(e,t,r);else{n(l,t,r);for(let e=0;e{const{type:i,props:l,ref:c,children:a,dynamicChildren:s,shapeFlag:u,patchFlag:f,dirs:p}=e;if(null!=c&&ct(c,null,n,e,!0),256&u)return void t.ctx.deactivate(e);const d=1&u&&p,h=!te(e);let m;if(h&&(m=l&&l.onVnodeBeforeUnmount)&&$t(m,t,e),6&u)Q(e.component,n,r);else{if(128&u)return void e.suspense.unmount(n,r);d&&we(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,o,ie,r):s&&(i!==vt||f>0&&64&f)?ee(s,t,n,!1,!0):(i===vt&&384&f||!o&&16&u)&&ee(a,t,n),r&&Z(e)}(h&&(m=l&&l.onVnodeUnmounted)||d)&&pt((()=>{m&&$t(m,t,e),d&&we(e,null,t,"unmounted")}),n)},Z=e=>{const{type:t,el:n,anchor:r,transition:o}=e;if(t===vt)return void X(n,r);if(t===gt)return void x(e);const i=()=>{l(n),o&&!o.persisted&&o.afterLeave&&o.afterLeave()};if(1&e.shapeFlag&&o&&!o.persisted){const{leave:t,delayLeave:r}=o,l=()=>t(n,i);r?r(e.el,i,l):l()}else i()},X=(e,t)=>{let n;for(;e!==t;)n=y(e),l(e),e=n;l(t)},Q=(e,t,n)=>{const{bum:r,scope:i,update:l,subTree:c,um:a}=e;r&&(0,o.ir)(r),i.stop(),l&&(l.active=!1,Y(c,e,t,n)),a&&pt(a,t),pt((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},ee=(e,t,n,r=!1,o=!1,i=0)=>{for(let l=i;l6&e.shapeFlag?ne(e.component.subTree):128&e.shapeFlag?e.suspense.next():y(e.anchor||e.el),re=(e,t,n)=>{null==e?t._vnode&&Y(t._vnode,null,null,!0):S(t._vnode||null,e,t,null,null,null,n),b(),O(),t._vnode=e},ie={p:S,um:Y,m:G,r:Z,mt:q,mc:L,pc:J,pbc:F,n:ne,o:e};let le,ce;return t&&([le,ce]=t(ie)),{render:re,hydrate:le,createApp:lt(re,le)}}(e,ft)}function ht({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function mt(e,t,n=!1){const r=e.children,i=t.children;if((0,o.kJ)(r)&&(0,o.kJ)(i))for(let e=0;e0?Ot||o.Z6:null,bt.pop(),Ot=bt[bt.length-1]||null,St>0&&Ot&&Ot.push(e),e}function Pt(e,t,n,r,o,i){return jt(Nt(e,t,n,r,o,i,!0))}function kt(e,t,n,r,o){return jt(Tt(e,t,n,r,o,!0))}function Ct(e){return!!e&&!0===e.__v_isVNode}function It(e,t){return e.type===t.type&&e.key===t.key}const xt="__vInternal",At=({key:e})=>null!=e?e:null,Dt=({ref:e,ref_key:t,ref_for:n})=>null!=e?(0,o.HD)(e)||(0,r.dq)(e)||(0,o.mf)(e)?{i:C,r:e,k:t,f:!!n}:e:null;function Nt(e,t=null,n=null,r=0,i=null,l=(e===vt?0:1),c=!1,a=!1){const s={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&At(t),ref:t&&Dt(t),scopeId:I,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:C};return a?(zt(s,n),128&l&&e.normalize(s)):n&&(s.shapeFlag|=(0,o.HD)(n)?8:16),St>0&&!c&&Ot&&(s.patchFlag>0||6&l)&&32!==s.patchFlag&&Ot.push(s),s}const Tt=function(e,t=null,n=null,i=0,l=null,c=!1){if(e&&e!==je||(e=_t),Ct(e)){const r=Rt(e,t,!0);return n&&zt(r,n),St>0&&!c&&Ot&&(6&r.shapeFlag?Ot[Ot.indexOf(e)]=r:Ot.push(r)),r.patchFlag|=-2,r}if(a=e,(0,o.mf)(a)&&"__vccOpts"in a&&(e=e.__vccOpts),t){t=function(e){return e?(0,r.X3)(e)||xt in e?(0,o.l7)({},e):e:null}(t);let{class:e,style:n}=t;e&&!(0,o.HD)(e)&&(t.class=(0,o.C_)(e)),(0,o.Kn)(n)&&((0,r.X3)(n)&&!(0,o.kJ)(n)&&(n=(0,o.l7)({},n)),t.style=(0,o.j5)(n))}var a;return Nt(e,t,n,i,l,(0,o.HD)(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:(0,o.Kn)(e)?4:(0,o.mf)(e)?2:0,c,!0)};function Rt(e,t,n=!1){const{props:r,ref:i,patchFlag:l,children:c}=e,a=t?qt(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:a,key:a&&At(a),ref:t&&t.ref?n&&i?(0,o.kJ)(i)?i.concat(Dt(t)):[i,Dt(t)]:Dt(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:c,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==vt?-1===l?16:16|l:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Rt(e.ssContent),ssFallback:e.ssFallback&&Rt(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Lt(e=" ",t=0){return Tt(yt,null,e,t)}function Mt(e,t){const n=Tt(gt,null,e);return n.staticCount=t,n}function Ft(e="",t=!1){return t?(wt(),kt(_t,null,e)):Tt(_t,null,e)}function Ht(e){return null==e||"boolean"==typeof e?Tt(_t):(0,o.kJ)(e)?Tt(vt,null,e.slice()):"object"==typeof e?Ut(e):Tt(yt,null,String(e))}function Ut(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Rt(e)}function zt(e,t){let n=0;const{shapeFlag:r}=e;if(null==t)t=null;else if((0,o.kJ)(t))n=16;else if("object"==typeof t){if(65&r){const n=t.default;return void(n&&(n._c&&(n._d=!1),zt(e,n()),n._c&&(n._d=!0)))}{n=32;const r=t._;r||xt in t?3===r&&C&&(1===C.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=C}}else(0,o.mf)(t)?(t={default:t,_ctx:C},n=32):(t=String(t),64&r?(n=16,t=[Lt(t)]):n=8);e.children=t,e.shapeFlag|=n}function qt(...e){const t={};for(let n=0;nJt||C,Kt=e=>{Jt=e,e.scope.on()},Gt=()=>{Jt&&Jt.scope.off(),Jt=null};function Yt(e){return 4&e.vnode.shapeFlag}let Zt,Xt,Qt=!1;function en(e,t,n){(0,o.mf)(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:(0,o.Kn)(t)&&(e.setupState=(0,r.WL)(t)),tn(e,n)}function tn(e,t,n){const i=e.type;if(!e.render){if(!t&&Zt&&!i.render){const t=i.template||Me(e).template;if(t){const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:c}=i,a=(0,o.l7)((0,o.l7)({isCustomElement:n,delimiters:l},r),c);i.render=Zt(t,a)}}e.render=i.render||o.dG,Xt&&Xt(e)}Kt(e),(0,r.Jd)(),function(e){const t=Me(e),n=e.proxy,i=e.ctx;Te=!1,t.beforeCreate&&Re(t.beforeCreate,e,"bc");const{data:l,computed:c,methods:a,watch:s,provide:u,inject:f,created:p,beforeMount:d,mounted:h,beforeUpdate:m,updated:v,activated:y,deactivated:_,beforeDestroy:g,beforeUnmount:b,destroyed:O,unmounted:w,render:S,renderTracked:E,renderTriggered:j,errorCaptured:P,serverPrefetch:k,expose:C,inheritAttrs:I,components:x,directives:A,filters:D}=t;if(f&&function(e,t,n=o.dG,i=!1){(0,o.kJ)(e)&&(e=ze(e));for(const n in e){const l=e[n];let c;c=(0,o.Kn)(l)?"default"in l?F(l.from||n,l.default,!0):F(l.from||n):F(l),(0,r.dq)(c)&&i?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>c.value,set:e=>c.value=e}):t[n]=c}}(f,i,null,e.appContext.config.unwrapInjectedRef),a)for(const e in a){const t=a[e];(0,o.mf)(t)&&(i[e]=t.bind(n))}if(l){const t=l.call(n,n);(0,o.Kn)(t)&&(e.data=(0,r.qj)(t))}if(Te=!0,c)for(const e in c){const t=c[e],r=(0,o.mf)(t)?t.bind(n,n):(0,o.mf)(t.get)?t.get.bind(n,n):o.dG,l=!(0,o.mf)(t)&&(0,o.mf)(t.set)?t.set.bind(n):o.dG,a=rn({get:r,set:l});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(s)for(const e in s)Le(s[e],i,n,e);if(u){const e=(0,o.mf)(u)?u.call(n):u;Reflect.ownKeys(e).forEach((t=>{M(t,e[t])}))}function N(e,t){(0,o.kJ)(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(p&&Re(p,e,"c"),N(fe,d),N(pe,h),N(de,m),N(he,v),N(ie,y),N(le,_),N(be,P),N(ge,E),N(_e,j),N(me,b),N(ve,w),N(ye,k),(0,o.kJ)(C))if(C.length){const t=e.exposed||(e.exposed={});C.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});S&&e.render===o.dG&&(e.render=S),null!=I&&(e.inheritAttrs=I),x&&(e.components=x),A&&(e.directives=A)}(e),(0,r.lk)(),Gt()}function nn(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy((0,r.WL)((0,r.Xl)(e.exposed)),{get:(t,n)=>n in t?t[n]:n in Ae?Ae[n](e):void 0,has:(e,t)=>t in e||t in Ae}))}const rn=(e,t)=>(0,r.Fl)(e,t,Qt);function on(e,t,n){const r=arguments.length;return 2===r?(0,o.Kn)(t)&&!(0,o.kJ)(t)?Ct(t)?Tt(e,null,[t]):Tt(e,t):Tt(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&Ct(n)&&(n=[n]),Tt(e,t,n))}const ln=Symbol(""),cn=()=>F(ln),an="3.2.47"},9963:(e,t,n)=>{"use strict";n.d(t,{F8:()=>D,uT:()=>b,vr:()=>M});var r=n(3577),o=n(6252);n(2262);const i="undefined"!=typeof document?document:null,l=i&&i.createElement("template"),c={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t?i.createElementNS("http://www.w3.org/2000/svg",e):i.createElement(e,n?{is:n}:void 0);return"select"===e&&r&&null!=r.multiple&&o.setAttribute("multiple",r.multiple),o},createText:e=>i.createTextNode(e),createComment:e=>i.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>i.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,i){const c=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),o!==i&&(o=o.nextSibling););else{l.innerHTML=r?`${e}`:e;const o=l.content;if(r){const e=o.firstChild;for(;e.firstChild;)o.appendChild(e.firstChild);o.removeChild(e)}t.insertBefore(o,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},a=/\s*!important$/;function s(e,t,n){if((0,r.kJ)(n))n.forEach((n=>s(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=f[t];if(n)return n;let o=(0,r._A)(t);if("filter"!==o&&o in e)return f[t]=o;o=(0,r.kC)(o);for(let n=0;nh||(m.then((()=>h=0)),h=Date.now()),y=/^on[a-z]/;"undefined"!=typeof HTMLElement&&HTMLElement;const _="transition",g="animation",b=(e,{slots:t})=>(0,o.h)(o.P$,function(e){const t={};for(const n in e)n in O||(t[n]=e[n]);if(!1===e.css)return t;const{name:n="v",type:o,duration:i,enterFromClass:l=`${n}-enter-from`,enterActiveClass:c=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:s=l,appearActiveClass:u=c,appearToClass:f=a,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:d=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,m=function(e){if(null==e)return null;if((0,r.Kn)(e))return[E(e.enter),E(e.leave)];{const t=E(e);return[t,t]}}(i),v=m&&m[0],y=m&&m[1],{onBeforeEnter:_,onEnter:g,onEnterCancelled:b,onLeave:C,onLeaveCancelled:x,onBeforeAppear:A=_,onAppear:D=g,onAppearCancelled:N=b}=t,T=(e,t,n)=>{P(e,t?f:a),P(e,t?u:c),n&&n()},R=(e,t)=>{e._isLeaving=!1,P(e,p),P(e,h),P(e,d),t&&t()},L=e=>(t,n)=>{const r=e?D:g,i=()=>T(t,e,n);w(r,[t,i]),k((()=>{P(t,e?s:l),j(t,e?f:a),S(r)||I(t,o,v,i)}))};return(0,r.l7)(t,{onBeforeEnter(e){w(_,[e]),j(e,l),j(e,c)},onBeforeAppear(e){w(A,[e]),j(e,s),j(e,u)},onEnter:L(!1),onAppear:L(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>R(e,t);j(e,p),document.body.offsetHeight,j(e,d),k((()=>{e._isLeaving&&(P(e,p),j(e,h),S(C)||I(e,o,y,n))})),w(C,[e,n])},onEnterCancelled(e){T(e,!1),w(b,[e])},onAppearCancelled(e){T(e,!0),w(N,[e])},onLeaveCancelled(e){R(e),w(x,[e])}})}(e),t);b.displayName="Transition";const O={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},w=(b.props=(0,r.l7)({},o.P$.props,O),(e,t=[])=>{(0,r.kJ)(e)?e.forEach((e=>e(...t))):e&&e(...t)}),S=e=>!!e&&((0,r.kJ)(e)?e.some((e=>e.length>1)):e.length>1);function E(e){return(0,r.He)(e)}function j(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e._vtc||(e._vtc=new Set)).add(t)}function P(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function k(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let C=0;function I(e,t,n,r){const o=e._endId=++C,i=()=>{o===e._endId&&r()};if(n)return setTimeout(i,n);const{type:l,timeout:c,propCount:a}=function(e,t){const n=window.getComputedStyle(e),r=e=>(n[e]||"").split(", "),o=r(`${_}Delay`),i=r(`${_}Duration`),l=x(o,i),c=r(`${g}Delay`),a=r(`${g}Duration`),s=x(c,a);let u=null,f=0,p=0;return t===_?l>0&&(u=_,f=l,p=i.length):t===g?s>0&&(u=g,f=s,p=a.length):(f=Math.max(l,s),u=f>0?l>s?_:g:null,p=u?u===_?i.length:a.length:0),{type:u,timeout:f,propCount:p,hasTransform:u===_&&/\b(transform|all)(,|$)/.test(r(`${_}Property`).toString())}}(e,t);if(!l)return r();const s=l+"end";let u=0;const f=()=>{e.removeEventListener(s,p),i()},p=t=>{t.target===e&&++u>=a&&f()};setTimeout((()=>{uA(t)+A(e[n]))))}function A(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}new WeakMap,new WeakMap;const D={beforeMount(e,{value:t},{transition:n}){e._vod="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):N(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),N(e,!0),r.enter(e)):r.leave(e,(()=>{N(e,!1)})):N(e,t))},beforeUnmount(e,{value:t}){N(e,t)}};function N(e,t){e.style.display=t?e._vod:"none"}const T=(0,r.l7)({patchProp:(e,t,n,i,l=!1,c,a,u,f)=>{"class"===t?function(e,t,n){const r=e._vtc;r&&(t=(t?[t,...r]:[...r]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,i,l):"style"===t?function(e,t,n){const o=e.style,i=(0,r.HD)(n);if(n&&!i){if(t&&!(0,r.HD)(t))for(const e in t)null==n[e]&&s(o,e,"");for(const e in n)s(o,e,n[e])}else{const r=o.display;i?t!==n&&(o.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(o.display=r)}}(e,n,i):(0,r.F7)(t)?(0,r.tR)(t)||function(e,t,n,i,l=null){const c=e._vei||(e._vei={}),a=c[t];if(i&&a)a.value=i;else{const[n,s]=function(e){let t;if(d.test(e)){let n;for(t={};n=e.match(d);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):(0,r.rs)(e.slice(2)),t]}(t);if(i){const a=c[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();(0,o.$d)(function(e,t){if((0,r.kJ)(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=v(),n}(i,l);!function(e,t,n,r){e.addEventListener(t,n,r)}(e,n,a,s)}else a&&(function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,a,s),c[t]=void 0)}}(e,t,0,i,a):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,o){return o?"innerHTML"===t||"textContent"===t||!!(t in e&&y.test(t)&&(0,r.mf)(n)):"spellcheck"!==t&&"draggable"!==t&&"translate"!==t&&("form"!==t&&(("list"!==t||"INPUT"!==e.tagName)&&(("type"!==t||"TEXTAREA"!==e.tagName)&&((!y.test(t)||!(0,r.HD)(n))&&t in e))))}(e,t,i,l))?function(e,t,n,o,i,l,c){if("innerHTML"===t||"textContent"===t)return o&&c(o,i,l),void(e[t]=null==n?"":n);if("value"===t&&"PROGRESS"!==e.tagName&&!e.tagName.includes("-")){e._value=n;const r=null==n?"":n;return e.value===r&&"OPTION"!==e.tagName||(e.value=r),void(null==n&&e.removeAttribute(t))}let a=!1;if(""===n||null==n){const o=typeof e[t];"boolean"===o?n=(0,r.yA)(n):null==n&&"string"===o?(n="",a=!0):"number"===o&&(n=0,a=!0)}try{e[t]=n}catch(e){}a&&e.removeAttribute(t)}(e,t,i,c,a,u,f):("true-value"===t?e._trueValue=i:"false-value"===t&&(e._falseValue=i),function(e,t,n,o,i){if(o&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(p,t.slice(6,t.length)):e.setAttributeNS(p,t,n);else{const o=(0,r.Pq)(t);null==n||o&&!(0,r.yA)(n)?e.removeAttribute(t):e.setAttribute(t,o?"":n)}}(e,t,i,l))}},c);let R,L=!1;const M=(...e)=>{const t=(R=L?R:(0,o.Eo)(T),L=!0,R).createApp(...e),{mount:n}=t;return t.mount=e=>{const t=function(e){if((0,r.HD)(e))return document.querySelector(e);return e}(e);if(t)return n(t,!0,t instanceof SVGElement)},t}},3577:(e,t,n)=>{"use strict";function r(e,t){const n=Object.create(null),r=e.split(",");for(let e=0;e!!n[e.toLowerCase()]:e=>!!n[e]}n.d(t,{C_:()=>u,DM:()=>x,E9:()=>re,F7:()=>w,Gg:()=>$,HD:()=>T,He:()=>te,Kj:()=>D,Kn:()=>L,NO:()=>b,Nj:()=>Q,Od:()=>j,PO:()=>z,Pq:()=>f,RI:()=>k,S0:()=>q,W7:()=>U,WV:()=>d,Z6:()=>_,_A:()=>J,_N:()=>I,aU:()=>Z,dG:()=>g,e1:()=>o,fY:()=>r,h5:()=>ee,hR:()=>Y,hq:()=>h,ir:()=>X,j5:()=>i,kC:()=>G,kJ:()=>C,kT:()=>y,l7:()=>E,mf:()=>N,rs:()=>K,tI:()=>M,tR:()=>S,yA:()=>p,yk:()=>R,zw:()=>m});const o=r("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt");function i(e){if(C(e)){const t={};for(let n=0;n{if(e){const n=e.split(c);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function u(e){let t="";if(T(e))t=e;else if(C(e))for(let n=0;nd(e,t)))}const m=e=>T(e)?e:null==e?"":C(e)||L(e)&&(e.toString===F||!N(e.toString))?JSON.stringify(e,v,2):String(e),v=(e,t)=>t&&t.__v_isRef?v(e,t.value):I(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n])=>(e[`${t} =>`]=n,e)),{})}:x(t)?{[`Set(${t.size})`]:[...t.values()]}:!L(t)||C(t)||z(t)?t:String(t),y={},_=[],g=()=>{},b=()=>!1,O=/^on[^a-z]/,w=e=>O.test(e),S=e=>e.startsWith("onUpdate:"),E=Object.assign,j=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},P=Object.prototype.hasOwnProperty,k=(e,t)=>P.call(e,t),C=Array.isArray,I=e=>"[object Map]"===H(e),x=e=>"[object Set]"===H(e),A=e=>"[object Date]"===H(e),D=e=>"[object RegExp]"===H(e),N=e=>"function"==typeof e,T=e=>"string"==typeof e,R=e=>"symbol"==typeof e,L=e=>null!==e&&"object"==typeof e,M=e=>L(e)&&N(e.then)&&N(e.catch),F=Object.prototype.toString,H=e=>F.call(e),U=e=>H(e).slice(8,-1),z=e=>"[object Object]"===H(e),q=e=>T(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,$=r(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),B=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},V=/-(\w)/g,J=B((e=>e.replace(V,((e,t)=>t?t.toUpperCase():"")))),W=/\B([A-Z])/g,K=B((e=>e.replace(W,"-$1").toLowerCase())),G=B((e=>e.charAt(0).toUpperCase()+e.slice(1))),Y=B((e=>e?`on${G(e)}`:"")),Z=(e,t)=>!Object.is(e,t),X=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},ee=e=>{const t=parseFloat(e);return isNaN(t)?e:t},te=e=>{const t=T(e)?Number(e):NaN;return isNaN(t)?e:t};let ne;const re=()=>ne||(ne="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{})},5698:(e,t,n)=>{"use strict";var r=n(3131),o=n(9947),i=n(4611),l=n(6056),c=n(4634),a=n(7788),s=n(9963),u=n(6252),f=n(2201),p=n(4546),d=n(3447),h=n(704);const m=s.vr,v=f.PO;(async()=>{const e=m({name:"VuepressApp",setup(){(0,p.BK)();for(const e of i.l)e();return()=>[(0,u.h)(f.MA),...o.p.map((e=>(0,u.h)(e)))]}}),t=(0,f.p7)({history:v((0,a.U1)(p.HM.value.base)),routes:c.g,scrollBehavior:(e,t,n)=>n||(e.hash?{el:e.hash}:{top:0})});t.beforeResolve((async(e,t)=>{var n;e.path===t.path&&t!==f.AJ||([p.Xp.value]=await Promise.all([(0,p.C4)(e.name),null===(n=l.b[e.name])||void 0===n?void 0:n.__asyncLoader()]))})),((e,t)=>{const n=(0,u.Fl)((()=>(0,p.S)(p.HM.value.locales,t.currentRoute.value.path))),r=(0,u.Fl)((()=>(0,p.kY)(p.HM.value,n.value))),o=(0,u.Fl)((()=>(0,p.hN)(p.Xp.value))),i=(0,u.Fl)((()=>(0,p.lp)(p.Xp.value,r.value))),l=(0,u.Fl)((()=>(0,p.nl)(i.value,o.value,r.value))),c=(0,u.Fl)((()=>(0,p.Vo)(p.Xp.value)));e.provide(p.C3,n),e.provide(p.AE,r),e.provide(p.PY,o),e.provide(p.et,i),e.provide(p.VV,l),e.provide(p.b5,c),Object.defineProperties(e.config.globalProperties,{$frontmatter:{get:()=>o.value},$headTitle:{get:()=>i.value},$lang:{get:()=>c.value},$page:{get:()=>p.Xp.value},$routeLocale:{get:()=>n.value},$site:{get:()=>p.HM.value},$siteLocale:{get:()=>r.value},$withBase:{get:()=>d.pJ}})})(e,t),(e=>{e.component("ClientOnly",h.qx),e.component("Content",h.VY),e.component("OutboundLink",h.MS)})(e);for(const n of r.g)await n({app:e,router:t,siteData:p.HM});return e.use(t),{app:e,router:t}})().then((({app:e,router:t})=>{t.isReady().then((()=>{e.mount("#app")}))}))},4802:(e,t,n)=>{"use strict";n.d(t,{Y:()=>c});var r=n(4150),o=n(7788),i=n(6252),l=n(4546);const c=(0,i.aZ)({name:"Vuepress",setup(){const e=(0,l.Vi)(),t=(0,i.Fl)((()=>{let t;if(e.value.path){const n=e.value.frontmatter.layout;t=(0,o.HD)(n)?n:"Layout"}else t="404";return r.Z[t]||(0,i.up)(t,!1)}));return()=>(0,i.h)(t.value)}})},704:(e,t,n)=>{"use strict";n.d(t,{qx:()=>i,VY:()=>a,MS:()=>u});var r=n(6252),o=n(2262);const i=(0,r.aZ)({setup(e,t){const n=(0,o.iH)(!1);return(0,r.bv)((()=>{n.value=!0})),()=>{var e,r;return n.value?null===(r=(e=t.slots).default)||void 0===r?void 0:r.call(e):null}}});var l=n(6056),c=n(4546);const a=e=>{let t;t=e.pageKey?e.pageKey:(0,c.Vi)().value.key;const n=l.b[t];return n?(0,r.h)(n):(0,r.h)("div","404 Not Found")};a.displayName="Content",a.props={pageKey:{type:String,required:!1}};const s=(0,r.h)("svg",{class:"icon outbound",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"},[(0,r.h)("path",{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}),(0,r.h)("polygon",{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"})]),u=(e,{slots:t})=>{var n;return(0,r.h)("span",[s,null===(n=t.default)||void 0===n?void 0:n.call(t)])};u.displayName="OutboundLink",n(4802)},4546:(e,t,n)=>{"use strict";n.d(t,{Xp:()=>c,PY:()=>f,VV:()=>m,et:()=>y,b5:()=>g,C4:()=>s,hN:()=>d,nl:()=>v,lp:()=>_,Vo:()=>O,S:()=>E,kY:()=>x,C3:()=>w,BK:()=>N,HM:()=>P,AE:()=>C,Vi:()=>a,I2:()=>p,Ym:()=>b,I:()=>S,WF:()=>k,I5:()=>I});var r=n(2262),o=n(9706);const i=(0,r.iH)(o.T),l=(0,r.OT)({key:"",path:"",title:"",lang:"",frontmatter:{},excerpt:"",headers:[]}),c=(0,r.iH)(l),a=()=>c,s=async e=>{const t=i.value[e];if(!t)return l;const n=await t();return null!=n?n:l};var u=n(6252);const f=Symbol(""),p=()=>{const e=(0,u.f3)(f);if(!e)throw new Error("usePageFrontmatter() is called without provider.");return e},d=e=>e.frontmatter;var h=n(7788);const m=Symbol(""),v=(e,t,n)=>{const r=(0,h.HD)(t.description)?t.description:n.description,o=[...(0,h.kJ)(t.head)?t.head:[],...n.head,["title",{},e],["meta",{name:"description",content:r}]];return(0,h.H7)(o)},y=Symbol(""),_=(e,t)=>`${e.title?`${e.title} | `:""}${t.title}`,g=Symbol(""),b=()=>{const e=(0,u.f3)(g);if(!e)throw new Error("usePageLang() is called without provider.");return e},O=e=>e.lang||"en",w=Symbol(""),S=()=>{const e=(0,u.f3)(w);if(!e)throw new Error("useRouteLocale() is called without provider.");return e},E=(e,t)=>(0,h.gb)(e,t);var j=n(5220);const P=(0,r.iH)(j.H),k=()=>P,C=Symbol(""),I=()=>{const e=(0,u.f3)(C);if(!e)throw new Error("useSiteLocaleData() is called without provider.");return e},x=(e,t)=>({...e,...e.locales[t]});var A=n(2201);const D=Symbol(""),N=()=>{const e=(0,A.yj)(),t=(()=>{const e=(0,u.f3)(m);if(!e)throw new Error("usePageHead() is called without provider.");return e})(),n=b(),o=(0,r.iH)([]),i=()=>{document.documentElement.lang=n.value,o.value.forEach((e=>{e.parentNode===document.head&&document.head.removeChild(e)})),o.value.splice(0,o.value.length),t.value.forEach((e=>{const t=R(e);null!==t&&(document.head.appendChild(t),o.value.push(t))}))};(0,u.JJ)(D,i),(0,u.bv)((()=>{t.value.forEach((e=>{const t=T(e);t&&o.value.push(t)})),i(),(0,u.YP)((()=>e.path),(()=>i()))}))},T=([e,t,n=""])=>{const r=`head > ${e}${Object.entries(t).map((([e,t])=>(0,h.HD)(t)?`[${e}="${t}"]`:!0===t?`[${e}]`:"")).join("")}`;return Array.from(document.querySelectorAll(r)).find((e=>e.innerText===n))||null},R=([e,t,n])=>{if(!(0,h.HD)(e))return null;const r=document.createElement(e);return(0,h.PO)(t)&&Object.entries(t).forEach((([e,t])=>{(0,h.HD)(t)?r.setAttribute(e,t):!0===t&&r.setAttribute(e,"")})),(0,h.HD)(n)&&r.appendChild(document.createTextNode(n)),r}},7621:(e,t,n)=>{"use strict";n.d(t,{C3:()=>o.C3,F2:()=>i.F2,I:()=>o.I,I2:()=>o.I2,I5:()=>o.I5,MS:()=>r.MS,Vi:()=>o.Vi,WF:()=>o.WF,Ym:()=>o.Ym,pJ:()=>i.pJ,vW:()=>i.vW}),n(5698);var r=n(704),o=n(4546),i=n(3447)},3447:(e,t,n)=>{"use strict";n.d(t,{vW:()=>r,F2:()=>o,pJ:()=>c});const r=e=>e,o=e=>e;var i=n(7788),l=n(4546);const c=e=>(0,i.ak)(e)?e:`${(0,l.WF)().value.base}${(0,i.FY)(e)}`},1263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(7621),o=n(2938),i=n(6252),l=n(2201);const c=async(e,...t)=>{const{scrollBehavior:n}=e.options;e.options.scrollBehavior=void 0,await e.replace(...t).finally((()=>e.options.scrollBehavior=n))},a=(0,r.F2)((()=>{(({headerLinkSelector:e,headerAnchorSelector:t,delay:n,offset:a=5})=>{const s=(0,l.tv)(),u=(0,r.Vi)(),f=(0,o.D)((()=>(()=>{var n,r,o,i;const l=Array.from(document.querySelectorAll(e)),u=Array.from(document.querySelectorAll(t)).filter((e=>l.some((t=>t.hash===e.hash)))),f=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),p=window.innerHeight+f,d=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),h=Math.abs(d-p)=(null!==(r=null===(n=t.parentElement)||void 0===n?void 0:n.offsetTop)&&void 0!==r?r:0)-a,m=!l||f<(null!==(i=null===(o=l.parentElement)||void 0===o?void 0:o.offsetTop)&&void 0!==i?i:0)-a;if(!(p||d&&m))continue;const v=decodeURIComponent(s.currentRoute.value.hash),y=decodeURIComponent(t.hash);if(v===y)return;if(h)for(let t=e+1;t{f(),window.addEventListener("scroll",(()=>f()))})),(0,i.Jd)((()=>{window.removeEventListener("scroll",(()=>f()))})),(0,i.YP)((()=>u.value.path),(()=>f()))})({headerLinkSelector:"a.sidebar-item",headerAnchorSelector:".header-anchor",delay:200,offset:5})}))},3051:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(2938),o=n(6252),i=n(2262),l=n(9963);const c=()=>window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,a=()=>window.scrollTo({top:0,behavior:"smooth"}),s=(0,o.aZ)({name:"BackToTop",setup(){const e=(0,i.iH)(0),t=(0,o.Fl)((()=>e.value>300));(0,o.bv)((()=>{e.value=c(),window.addEventListener("scroll",(()=>(0,r.D)((()=>{e.value=c()}),100)))}));const n=(0,o.h)("div",{class:"back-to-top",onClick:a});return()=>(0,o.h)(l.uT,{name:"back-to-top"},{default:()=>t.value?n:null})}})},6934:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Qr});var r=n(7621),o=n(6252);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){return(c=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n3)for(n=[n],i=3;i0?j(d.type,d.props,d.key,null,d.__v):d)){if(d.__=n,d.__b=n.__b+1,null===(p=y[u])||p&&d.key==p.key&&d.type===p.type)y[u]=void 0;else for(f=0;f<_;f++){if((p=y[f])&&d.key==p.key&&d.type===p.type){y[f]=void 0;break}p=null}U(e,d,p=p||g,o,i,l,c,a,s),h=d.__e,(f=d.ref)&&p.ref!=f&&(v||(v=[]),p.ref&&v.push(p.ref,null,d),v.push(f,d.__c||h,d)),null!=h?(null==m&&(m=h),"function"==typeof d.type&&null!=d.__k&&d.__k===p.__k?d.__d=a=N(d,a,e):a=R(e,d,p,y,h,a),s||"option"!==n.type?"function"==typeof n.type&&(n.__d=a):e.value=""):a&&p.__e==a&&a.parentNode!=e&&(a=C(p))}for(n.__e=m,u=_;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=C(r,u+1)),B(y[u],y[u]));if(v)for(u=0;u3)for(n=[n],i=3;i=n.__.length&&n.__.push({}),n.__[e]}function le(e){return X=1,ce(ve,e)}function ce(e,t,n){var r=ie(G++,2);return r.t=e,r.__c||(r.__=[n?n(t):ve(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=Y),r.__}function ae(e,t){var n=ie(G++,3);!h.__s&&me(n.__H,t)&&(n.__=e,n.__H=t,Y.__H.__h.push(n))}function se(e,t){var n=ie(G++,4);!h.__s&&me(n.__H,t)&&(n.__=e,n.__H=t,Y.__h.push(n))}function ue(e,t){var n=ie(G++,7);return me(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function fe(){Q.forEach((function(e){if(e.__P)try{e.__H.__h.forEach(de),e.__H.__h.forEach(he),e.__H.__h=[]}catch(t){e.__H.__h=[],h.__e(t,e.__v)}})),Q=[]}h.__b=function(e){Y=null,ee&&ee(e)},h.__r=function(e){te&&te(e),G=0;var t=(Y=e.__c).__H;t&&(t.__h.forEach(de),t.__h.forEach(he),t.__h=[])},h.diffed=function(e){ne&&ne(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==Q.push(t)&&Z===h.requestAnimationFrame||((Z=h.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),pe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);pe&&(t=requestAnimationFrame(n))})(fe)),Y=void 0},h.__c=function(e,t){t.some((function(e){try{e.__h.forEach(de),e.__h=e.__h.filter((function(e){return!e.__||he(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],h.__e(n,e.__v)}})),re&&re(e,t)},h.unmount=function(e){oe&&oe(e);var t=e.__c;if(t&&t.__H)try{t.__H.__.forEach(de)}catch(e){h.__e(e,t.__v)}};var pe="function"==typeof requestAnimationFrame;function de(e){var t=Y;"function"==typeof e.__c&&e.__c(),Y=t}function he(e){var t=Y;e.__c=e.__(),Y=t}function me(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function ve(e,t){return"function"==typeof t?t(e):t}function ye(e,t){for(var n in t)e[n]=t[n];return e}function _e(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function ge(e){this.props=e}(ge.prototype=new k).isPureReactComponent=!0,ge.prototype.shouldComponentUpdate=function(e,t){return _e(this.props,e)||_e(this.state,t)};var be=h.__b;h.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),be&&be(e)};var Oe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911,we=function(e,t){return null==e?null:T(T(e).map(t))},Se={map:we,forEach:we,count:function(e){return e?T(e).length:0},only:function(e){var t=T(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:T},Ee=h.__e;function je(){this.__u=0,this.t=null,this.__b=null}function Pe(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function ke(){this.u=null,this.o=null}h.__e=function(e,t,n){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);Ee(e,t,n)},(je.prototype=new k).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=Pe(r.__v),i=!1,l=function(){i||(i=!0,n.componentWillUnmount=n.__c,o?o(c):c())};n.__c=n.componentWillUnmount,n.componentWillUnmount=function(){l(),n.__c&&n.__c()};var c=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},a=!0===t.__h;r.__u++||a||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(l,l)},je.prototype.componentWillUnmount=function(){this.t=[]},je.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=ye({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__e&&E(P,null,e.fallback);return o&&(o.__h=null),[E(P,null,t.__e?null:e.children),o]};var Ce=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),J(E(Ie,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Ae(e,t){return E(xe,{__v:e,i:t})}(ke.prototype=new k).__e=function(e){var t=this,n=Pe(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Ce(t,e,r)):o()};n?n(i):i()}},ke.prototype.render=function(e){this.u=null,this.o=new Map;var t=T(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ke.prototype.componentDidUpdate=ke.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){Ce(e,n,t)}))};var De="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ne=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Te=function(e){return("undefined"!=typeof Symbol&&"symbol"==i(Symbol())?/fil|che|rad/i:/fil|che|ra/i).test(e)};function Re(e,t,n){return null==t.__k&&(t.textContent=""),J(e,t),"function"==typeof n&&n(),e?e.__c:null}k.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(k.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Le=h.event;function Me(){}function Fe(){return this.cancelBubble}function He(){return this.defaultPrevented}h.event=function(e){return Le&&(e=Le(e)),e.persist=Me,e.isPropagationStopped=Fe,e.isDefaultPrevented=He,e.nativeEvent=e};var Ue,ze={configurable:!0,get:function(){return this.class}},qe=h.vnode;h.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){for(var o in r={},n){var i=n[o];"value"===o&&"defaultValue"in n&&null==i||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===i?i="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!Te(n.type)?o="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():Ne.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===i&&(i=void 0),r[o]=i)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=T(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=T(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r}t&&n.class!=n.className&&(ze.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",ze)),e.$$typeof=De,qe&&qe(e)};var $e=h.__r;h.__r=function(e){$e&&$e(e),Ue=e.__c};var Be={ReactCurrentDispatcher:{current:{readContext:function(e){return Ue.__n[e.__c].props.value}}}};function Ve(e){return!!e&&e.$$typeof===De}"object"==("undefined"==typeof performance?"undefined":i(performance))&&"function"==typeof performance.now&&performance.now.bind(performance);var Je={useState:le,useReducer:ce,useEffect:ae,useLayoutEffect:se,useRef:function(e){return X=5,ue((function(){return{current:e}}),[])},useImperativeHandle:function(e,t,n){X=6,se((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))},useMemo:ue,useCallback:function(e,t){return X=8,ue((function(){return e}),t)},useContext:function(e){var t=Y.context[e.__c],n=ie(G++,9);return n.__c=e,t?(null==n.__&&(n.__=!0,t.sub(Y)),t.props.value):e.__},useDebugValue:function(e,t){h.useDebugValue&&h.useDebugValue(t?t(e):e)},version:"16.8.0",Children:Se,render:Re,hydrate:function(e,t,n){return W(e,t),"function"==typeof n&&n(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(J(null,e),!0)},createPortal:Ae,createElement:E,createContext:function(e,t){var n={__c:t="__cC"+_++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(x)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},createFactory:function(e){return E.bind(null,e)},cloneElement:function(e){return Ve(e)?K.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:P,isValidElement:Ve,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:k,PureComponent:ge,memo:function(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:_e(this.props,e)}function r(t){return this.shouldComponentUpdate=n,E(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r},forwardRef:function(e){function t(t,n){var r=ye({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=i(n)||"current"in n)?n:null)}return t.$$typeof=Oe,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:P,Suspense:je,SuspenseList:ke,lazy:function(e){var t,n,r;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return E(n,o)}return o.displayName="Lazy",o.__f=!0,o},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Be};function We(){return Je.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},Je.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}function Ke(){return Je.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},Je.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function Ge(){return(Ge=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["translations"]),i=r.buttonText,l=void 0===i?"Search":i,c=r.buttonAriaLabel,a=void 0===c?"Search":c,s=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var l,c=e[Symbol.iterator]();!(r=(l=c.next()).done)&&(n.push(l.value),2!==n.length);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}}(e)||function(e,t){if(e){if("string"==typeof e)return Ye(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ye(e,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(le(null)),u=s[0],f=s[1];return ae((function(){"undefined"!=typeof navigator&&f(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?"⌘":"Ctrl")}),[]),Je.createElement("button",Ge({type:"button",className:"DocSearch DocSearch-Button","aria-label":a},o,{ref:t}),Je.createElement("span",{className:"DocSearch-Button-Container"},Je.createElement(Ke,null),Je.createElement("span",{className:"DocSearch-Button-Placeholder"},l)),null!==u&&Je.createElement("span",{className:"DocSearch-Button-Keys"},Je.createElement("span",{className:"DocSearch-Button-Key"},"Ctrl"===u?Je.createElement(We,null):u),Je.createElement("span",{className:"DocSearch-Button-Key"},"K")))}));function Xe(e){return 0===e.collections.length?0:e.collections.reduce((function(e,t){return e+t.items.length}),0)}function Qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tt(e){return e.reduce((function(e,t){return e.concat(t)}),[])}var nt=0;function rt(e,t,n,r){if(e<0&&(null===t||null!==r&&0===t))return n+e;var o=(null===t?-1:t)+e;return o<=-1||o>=n?null===r?null:0:o}var ot=function(){};function it(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ct(e){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function at(e){var t=function(e){var t=e.collections.map((function(e){return e.items.length})).reduce((function(e,t,n){var r=(e[n-1]||0)+t;return e.push(r),e}),[]).reduce((function(t,n){return n<=e.activeItemId?t+1:t}),0);return e.collections[t]}(e);if(!t)return null;var n=t.items[function(e){for(var t=e.state,n=e.collection,r=!1,o=0,i=0;!1===r;){var l=t.collections[o];if(l===n){r=!0;break}i+=l.items.length,o++}return t.activeItemId-i}({state:e,collection:t})],r=t.source;return{item:n,itemInputValue:r.getItemInputValue({item:n,state:e}),itemUrl:r.getItemUrl({item:n,state:e}),source:r}}function st(e,t){return e===t||e.contains(t)}function ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ft(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["event","nextState","props","query","refresh","store"]);Ot&&o.environment.clearTimeout(Ot);var s,u=a.setCollections,f=a.setIsOpen,p=a.setQuery,d=a.setActiveItemId,h=a.setStatus;return p(i),d(o.defaultActiveItemId),i||!1!==o.openOnFocus?(h("loading"),Ot=o.environment.setTimeout((function(){h("stalled")}),o.stallThreshold),o.getSources(gt({query:i,refresh:l,state:c.getState()},a)).then((function(e){return h("loading"),Promise.all(e.map((function(e){return Promise.resolve(e.getItems(gt({query:i,refresh:l,state:c.getState()},a))).then((function(t){return Array.isArray(t),"The `getItems` function must return an array of items but returned type ".concat(JSON.stringify(yt(t)),":\n\n").concat(JSON.stringify(t,null,2)),{source:e,items:t}}))}))).then((function(e){var n;h("idle"),u(e);var s=o.shouldPanelOpen({state:c.getState()});f(null!==(n=r.isOpen)&&void 0!==n?n:o.openOnFocus&&!i&&s||s);var p=at(c.getState());if(null!==c.getState().activeItemId&&p){var d=p.item,m=p.itemInputValue,v=p.itemUrl,y=p.source;y.onActive(gt({event:t,item:d,itemInputValue:m,itemUrl:v,refresh:l,source:y,state:c.getState()},a))}})).finally((function(){Ot&&o.environment.clearTimeout(Ot)}))}))):(h("idle"),u(c.getState().collections.map((function(e){return gt(gt({},e),{},{items:[]})}))),f(null!==(s=r.isOpen)&&void 0!==s?s:o.shouldPanelOpen({state:c.getState()})),Promise.resolve())}function St(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Et(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function xt(e){var t=e.state;return!1===t.isOpen||null===t.activeItemId?null:at(t).itemInputValue||null}function At(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t0}},e),{},{id:null!==(n=e.id)&&void 0!==n?n:"autocomplete-".concat(nt++),plugins:o,initialState:mt({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var n;null===(n=e.onStateChange)||void 0===n||n.call(e,t),o.forEach((function(e){var n;return null===(n=e.onStateChange)||void 0===n?void 0:n.call(e,t)}))},onSubmit:function(t){var n;null===(n=e.onSubmit)||void 0===n||n.call(e,t),o.forEach((function(e){var n;return null===(n=e.onSubmit)||void 0===n?void 0:n.call(e,t)}))},onReset:function(t){var n;null===(n=e.onReset)||void 0===n||n.call(e,t),o.forEach((function(e){var n;return null===(n=e.onReset)||void 0===n?void 0:n.call(e,t)}))},getSources:function(n){return Promise.all([].concat(function(e){return function(e){if(Array.isArray(e))return dt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return dt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dt(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(o.map((function(e){return e.getSources}))),[e.getSources]).filter(Boolean).map((function(e){return function(e,t){return Promise.resolve(e(t)).then((function(e){return Array.isArray(e),"The `getSources` function must return an array of sources but returned type ".concat(JSON.stringify(ct(e)),":\n\n").concat(JSON.stringify(e,null,2)),Promise.all(e.filter((function(e){return Boolean(e)})).map((function(e){e.sourceId;var t=function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["event","props","refresh","store"]);if("ArrowUp"===t.key||"ArrowDown"===t.key){t.preventDefault(),o.dispatch(t.key,null);var l=n.environment.document.getElementById("".concat(n.id,"-item-").concat(o.getState().activeItemId));l&&(l.scrollIntoViewIfNeeded?l.scrollIntoViewIfNeeded(!1):l.scrollIntoView(!1));var c=at(o.getState());if(null!==o.getState().activeItemId&&c){var a=c.item,s=c.itemInputValue,u=c.itemUrl,f=c.source;f.onActive(Et({event:t,item:a,itemInputValue:s,itemUrl:u,refresh:r,source:f,state:o.getState()},i))}}else if("Escape"===t.key)t.preventDefault(),o.dispatch(t.key,null);else if("Enter"===t.key){if(null===o.getState().activeItemId||o.getState().collections.every((function(e){return 0===e.items.length})))return;t.preventDefault();var p=at(o.getState()),d=p.item,h=p.itemInputValue,m=p.itemUrl,v=p.source;if(t.metaKey||t.ctrlKey)void 0!==m&&(v.onSelect(Et({event:t,item:d,itemInputValue:h,itemUrl:m,refresh:r,source:v,state:o.getState()},i)),n.navigator.navigateNewTab({itemUrl:m,item:d,state:o.getState()}));else if(t.shiftKey)void 0!==m&&(v.onSelect(Et({event:t,item:d,itemInputValue:h,itemUrl:m,refresh:r,source:v,state:o.getState()},i)),n.navigator.navigateNewWindow({itemUrl:m,item:d,state:o.getState()}));else if(t.altKey);else{if(void 0!==m)return v.onSelect(Et({event:t,item:d,itemInputValue:h,itemUrl:m,refresh:r,source:v,state:o.getState()},i)),void n.navigator.navigate({itemUrl:m,item:d,state:o.getState()});wt(Et({event:t,nextState:{isOpen:!1},props:n,query:h,refresh:r,store:o},i)).then((function(){v.onSelect(Et({event:t,item:d,itemInputValue:h,itemUrl:m,refresh:r,source:v,state:o.getState()},i))}))}}}(kt({event:e,props:t,refresh:n,store:r},o))},onFocus:i,onBlur:function(){l||r.dispatch("blur",null)},onClick:function(n){e.inputElement!==t.environment.document.activeElement||r.getState().isOpen||i(n)}},u)},getPanelProps:function(e){return kt({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){r.dispatch("mouseleave",null)}},e)},getListProps:function(e){return kt({role:"listbox","aria-labelledby":"".concat(t.id,"-label"),id:"".concat(t.id,"-list")},e)},getItemProps:function(e){var i=e.item,l=e.source,c=It(e,["item","source"]);return kt({id:"".concat(t.id,"-item-").concat(i.__autocomplete_id),role:"option","aria-selected":r.getState().activeItemId===i.__autocomplete_id,onMouseMove:function(e){if(i.__autocomplete_id!==r.getState().activeItemId){r.dispatch("mousemove",i.__autocomplete_id);var t=at(r.getState());if(null!==r.getState().activeItemId&&t){var l=t.item,c=t.itemInputValue,a=t.itemUrl,s=t.source;s.onActive(kt({event:e,item:l,itemInputValue:c,itemUrl:a,refresh:n,source:s,state:r.getState()},o))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var c=l.getItemInputValue({item:i,state:r.getState()}),a=l.getItemUrl({item:i,state:r.getState()});(a?Promise.resolve():wt(kt({event:e,nextState:{isOpen:!1},props:t,query:c,refresh:n,store:r},o))).then((function(){l.onSelect(kt({event:e,item:i,itemInputValue:c,itemUrl:a,refresh:n,source:l,state:r.getState()},o))}))}},c)}}}(Lt({props:n,refresh:l,store:r},o));function l(){return wt(Lt({event:new Event("input"),nextState:{isOpen:r.getState().isOpen},props:n,query:r.getState().query,refresh:l,store:r},o))}return n.plugins.forEach((function(e){var n;return null===(n=e.subscribe)||void 0===n?void 0:n.call(e,Lt(Lt({},o),{},{refresh:l,onSelect:function(e){t.push({onSelect:e})},onActive:function(e){t.push({onActive:e})}}))})),Lt(Lt({refresh:l},i),o)}var Ht="1.0.0-alpha.44";function Ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zt(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&Je.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},Je.createElement("p",{className:"DocSearch-Help"},"Try searching for:"),Je.createElement("ul",null,t.slice(0,3).reduce((function(t,n){return[].concat(function(e){return function(e){if(Array.isArray(e))return cn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return cn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t),[Je.createElement("li",{key:n},Je.createElement("button",{className:"DocSearch-Prefill",key:n,onClick:function(){e.setQuery(n.toLowerCase()+" "),e.refresh(),e.inputRef.current.focus()}},n))])}),[]))),Je.createElement("p",{className:"DocSearch-Help"},"Believe this query should return results?"," ",Je.createElement("a",{href:"https://github.com/algolia/docsearch-configs/issues/new?template=Missing_results.md&title=[".concat(e.indexName,']+Missing+results+for+query+"').concat(e.state.query,'"'),target:"_blank",rel:"noopener noreferrer"},"Let us know"),"."))}function sn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function un(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["hit","attribute","tagName"])),{},{dangerouslySetInnerHTML:{__html:pn(t,"_snippetResult.".concat(n,".value"))||pn(t,n)}}))}function hn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var l,c=e[Symbol.iterator]();!(r=(l=c.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return mn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}));return e.state.query?!1===t?Je.createElement(an,e):Je.createElement(bn,e):Je.createElement(wn,Sn({},e,{hasCollections:t}))}),(function(e,t){return"loading"===t.state.status||"stalled"===t.state.status}));function jn(){return(jn=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["_highlightResult","_snippetResult"])),l=i.findIndex((function(e){return e.objectID===n.objectID}));l>-1&&i.splice(l,1),i.unshift(n),i=i.slice(0,r),o.setItem(i)},remove:function(e){i=i.filter((function(t){return t.objectID!==e.objectID})),o.setItem(i)},getAll:function(){return i}}}function Cn(e){var t,n="algoliasearch-client-js-".concat(e.key),r=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},o=function(){return JSON.parse(r().getItem(n)||"{}")};return{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var n=JSON.stringify(e),r=o()[n];return Promise.all([r||t(),void 0!==r])})).then((function(e){var t=u(e,2),r=t[0],o=t[1];return Promise.all([r,o||n.miss(r)])})).then((function(e){return u(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var i=o();return i[JSON.stringify(e)]=t,r().setItem(n,JSON.stringify(i)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=o();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){r().removeItem(n)}))}}}function In(e){var t=f(e.caches),n=t.shift();return void 0===n?{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,n.miss(e)])})).then((function(e){return u(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,o).catch((function(){return In({caches:t}).get(e,r,o)}))},set:function(e,r){return n.set(e,r).catch((function(){return In({caches:t}).set(e,r)}))},delete:function(e){return n.delete(e).catch((function(){return In({caches:t}).delete(e)}))},clear:function(){return n.clear().catch((function(){return In({caches:t}).clear()}))}}}function xn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},i=JSON.stringify(n);if(i in t)return Promise.resolve(e.serializable?JSON.parse(t[i]):t[i]);var l=r(),c=o&&o.miss||function(){return Promise.resolve()};return l.then((function(e){return c(e)})).then((function(){return l}))},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function An(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function Dn(e,t){return t?(Object.keys(t).forEach((function(n){e[n]=t[n](e)})),e):e}function Nn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}var Ln={Read:1,Write:2,Any:3},Mn=1;function Fn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mn;return s(s({},e),{},{status:t,lastUpdate:Date.now()})}function Hn(e){return"string"==typeof e?{protocol:"https",url:e,accept:Ln.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||Ln.Any}}var Un="POST";function zn(e,t,n,r){var o=[],i=function(e,t){if("GET"!==e.method&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:s(s({},e.data),t.data);return JSON.stringify(n)}}(n,r),l=function(e,t){var n=s(s({},e.headers),t.headers),r={};return Object.keys(n).forEach((function(e){var t=n[e];r[e.toLowerCase()]=t})),r}(e,r),c=n.method,a="GET"!==n.method?{}:s(s({},n.data),r.data),u=s(s(s({"x-algolia-agent":e.userAgent.value},e.queryParameters),a),r.queryParameters),p=0,d=function t(a,s){var f=a.pop();if(void 0===f)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:Vn(o)};var d={data:i,headers:l,method:c,url:$n(f,n.path,u),connectTimeout:s(p,e.timeouts.connect),responseTimeout:s(p,r.timeout)},h=function(e){var t={request:d,response:e,host:f,triesLeft:a.length};return o.push(t),t},m={onSucess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var r=h(n);return n.isTimedOut&&p++,Promise.all([e.logger.info("Retryable failure",Jn(r)),e.hostsCache.set(f,Fn(f,n.isTimedOut?3:2))]).then((function(){return t(a,s)}))},onFail:function(e){throw h(e),function(e,t){var n=e.content,r=e.status,o=n;try{o=JSON.parse(n).message}catch(e){}return function(e,t,n){return{name:"ApiError",message:e,status:t,transporterStackTrace:n}}(o,r,t)}(e,Vn(o))}};return e.requester.send(d).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,n=e.status;return!t&&0==~~n}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSucess(e):t.onFail(e)}(e,m)}))};return function(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(Fn(t))}))}))).then((function(e){var n=e.filter((function(e){return function(e){return e.status===Mn||Date.now()-e.lastUpdate>12e4}(e)})),r=e.filter((function(e){return function(e){return 3===e.status&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(f(n),f(r));return{getTimeout:function(e,t){return(0===r.length&&0===e?1:r.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return Hn(e)})):t}}))}(e.hostsCache,t).then((function(e){return d(f(e.statelessHosts).reverse(),e.getTimeout)}))}function qn(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}function $n(e,t,n){var r=Bn(n),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return r.length&&(o+="?".concat(r)),o}function Bn(e){return Object.keys(e).map((function(t){return Nn("%s=%s",t,(n=e[t],"[object Object]"===Object.prototype.toString.call(n)||"[object Array]"===Object.prototype.toString.call(n)?JSON.stringify(e[t]):e[t]));var n})).join("&")}function Vn(e){return e.map((function(e){return Jn(e)}))}function Jn(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return s(s({},e),{},{request:s(s({},e.request),{},{headers:s(s({},e.request.headers),t)})})}var Wn=function(e){var t=e.appId,n=function(e,t,n){var r={"x-algolia-api-key":n,"x-algolia-application-id":t};return{headers:function(){return e===Tn.WithinHeaders?r:{}},queryParameters:function(){return e===Tn.WithinQueryParameters?r:{}}}}(void 0!==e.authMode?e.authMode:Tn.WithinHeaders,t,e.apiKey),r=function(e){var t=e.hostsCache,n=e.logger,r=e.requester,o=e.requestsCache,i=e.responsesCache,l=e.timeouts,c=e.userAgent,a=e.hosts,s=e.queryParameters,f={hostsCache:t,logger:n,requester:r,requestsCache:o,responsesCache:i,timeouts:l,userAgent:c,headers:e.headers,queryParameters:s,hosts:a.map((function(e){return Hn(e)})),read:function(e,t){var n=Rn(t,f.timeouts.read),r=function(){return zn(f,f.hosts.filter((function(e){return 0!=(e.accept&Ln.Read)})),e,n)};if(!0!==(void 0!==n.cacheable?n.cacheable:e.cacheable))return r();var o={request:e,mappedRequestOptions:n,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(o,(function(){return f.requestsCache.get(o,(function(){return f.requestsCache.set(o,r()).then((function(e){return Promise.all([f.requestsCache.delete(o),e])}),(function(e){return Promise.all([f.requestsCache.delete(o),Promise.reject(e)])})).then((function(e){var t=u(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(o,e)}})},write:function(e,t){return zn(f,f.hosts.filter((function(e){return 0!=(e.accept&Ln.Write)})),e,Rn(t,f.timeouts.write))}};return f}(s(s({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:Ln.Read},{url:"".concat(t,".algolia.net"),accept:Ln.Write}].concat(An([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:s(s(s({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:s(s({},n.queryParameters()),e.queryParameters)}));return Dn({transporter:r,appId:t,addAlgoliaAgent:function(e,t){r.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([r.requestsCache.clear(),r.responsesCache.clear()]).then((function(){}))}},e.methods)},Kn=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Dn({transporter:e.transporter,appId:e.appId,indexName:t},n.methods)}},Gn=function(e){return function(t,n){var r=t.map((function(e){return s(s({},e),{},{params:Bn(e.params||{})})}));return e.transporter.read({method:Un,path:"1/indexes/*/queries",data:{requests:r},cacheable:!0},n)}},Yn=function(e){return function(t,n){return Promise.all(t.map((function(t){var r=t.params,o=r.facetName,i=r.facetQuery,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(r,["facetName","facetQuery"]);return Kn(e)(t.indexName,{methods:{searchForFacetValues:Qn}}).searchForFacetValues(o,i,s(s({},n),l))})))}},Zn=function(e){return function(t,n,r){return e.transporter.read({method:Un,path:Nn("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:n},cacheable:!0},r)}},Xn=function(e){return function(t,n){return e.transporter.read({method:Un,path:Nn("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},n)}},Qn=function(e){return function(t,n,r){return e.transporter.read({method:Un,path:Nn("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:n},cacheable:!0},r)}},er=1,tr=2,nr=3;function rr(e,t,n){var r,o={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return n.setRequestHeader(t,e.headers[t])}));var r,o=function(e,r){return setTimeout((function(){n.abort(),t({status:0,content:r,isTimedOut:!0})}),1e3*e)},i=o(e.connectTimeout,"Connection timeout");n.onreadystatechange=function(){n.readyState>n.OPENED&&void 0===r&&(clearTimeout(i),r=o(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(i),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(i),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)}))}},logger:(r=nr,{debug:function(e,t){return er>=r&&console.debug(e,t),Promise.resolve()},info:function(e,t){return tr>=r&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:xn(),requestsCache:xn({serializable:!1}),hostsCache:In({caches:[Cn({key:"".concat("4.8.5","-").concat(e)}),xn()]}),userAgent:qn("4.8.5").add({segment:"Browser",version:"lite"}),authMode:Tn.WithinQueryParameters};return Wn(s(s(s({},o),n),{},{methods:{search:Gn,searchForFacetValues:Yn,multipleQueries:Gn,multipleSearchForFacetValues:Yn,initIndex:function(e){return function(t){return Kn(e)(t,{methods:{search:Xn,searchForFacetValues:Qn,findAnswers:Zn}})}}}}))}function or(e,t){return e.reduce((function(e,n){var r=t(n);return e.hasOwnProperty(r)||(e[r]=[]),e[r].length<5&&e[r].push(n),e}),{})}function ir(e){return e}function lr(){}function cr(){return(cr=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n",highlightPostTag:"",hitsPerPage:20},c)}]}).catch((function(e){throw"RetryError"===e.name&&i("error"),e})).then((function(e){var t=e[0].hits,o=e[0].nbHits,i=or(t,(function(e){return e.hierarchy.lvl0}));return n.context.searchSuggestions.length0&&($(),D.current&&D.current.focus())}),[R,$]),Je.useEffect((function(){function e(){if(I.current){var e=.01*window.innerHeight;I.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),Je.createElement("div",cr({ref:C},q({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===P.status&&"DocSearch-Container--Stalled","error"===P.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),onMouseDown:function(e){e.target===e.currentTarget&&s()}}),Je.createElement("div",{className:"DocSearch-Modal",ref:I},Je.createElement("header",{className:"DocSearch-SearchBar",ref:x},Je.createElement(Pn,cr({},U,{state:P,autoFocus:0===R.length,onClose:s,inputRef:D,isFromSelection:Boolean(R)&&R===T}))),Je.createElement("div",{className:"DocSearch-Dropdown",ref:A},Je.createElement(En,cr({},U,{indexName:o,state:P,hitComponent:d,resultsFooterComponent:m,disableUserPersonalization:w,recentSearches:F,favoriteSearches:M,onItemClick:function(e){H(e),s()},inputRef:D}))),Je.createElement("footer",{className:"DocSearch-Footer"},Je.createElement(Vt,null))))}function dr(){return(dr=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);nt&&br.sort(Sr));Lr.__r=0}function Mr(e,t,n,r,o,i,l,c,a,s){var u,f,p,d,h,m,v,y=r&&r.__k||Pr,_=y.length;for(n.__k=[],u=0;u0?xr(d.type,d.props,d.key,d.ref?d.ref:null,d.__v):d)){if(d.__=n,d.__b=n.__b+1,null===(p=y[u])||p&&d.key==p.key&&d.type===p.type)y[u]=void 0;else for(f=0;f<_;f++){if((p=y[f])&&d.key==p.key&&d.type===p.type){y[f]=void 0;break}p=null}Vr(e,d,p=p||jr,o,i,l,c,a,s),h=d.__e,(f=d.ref)&&p.ref!=f&&(v||(v=[]),p.ref&&v.push(p.ref,null,d),v.push(f,d.__c||h,d)),null!=h?(null==m&&(m=h),"function"==typeof d.type&&d.__k===p.__k?d.__d=a=Fr(d,a,e):a=Hr(e,d,p,y,h,a),"function"==typeof n.type&&(n.__d=a)):a&&p.__e==a&&a.parentNode!=e&&(a=Nr(p))}for(n.__e=m,u=_;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=Ur(r).nextSibling),Kr(y[u],y[u]));if(v)for(u=0;u=0;t--)if((n=e.__k[t])&&(r=Ur(n)))return r;return null}function zr(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||kr.test(t)?n:n+"px"}function qr(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||zr(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||zr(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?Br:$r,i):e.removeEventListener(t,i?Br:$r,i);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function $r(e){return this.l[e.type+!1](_r.event?_r.event(e):e)}function Br(e){return this.l[e.type+!0](_r.event?_r.event(e):e)}function Vr(e,t,n,r,o,i,l,c,a){var s,u,f,p,d,h,m,v,y,_,g,b,O,w,S,E=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(a=n.__h,c=t.__e=n.__e,t.__h=null,i=[c]),(s=_r.__b)&&s(t);try{e:if("function"==typeof E){if(v=t.props,y=(s=E.contextType)&&r[s.__c],_=s?y?y.props.value:s.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in E&&E.prototype.render?t.__c=u=new E(v,_):(t.__c=u=new Dr(v,_),u.constructor=E,u.render=Gr),y&&y.sub(u),u.props=v,u.state||(u.state={}),u.context=_,u.__n=r,f=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=E.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Cr({},u.__s)),Cr(u.__s,E.getDerivedStateFromProps(v,u.__s))),p=u.props,d=u.state,u.__v=t,f)null==E.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==E.getDerivedStateFromProps&&v!==p&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(v,_),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(v,u.__s,_)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=v,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),g=0;g{const e=(0,Yr.tv)(),t=(0,r.WF)();return{transformItems:e=>e.map((e=>({...e,url:(0,Er.rl)(e.url,t.value.base)}))),hitComponent:({hit:t,children:n})=>function(e,t,n){var r,o,i,l={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?yr.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===l[i]&&(l[i]=e.defaultProps[i]);return xr(e,l,r,o,null)}("a",{href:t.url,onClick:n=>{(e=>1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)(n)||(n.preventDefault(),e.push(t.url))}},n),navigator:{navigate:({itemUrl:t})=>{e.push(t)}}}})(),l=(0,o.Fl)((()=>{var n;return{...e.options,...null===(n=e.options.locales)||void 0===n?void 0:n[t.value]}})),a=[],s=()=>{var e,t;a.splice(0,a.length,`lang:${n.value}`,...null!==(t=null===(e=l.value.searchParameters)||void 0===e?void 0:e.facetFilters)&&void 0!==t?t:[]),function(e){Re(Je.createElement(vr,c({},e,{transformSearchClient:function(t){return t.addAlgoliaAgent("docsearch.js","3.0.0-alpha.34"),e.transformSearchClient?e.transformSearchClient(t):t}})),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return"string"==typeof e?t.document.querySelector(e):e}(e.container,e.environment))}({...i,...l.value,container:"#docsearch-container",searchParameters:{...l.value.searchParameters,facetFilters:a}})};return(0,o.bv)((()=>{s(),(0,o.YP)([t,l],(([e,t],[n,r])=>{e!==n&&JSON.stringify(t)!==JSON.stringify(r)&&s()})),(0,o.YP)(n,((e,t)=>{if(e!==t){const n=a.findIndex((e=>e===`lang:${t}`));n>-1&&a.splice(n,1,`lang:${e}`)}}))})),()=>(0,o.h)("div",{id:"docsearch-container"})}}),Xr={appId:"4ZF3BCJTP5",apiKey:"09ff75bbe16bc6e166e103ffb57e10ea",indexName:"fesjs",locales:{"/":{placeholder:"搜索文档"}}},Qr=(0,r.vW)((({app:e})=>{e.component("Docsearch",(()=>(0,o.h)(Zr,{options:Xr})))}))},6971:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(7621),o=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r=window.Promise||function(e){function t(){}e(t,t)},i=function(){for(var e=arguments.length,t=Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{}).target,t=function(){var e={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},t=void 0,n=void 0;if(y.container)if(y.container instanceof Object)t=(e=o({},e,y.container)).width-e.left-e.right-2*y.margin,n=e.height-e.top-e.bottom-2*y.margin;else{var r=(l(y.container)?y.container:document.querySelector(y.container)).getBoundingClientRect(),i=r.width,a=r.height,s=r.left,u=r.top;e=o({},e,{width:i,height:a,left:s,top:u})}t=t||e.width-2*y.margin,n=n||e.height-2*y.margin;var f=_.zoomedHd||_.original,p=c(f)?t:f.naturalWidth||t,d=c(f)?n:f.naturalHeight||n,h=f.getBoundingClientRect(),m=h.top,v=h.left,g=h.width,b=h.height,O=Math.min(Math.max(g,p),t)/g,w=Math.min(Math.max(b,d),n)/b,S=Math.min(O,w),E="scale("+S+") translate3d("+((t-g)/2-v+y.margin+e.left)/S+"px, "+((n-b)/2-m+y.margin+e.top)/S+"px, 0)";_.zoomed.style.transform=E,_.zoomedHd&&(_.zoomedHd.style.transform=E)};return new r((function(n){if(e&&-1===d.indexOf(e))n(b);else if(_.zoomed)n(b);else{if(e)_.original=e;else{if(!(d.length>0))return void n(b);var r=d;_.original=r[0]}if(_.original.dispatchEvent(s("medium-zoom:open",{detail:{zoom:b}})),v=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,m=!0,_.zoomed=function(e){var t=e.getBoundingClientRect(),n=t.top,r=t.left,o=t.width,i=t.height,l=e.cloneNode(),c=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,a=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;return l.removeAttribute("id"),l.style.position="absolute",l.style.top=n+c+"px",l.style.left=r+a+"px",l.style.width=o+"px",l.style.height=i+"px",l.style.transform="",l}(_.original),document.body.appendChild(g),y.template){var o=l(y.template)?y.template:document.querySelector(y.template);_.template=document.createElement("div"),_.template.appendChild(o.content.cloneNode(!0)),document.body.appendChild(_.template)}if(_.original.parentElement&&"PICTURE"===_.original.parentElement.tagName&&_.original.currentSrc&&(_.zoomed.src=_.original.currentSrc),document.body.appendChild(_.zoomed),window.requestAnimationFrame((function(){document.body.classList.add("medium-zoom--opened")})),_.original.classList.add("medium-zoom-image--hidden"),_.zoomed.classList.add("medium-zoom-image--opened"),_.zoomed.addEventListener("click",f),_.zoomed.addEventListener("transitionend",(function e(){m=!1,_.zoomed.removeEventListener("transitionend",e),_.original.dispatchEvent(s("medium-zoom:opened",{detail:{zoom:b}})),n(b)})),_.original.getAttribute("data-zoom-src")){_.zoomedHd=_.zoomed.cloneNode(),_.zoomedHd.removeAttribute("srcset"),_.zoomedHd.removeAttribute("sizes"),_.zoomedHd.removeAttribute("loading"),_.zoomedHd.src=_.zoomed.getAttribute("data-zoom-src"),_.zoomedHd.onerror=function(){clearInterval(i),console.warn("Unable to reach the zoom image target "+_.zoomedHd.src),_.zoomedHd=null,t()};var i=setInterval((function(){_.zoomedHd.complete&&(clearInterval(i),_.zoomedHd.classList.add("medium-zoom-image--opened"),_.zoomedHd.addEventListener("click",f),document.body.appendChild(_.zoomedHd),t())}),10)}else if(_.original.hasAttribute("srcset")){_.zoomedHd=_.zoomed.cloneNode(),_.zoomedHd.removeAttribute("sizes"),_.zoomedHd.removeAttribute("loading");var c=_.zoomedHd.addEventListener("load",(function(){_.zoomedHd.removeEventListener("load",c),_.zoomedHd.classList.add("medium-zoom-image--opened"),_.zoomedHd.addEventListener("click",f),document.body.appendChild(_.zoomedHd),t()}))}else t()}}))},f=function(){return new r((function(e){!m&&_.original?(m=!0,document.body.classList.remove("medium-zoom--opened"),_.zoomed.style.transform="",_.zoomedHd&&(_.zoomedHd.style.transform=""),_.template&&(_.template.style.transition="opacity 150ms",_.template.style.opacity=0),_.original.dispatchEvent(s("medium-zoom:close",{detail:{zoom:b}})),_.zoomed.addEventListener("transitionend",(function t(){_.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(_.zoomed),_.zoomedHd&&document.body.removeChild(_.zoomedHd),document.body.removeChild(g),_.zoomed.classList.remove("medium-zoom-image--opened"),_.template&&document.body.removeChild(_.template),m=!1,_.zoomed.removeEventListener("transitionend",t),_.original.dispatchEvent(s("medium-zoom:closed",{detail:{zoom:b}})),_.original=null,_.zoomed=null,_.zoomedHd=null,_.template=null,e(b)}))):e(b)}))},p=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target;return _.original?f():u({target:e})},d=[],h=[],m=!1,v=0,y=n,_={original:null,zoomed:null,zoomedHd:null,template:null};"[object Object]"===Object.prototype.toString.call(t)?y=t:(t||"string"==typeof t)&&i(t);var g=function(e){var t=document.createElement("div");return t.classList.add("medium-zoom-overlay"),t.style.background=e,t}((y=o({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},y)).background);document.addEventListener("click",(function(e){var t=e.target;t!==g?-1!==d.indexOf(t)&&p({target:t}):f()})),document.addEventListener("keyup",(function(e){var t=e.key||e.keyCode;"Escape"!==t&&"Esc"!==t&&27!==t||f()})),document.addEventListener("scroll",(function(){if(!m&&_.original){var e=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(v-e)>y.scrollOffset&&setTimeout(f,150)}})),window.addEventListener("resize",f);var b={open:u,close:f,toggle:p,update:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e;if(e.background&&(g.style.background=e.background),e.container&&e.container instanceof Object&&(t.container=o({},y.container,e.container)),e.template){var n=l(e.template)?e.template:document.querySelector(e.template);t.template=n}return y=o({},y,t),d.forEach((function(e){e.dispatchEvent(s("medium-zoom:update",{detail:{zoom:b}}))})),b},clone:function(){return e(o({},y,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))},attach:i,detach:function(){for(var e=arguments.length,t=Array(e),n=0;n0?t.reduce((function(e,t){return[].concat(e,a(t))}),[]):d;return r.forEach((function(e){e.classList.remove("medium-zoom-image"),e.dispatchEvent(s("medium-zoom:detach",{detail:{zoom:b}}))})),d=d.filter((function(e){return-1===r.indexOf(e)})),b},on:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return d.forEach((function(r){r.addEventListener("medium-zoom:"+e,t,n)})),h.push({type:"medium-zoom:"+e,listener:t,options:n}),b},off:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return d.forEach((function(r){r.removeEventListener("medium-zoom:"+e,t,n)})),h=h.filter((function(n){return!(n.type==="medium-zoom:"+e&&n.listener.toString()===t.toString())})),b},getOptions:function(){return y},getImages:function(){return d},getZoomedImage:function(){return _.original}};return b},f=Symbol("mediumZoom"),p={},d=(0,r.vW)((({app:e,router:t})=>{const n=u(p);n.refresh=(e=".theme-default-content > img, .theme-default-content :not(a) > img")=>{n.detach(),n.attach(e)},e.provide(f,n),t.afterEach((()=>{setTimeout((()=>n.refresh()),400)}))}))},6243:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(7621),o=n(4865),i=n(6252),l=n(2201);const c=(0,r.F2)((()=>{(0,i.bv)((()=>{const e=(0,l.tv)(),t=new Set;t.add(e.currentRoute.value.path),o.configure({showSpinner:!1}),e.beforeEach((e=>{t.has(e.path)||o.start()})),e.afterEach((e=>{t.add(e.path),o.done()}))}))}))},8341:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(6252),o=n(7621),i=n(743),l=n(2262),c=n(9963);const a=(0,r.aZ)({name:"PwaPopup",props:{locales:{type:Object,required:!1,default:()=>({})}},setup(e){const t=(0,i.f$)(),n=(0,o.I)(),a=(0,r.Fl)((()=>{var t;return null!==(t=e.locales[n.value])&&void 0!==t?t:{message:"New content is available.",buttonText:"Refresh"}})),s=(0,l.iH)(!1),u=(0,l.iH)(null),f=()=>{s.value=!1,u.value&&((0,i.NY)(u.value),location.reload(!0))};return t.on("updated",(e=>{e&&(u.value=e,s.value=!0)})),()=>(0,r.h)(c.uT,{name:"pwa-popup"},{default:()=>s.value?(0,r.h)("div",{class:"pwa-popup"},[a.value.message,(0,r.h)("br"),(0,r.h)("button",{onClick:f},a.value.buttonText)]):null})}}),s={"/":{message:"发现新内容可用",buttonText:"刷新"}},u=()=>(0,r.h)(a,{locales:s});u.displayName="PwaPopupWrapper";const f=u},4862:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(7621),o=n(6252),i=n(743);const l=(0,r.F2)((()=>{const e=(...e)=>console.log("[@vuepress/plugin-pwa]",...e),t={all:l=l||new Map,on:function(e,t){var n=l.get(e);n?n.push(t):l.set(e,[t])},off:function(e,t){var n=l.get(e);n&&(t?n.splice(n.indexOf(t)>>>0,1):l.set(e,[]))},emit:function(e,t){var n=l.get(e);n&&n.slice().map((function(e){e(t)})),(n=l.get("*"))&&n.slice().map((function(n){n(e,t)}))}};var l;(0,o.JJ)(i.Lg,t),(0,o.bv)((async()=>{const{register:o}=await n.e(205).then(n.bind(n,5205));o((0,r.pJ)("service-worker.js"),{ready(n){e("Service worker is active."),t.emit("ready",n)},registered(n){e("Service worker has been registered."),t.emit("registered",n)},cached(n){e("Content has been cached for offline use."),t.emit("cached",n)},updatefound(n){e("New content is downloading."),t.emit("updatefound",n)},updated(n){e("New content is available, please refresh."),t.emit("updated",n)},offline(){e("No internet connection found. App is running in offline mode."),t.emit("offline")},error(n){e("Error during service worker registration:",n),t.emit("error",n)}})}))}))},743:(e,t,n)=>{"use strict";n.d(t,{Lg:()=>o,f$:()=>i,NY:()=>l});var r=n(6252);const o=Symbol("pwaEvent"),i=()=>{const e=(0,r.f3)(o);if(!e)throw new Error("usePwaEvent() is called without provider.");return e},l=e=>{const t=e.waiting;if(!t)return;const n=new MessageChannel;t.postMessage({type:"SKIP_WAITING"},[n.port2])}},1598:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(7621),o=n(6252),i=n(3197);const l=(0,r.vW)((({app:e})=>{const t=(0,i.BV)(),n=e._context.provides[r.C3],l=(0,o.Fl)((()=>(0,i.g$)(t.value,n.value)));e.provide(i.ZS,l),Object.defineProperties(e.config.globalProperties,{$theme:{get:()=>t.value},$themeLocale:{get:()=>l.value}})}))},3197:(e,t,n)=>{"use strict";n.d(t,{g$:()=>s,ZS:()=>c,BV:()=>i,X6:()=>a});var r=n(2232);const o=(0,n(2262).iH)(r.f),i=()=>o;var l=n(6252);const c=Symbol(""),a=()=>{const e=(0,l.f3)(c);if(!e)throw new Error("useThemeLocaleData() is called without provider.");return e},s=(e,t)=>{var n;return{...e,...null===(n=e.locales)||void 0===n?void 0:n[t]}}},7788:(e,t,n)=>{"use strict";n.d(t,{H7:()=>o,kJ:()=>r.kJ,mf:()=>r.mf,ak:()=>i,B2:()=>l,R5:()=>c,PO:()=>a,HD:()=>r.HD,U1:()=>s,FY:()=>u,gb:()=>f,rl:()=>p});var r=n(3577);const o=e=>{const t=new Set,n=[];return e.forEach((e=>{const r=(([e,t,n])=>"meta"===e&&t.name?`${e}.${t.name}`:["title","base"].includes(e)?e:"template"===e&&t.id?`${e}.${t.id}`:JSON.stringify([e,t,n]))(e);t.has(r)||(t.add(r),n.push(e))})),n},i=e=>/^(https?:)?\/\//.test(e),l=e=>/^mailto:/.test(e),c=e=>/^tel:/.test(e),a=e=>"[object Object]"===Object.prototype.toString.call(e),s=e=>e.replace(/\/$/,""),u=e=>e.replace(/^\//,""),f=(e,t)=>{const n=Object.keys(e).sort(((e,t)=>{const n=t.split("/").length-e.split("/").length;return 0!==n?n:t.length-e.length}));for(const e of n)if(t.startsWith(e))return e;return"/"},p=(e,t="/")=>e.replace(/^(https?:)?\/\/[^/]*/,"").replace(new RegExp(`^${t}`),"/")},2009:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(7621),o=n(6252),i=n(3577);const l=(0,o.aZ)({__name:"Badge",props:{type:{type:String,required:!1,default:"tip"},text:{type:String,required:!1,default:""},vertical:{type:String,required:!1,default:void 0}},setup:e=>(t,n)=>((0,o.wg)(),(0,o.iD)("span",{class:(0,i.C_)(["badge",e.type]),style:(0,i.j5)({verticalAlign:e.vertical})},[(0,o.WI)(t.$slots,"default",{},(()=>[(0,o.Uk)((0,i.zw)(e.text),1)]))],6))});var c=n(2262);const a=(0,o.aZ)({name:"CodeGroup",setup(e,{slots:t}){const n=(0,c.iH)(-1),r=(0,c.iH)([]);return()=>{var e;const i=((null===(e=t.default)||void 0===e?void 0:e.call(t))||[]).filter((e=>"CodeGroupItem"===e.type.name)).map((e=>(null===e.props&&(e.props={}),e)));return 0===i.length?null:(n.value<0||n.value>i.length-1?(n.value=i.findIndex((e=>""===e.props.active||!0===e.props.active)),-1===n.value&&(n.value=0)):i.forEach(((e,t)=>{e.props.active=t===n.value})),(0,o.h)("div",{class:"code-group"},[(0,o.h)("div",{class:"code-group__nav"},(0,o.h)("ul",{class:"code-group__ul"},i.map(((e,t)=>{const i=t===n.value;return(0,o.h)("li",{class:"code-group__li"},(0,o.h)("button",{ref:e=>{e&&(r.value[t]=e)},class:{"code-group__nav-tab":!0,"code-group__nav-tab-active":i},ariaPressed:i,ariaExpanded:i,onClick:()=>n.value=t,onKeydown:e=>((e,t)=>{" "===e.key||"Enter"===e.key?(e.preventDefault(),n.value=t):"ArrowRight"===e.key?(e.preventDefault(),((e=n.value)=>{e{n.value=e>0?e-1:r.value.length-1,r.value[n.value].focus()})(t))})(e,t)},e.props.title))})))),i]))}}}),s=["aria-selected"],u=(0,o.aZ)({name:"CodeGroupItem"}),f=(0,o.aZ)({...u,props:{title:{type:String,required:!0},active:{type:Boolean,required:!1,default:!1}},setup:e=>(t,n)=>((0,o.wg)(),(0,o.iD)("div",{class:(0,i.C_)(["code-group-item",{"code-group-item__active":e.active}]),"aria-selected":e.active},[(0,o.WI)(t.$slots,"default")],10,s))});var p=n(5885);const d={class:"sr-only"},h=(0,o.aZ)({__name:"OutboundLink",setup(e){const t=(0,p.X6)();return(e,n)=>((0,o.wg)(),(0,o.j4)((0,c.SU)(r.MS),null,{default:(0,o.w5)((()=>[(0,o._)("span",d,(0,i.zw)((0,c.SU)(t).openInNewWindow),1)])),_:1}))}}),m=(0,r.vW)((({app:e,router:t})=>{e.component("Badge",l),e.component("CodeGroup",a),e.component("CodeGroupItem",f),delete e._context.components.OutboundLink,e.component("OutboundLink",h),e.component("NavbarSearch",(()=>{const t=e.component("Docsearch")||e.component("SearchBox");return t?(0,o.h)(t):null}));const n=t.options.scrollBehavior;t.options.scrollBehavior=async(...e)=>(await(0,p.P$)().wait(),n(...e))}))},8866:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(7621),o=n(5885);const i=(0,r.F2)((()=>{(0,o.OX)(),(0,o.fR)()}))},5885:(e,t,n)=>{"use strict";n.d(t,{OX:()=>x,fR:()=>$,vs:()=>I,sC:()=>R,P$:()=>H,VU:()=>q,X6:()=>Y});var r=n(2262),o=n(6252);function i(e){return!!(0,r.nZ)()&&((0,r.EB)(e),!0)}const l="undefined"!=typeof window,c=(Object.prototype.toString,e=>"string"==typeof e),a=()=>{};const s=e=>e();var u=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,d=(e,t)=>{var n={};for(var r in e)f.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&u)for(var r of u(e))t.indexOf(r)<0&&p.call(e,r)&&(n[r]=e[r]);return n};Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const h=l?window:void 0;l&&window.document,l&&window.navigator,l&&window.location,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},v="__vueuse_ssr_handlers__";m[v]=m[v]||{};const y=m[v];const _={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))}};function g(e,t,n,l={}){var u;const{flush:f="pre",deep:p=!0,listenToStorageChanges:m=!0,writeDefaults:v=!0,shallow:g,window:b=h,eventFilter:O,onError:w=(e=>{console.error(e)})}=l,S=(0,r.SU)(t),E=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}(S),j=(g?r.XI:r.iH)(t),P=null!=(u=l.serializer)?u:_[E];if(!n)try{n=function(e,t){return y[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=h)?void 0:e.localStorage}))()}catch(e){w(e)}function k(t){if(n&&(!t||t.key===e))try{const r=t?t.newValue:n.getItem(e);null==r?(j.value=S,v&&null!==S&&n.setItem(e,P.write(S))):j.value="string"!=typeof r?r:P.read(r)}catch(e){w(e)}}return k(),b&&m&&function(...e){let t,n,l,s;if(c(e[0])?([n,l,s]=e,t=h):[t,n,l,s]=e,!t)return a;let u=a;const f=(0,o.YP)((()=>(0,r.SU)(t)),(e=>{u(),e&&(e.addEventListener(n,l,s),u=()=>{e.removeEventListener(n,l,s),u=a})}),{immediate:!0,flush:"post"}),p=()=>{f(),u()};i(p)}(b,"storage",(e=>setTimeout((()=>k(e)),0))),n&&function(e,t,n={}){const r=n,{eventFilter:i=s}=r,l=d(r,["eventFilter"]);return(0,o.YP)(e,(c=i,a=t,function(...e){c((()=>a.apply(this,e)),{fn:a,thisArg:this,args:e})}),l);var c,a}(j,(()=>{try{null==j.value?n.removeItem(e):n.setItem(e,P.write(j.value))}catch(e){w(e)}}),{flush:f,deep:p,eventFilter:O}),j}function b(e){return function(e,t={}){const{window:n=h}=t;let l;const c=(0,r.iH)(!1),a=()=>{n&&(l||(l=n.matchMedia(e)),c.value=l.matches)};return function(e,t=!0){(0,o.FN)()?(0,o.bv)(e):t?e():(0,o.Y3)(e)}((()=>{a(),l&&("addEventListener"in l?l.addEventListener("change",a):l.addListener(a),i((()=>{"removeEventListener"in a?l.removeEventListener("change",a):l.removeListener(a)})))})),c}("(prefers-color-scheme: dark)",e)}var O,w;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,l&&(null==window?void 0:window.navigator)&&(null==(O=null==window?void 0:window.navigator)?void 0:O.platform)&&/iP(ad|hone|od)/.test(null==(w=null==window?void 0:window.navigator)?void 0:w.platform),Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var S=Object.defineProperty,E=(Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols),j=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,k=(e,t,n)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;((e,t)=>{for(var n in t||(t={}))j.call(t,n)&&k(e,n,t[n]);if(E)for(var n of E(t))P.call(t,n)&&k(e,n,t[n])})({text:""},{top:0,left:0,bottom:0,right:0,height:0,width:0}),Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const C=Symbol(""),I=()=>{const e=(0,o.f3)(C);if(!e)throw new Error("useDarkMode() is called without provider.");return e},x=()=>{const e=Y(),t=b(),n=g("vuepress-color-scheme","auto"),r=(0,o.Fl)({get:()=>!!e.value.darkMode&&("auto"===n.value?t.value:"dark"===n.value),set(e){e===t.value?n.value="auto":n.value=e?"dark":"light"}});(0,o.JJ)(C,r),A(r)},A=e=>{const t=(t=e.value)=>{const n=null===window||void 0===window?void 0:window.document.querySelector("html");null==n||n.classList.toggle("dark",t)};(0,o.bv)((()=>{(0,o.YP)(e,t,{immediate:!0})})),(0,o.Ah)((()=>t()))};var D=n(7788),N=n(2201);const T=(...e)=>{const t=(0,N.tv)().resolve(...e),n=t.matched[t.matched.length-1];if(!(null==n?void 0:n.redirect))return t;const{redirect:r}=n,o=(0,D.mf)(r)?r(t):r,i=(0,D.HD)(o)?{path:o}:o;return T({hash:t.hash,query:t.query,params:t.params,...i})},R=e=>{const t=T(e);return{text:t.meta.title||e,link:"404"===t.name?e:t.fullPath}};let L=null,M=null;const F={wait:()=>L,pending:()=>{L=new Promise((e=>M=e))},resolve:()=>{null==M||M(),L=null,M=null}},H=()=>F;var U=n(7621);const z=Symbol("sidebarItems"),q=()=>{const e=(0,o.f3)(z);if(!e)throw new Error("useSidebarItems() is called without provider.");return e},$=()=>{const e=Y(),t=(0,U.I2)(),n=(0,o.Fl)((()=>B(t.value,e.value)));(0,o.JJ)(z,n)},B=(e,t)=>{var n,r,o,i;const l=null!==(r=null!==(n=e.sidebar)&&void 0!==n?n:t.sidebar)&&void 0!==r?r:"auto",c=null!==(i=null!==(o=e.sidebarDepth)&&void 0!==o?o:t.sidebarDepth)&&void 0!==i?i:2;return e.home||!1===l?[]:"auto"===l?J(c):(0,D.kJ)(l)?W(l,c):(0,D.PO)(l)?K(l,c):[]},V=(e,t)=>t>0?e.map((e=>((e,t)=>({text:e.title,link:`#${e.slug}`,children:V(e.children,t)}))(e,t-1))):[],J=e=>{const t=(0,U.Vi)();return[{text:t.value.title,children:V(t.value.headers,e)}]},W=(e,t)=>{const n=(0,N.yj)(),r=(0,U.Vi)(),o=e=>{var i;let l;if(l=(0,D.HD)(e)?R(e):e,l.children)return{...l,children:l.children.map((e=>o(e)))};if(l.link===n.path){const e=1===(null===(i=r.value.headers[0])||void 0===i?void 0:i.level)?r.value.headers[0].children:r.value.headers;return{...l,children:V(e,t)}}return l};return e.map((e=>o(e)))},K=(e,t)=>{var n;const r=(0,N.yj)(),o=null!==(n=e[(0,D.gb)(e,r.path)])&&void 0!==n?n:[];return W(o,t)};var G=n(3197);const Y=()=>(0,G.X6)()},4865:function(e,t,n){var r,o;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function o(e,t,n){return en?n:e}function i(e){return 100*(-1+e)}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,r.minimum,1),n.status=1===e?null:e;var a=n.render(!t),s=a.querySelector(r.barSelector),u=r.speed,f=r.easing;return a.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),c(s,function(e,t,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+i(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+i(e)+"%,0)"}:{"margin-left":i(e)+"%"}).transition="all "+t+"ms "+n,o}(e,u,f)),1===e?(c(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout((function(){c(a,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");s(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var o,l=t.querySelector(r.barSelector),a=e?"-100":i(n.status||0),u=document.querySelector(r.parent);return c(l,{transition:"all 0 linear",transform:"translate3d("+a+"%,0,0)"}),r.showSpinner||(o=t.querySelector(r.spinnerSelector))&&p(o),u!=document.body&&s(u,"nprogress-custom-parent"),u.appendChild(t),t},n.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),c=function(){var e=["Webkit","O","Moz","ms"],t={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()})),t[n]||(t[n]=function(t){var n=document.body.style;if(t in n)return t;for(var r,o=e.length,i=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((r=e[o]+i)in n)return r;return t}(n))}function r(e,t,r){t=n(t),e.style[t]=r}return function(e,t){var n,o,i=arguments;if(2==i.length)for(n in t)void 0!==(o=t[n])&&t.hasOwnProperty(n)&&r(e,n,o);else r(e,i[1],i[2])}}();function a(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function s(e,t){var n=f(e),r=n+t;a(n,t)||(e.className=r.substring(1))}function u(e,t){var n,r=f(e);a(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(o=r.call(t,n,t,e))||(e.exports=o)},2938:(e,t,n)=>{"use strict";function r(e,t,n){var r,o,i;void 0===t&&(t=50),void 0===n&&(n={});var l=null!=(r=n.isImmediate)&&r,c=null!=(o=n.callback)&&o,a=n.maxWait,s=Date.now(),u=[];function f(){if(void 0!==a){var e=Date.now()-s;if(e+t>=a)return a-e}return t}var p=function(){var t=[].slice.call(arguments),n=this;return new Promise((function(r,o){var a=l&&void 0===i;if(void 0!==i&&clearTimeout(i),i=setTimeout((function(){if(i=void 0,s=Date.now(),!l){var r=e.apply(n,t);c&&c(r),u.forEach((function(e){return(0,e.resolve)(r)})),u=[]}}),f()),a){var p=e.apply(n,t);return c&&c(p),r(p)}u.push({resolve:r,reject:o})}))};return p.cancel=function(e){void 0!==i&&clearTimeout(i),u.forEach((function(t){return(0,t.reject)(e)})),u=[]},p}n.d(t,{D:()=>r})},2201:(e,t,n)=>{"use strict";n.d(t,{AJ:()=>x,MA:()=>xe,PO:()=>C,p7:()=>Ae,tv:()=>Ne,yj:()=>Te});var r=n(6252),o=n(2262);const i="undefined"!=typeof window;const l=Object.assign;function c(e,t){const n={};for(const r in t){const o=t[r];n[r]=s(o)?o.map(e):e(o)}return n}const a=()=>{},s=Array.isArray,u=/\/$/,f=e=>e.replace(u,"");function p(e,t,n="/"){let r,o={},i="",l="";const c=t.indexOf("#");let a=t.indexOf("?");return c=0&&(a=-1),a>-1&&(r=t.slice(0,a),i=t.slice(a+1,c>-1?c:t.length),o=e(i)),c>-1&&(r=r||t.slice(0,c),l=t.slice(c,t.length)),r=function(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let o,i,l=n.length-1;for(o=0;o1&&l--}return n.slice(0,l).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}(null!=r?r:t,n),{fullPath:r+(i&&"?")+i+l,path:r,query:o,hash:l}}function d(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function h(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function m(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!v(e[n],t[n]))return!1;return!0}function v(e,t){return s(e)?y(e,t):s(t)?y(t,e):e===t}function y(e,t){return s(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}var _,g;!function(e){e.pop="pop",e.push="push"}(_||(_={})),function(e){e.back="back",e.forward="forward",e.unknown=""}(g||(g={}));const b=/^[^#]+#/;function O(e,t){return e.replace(b,"#")+t}const w=()=>({left:window.pageXOffset,top:window.pageYOffset});function S(e,t){return(history.state?history.state.position-t:-1)+e}const E=new Map;let j=()=>location.protocol+"//"+location.host;function P(e,t){const{pathname:n,search:r,hash:o}=t,i=e.indexOf("#");if(i>-1){let t=o.includes(e.slice(i))?e.slice(i).length:1,n=o.slice(t);return"/"!==n[0]&&(n="/"+n),d(n,"")}return d(n,e)+r+o}function k(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?w():null}}function C(e){const t=function(e){const{history:t,location:n}=window,r={value:P(e,n)},o={value:t.state};function i(r,i,l){const c=e.indexOf("#"),a=c>-1?(n.host&&document.querySelector("base")?e:e.slice(c))+r:j()+e+r;try{t[l?"replaceState":"pushState"](i,"",a),o.value=i}catch(e){console.error(e),n[l?"replace":"assign"](a)}}return o.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:r,state:o,push:function(e,n){const c=l({},o.value,t.state,{forward:e,scroll:w()});i(c.current,c,!0),i(e,l({},k(r.value,e,null),{position:c.position+1},n),!1),r.value=e},replace:function(e,n){i(e,l({},t.state,k(o.value.back,e,o.value.forward,!0),n,{position:o.value.position}),!0),r.value=e}}}(e=function(e){if(!e)if(i){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),f(e)}(e)),n=function(e,t,n,r){let o=[],i=[],c=null;const a=({state:i})=>{const l=P(e,location),a=n.value,s=t.value;let u=0;if(i){if(n.value=l,t.value=i,c&&c===a)return void(c=null);u=s?i.position-s.position:0}else r(l);o.forEach((e=>{e(n.value,a,{delta:u,type:_.pop,direction:u?u>0?g.forward:g.back:g.unknown})}))};function s(){const{history:e}=window;e.state&&e.replaceState(l({},e.state,{scroll:w()}),"")}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",s),{pauseListeners:function(){c=n.value},listen:function(e){o.push(e);const t=()=>{const t=o.indexOf(e);t>-1&&o.splice(t,1)};return i.push(t),t},destroy:function(){for(const e of i)e();i=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",s)}}}(e,t.state,t.location,t.replace),r=l({location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:O.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function I(e){return"string"==typeof e||"symbol"==typeof e}const x={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},A=Symbol("");var D;function N(e,t){return l(new Error,{type:e,[A]:!0},t)}function T(e,t){return e instanceof Error&&A in e&&(null==t||!!(e.type&t))}!function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"}(D||(D={}));const R="[^/]+?",L={sensitive:!1,strict:!1,start:!0,end:!0},M=/[.+*?^${}()[\]/\\]/g;function F(e,t){let n=0;for(;nt.length?1===t.length&&80===t[0]?1:-1:0}function H(e,t){let n=0;const r=e.score,o=t.score;for(;n0&&t[t.length-1]<0}const z={type:0,value:""},q=/[a-zA-Z0-9_]/;function $(e,t,n){const r=function(e,t){const n=l({},L,t),r=[];let o=n.start?"^":"";const i=[];for(const t of e){const e=t.length?[]:[90];n.strict&&!t.length&&(o+="/");for(let r=0;r1&&("*"===c||"+"===c)&&t(`A repeatable param (${s}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:s,regexp:u,repeatable:"*"===c||"+"===c,optional:"*"===c||"?"===c})):t("Invalid state to consume buffer"),s="")}function p(){s+=c}for(;al(e,t.meta)),{})}function K(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function G(e,t){return t.children.some((t=>t===e||G(e,t)))}const Y=/#/g,Z=/&/g,X=/\//g,Q=/=/g,ee=/\?/g,te=/\+/g,ne=/%5B/g,re=/%5D/g,oe=/%5E/g,ie=/%60/g,le=/%7B/g,ce=/%7C/g,ae=/%7D/g,se=/%20/g;function ue(e){return encodeURI(""+e).replace(ce,"|").replace(ne,"[").replace(re,"]")}function fe(e){return ue(e).replace(te,"%2B").replace(se,"+").replace(Y,"%23").replace(Z,"%26").replace(ie,"`").replace(le,"{").replace(ae,"}").replace(oe,"^")}function pe(e){return null==e?"":function(e){return ue(e).replace(Y,"%23").replace(ee,"%3F")}(e).replace(X,"%2F")}function de(e){try{return decodeURIComponent(""+e)}catch(e){}return""+e}function he(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let e=0;ee&&fe(e))):[r&&fe(r)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))})):void 0!==r&&(t+=(t.length?"&":"")+n)}return t}function ve(e){const t={};for(const n in e){const r=e[n];void 0!==r&&(t[n]=s(r)?r.map((e=>null==e?null:""+e)):null==r?r:""+r)}return t}const ye=Symbol(""),_e=Symbol(""),ge=Symbol(""),be=Symbol(""),Oe=Symbol("");function we(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e,reset:function(){e=[]}}}function Se(e,t,n,r,o){const i=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise(((l,c)=>{const a=e=>{var a;!1===e?c(N(4,{from:n,to:t})):e instanceof Error?c(e):"string"==typeof(a=e)||a&&"object"==typeof a?c(N(2,{from:t,to:e})):(i&&r.enterCallbacks[o]===i&&"function"==typeof e&&i.push(e),l())},s=e.call(r&&r.instances[o],t,n,a);let u=Promise.resolve(s);e.length<3&&(u=u.then(a)),u.catch((e=>c(e)))}))}function Ee(e,t,n,r){const o=[];for(const l of e)for(const e in l.components){let c=l.components[e];if("beforeRouteEnter"===t||l.instances[e])if("object"==typeof(i=c)||"displayName"in i||"props"in i||"__vccOpts"in i){const i=(c.__vccOpts||c)[t];i&&o.push(Se(i,n,r,l,e))}else{let i=c();o.push((()=>i.then((o=>{if(!o)return Promise.reject(new Error(`Couldn't resolve component "${e}" at "${l.path}"`));const i=(c=o).__esModule||"Module"===c[Symbol.toStringTag]?o.default:o;var c;l.components[e]=i;const a=(i.__vccOpts||i)[t];return a&&Se(a,n,r,l,e)()}))))}}var i;return o}function je(e){const t=(0,r.f3)(ge),n=(0,r.f3)(be),i=(0,r.Fl)((()=>t.resolve((0,o.SU)(e.to)))),l=(0,r.Fl)((()=>{const{matched:e}=i.value,{length:t}=e,r=e[t-1],o=n.matched;if(!r||!o.length)return-1;const l=o.findIndex(h.bind(null,r));if(l>-1)return l;const c=ke(e[t-2]);return t>1&&ke(r)===c&&o[o.length-1].path!==c?o.findIndex(h.bind(null,e[t-2])):l})),c=(0,r.Fl)((()=>l.value>-1&&function(e,t){for(const n in t){const r=t[n],o=e[n];if("string"==typeof r){if(r!==o)return!1}else if(!s(o)||o.length!==r.length||r.some(((e,t)=>e!==o[t])))return!1}return!0}(n.params,i.value.params))),u=(0,r.Fl)((()=>l.value>-1&&l.value===n.matched.length-1&&m(n.params,i.value.params)));return{route:i,href:(0,r.Fl)((()=>i.value.href)),isActive:c,isExactActive:u,navigate:function(n={}){return function(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||e.defaultPrevented||void 0!==e.button&&0!==e.button)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}(n)?t[(0,o.SU)(e.replace)?"replace":"push"]((0,o.SU)(e.to)).catch(a):Promise.resolve()}}}const Pe=(0,r.aZ)({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:je,setup(e,{slots:t}){const n=(0,o.qj)(je(e)),{options:i}=(0,r.f3)(ge),l=(0,r.Fl)((()=>({[Ce(e.activeClass,i.linkActiveClass,"router-link-active")]:n.isActive,[Ce(e.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive})));return()=>{const o=t.default&&t.default(n);return e.custom?o:(0,r.h)("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:l.value},o)}}});function ke(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ce=(e,t,n)=>null!=e?e:null!=t?t:n;function Ie(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const xe=(0,r.aZ)({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const i=(0,r.f3)(Oe),c=(0,r.Fl)((()=>e.route||i.value)),a=(0,r.f3)(_e,0),s=(0,r.Fl)((()=>{let e=(0,o.SU)(a);const{matched:t}=c.value;let n;for(;(n=t[e])&&!n.components;)e++;return e})),u=(0,r.Fl)((()=>c.value.matched[s.value]));(0,r.JJ)(_e,(0,r.Fl)((()=>s.value+1))),(0,r.JJ)(ye,u),(0,r.JJ)(Oe,c);const f=(0,o.iH)();return(0,r.YP)((()=>[f.value,u.value,e.name]),(([e,t,n],[r,o,i])=>{t&&(t.instances[n]=e,o&&o!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=o.leaveGuards),t.updateGuards.size||(t.updateGuards=o.updateGuards))),!e||!t||o&&h(t,o)&&r||(t.enterCallbacks[n]||[]).forEach((t=>t(e)))}),{flush:"post"}),()=>{const o=c.value,i=e.name,a=u.value,s=a&&a.components[i];if(!s)return Ie(n.default,{Component:s,route:o});const p=a.props[i],d=p?!0===p?o.params:"function"==typeof p?p(o):p:null,h=(0,r.h)(s,l({},d,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(a.instances[i]=null)},ref:f}));return Ie(n.default,{Component:h,route:o})||h}}});function Ae(e){const t=function(e,t){const n=[],r=new Map;function o(e,n,r){const s=!r,u=function(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:V(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}(e);u.aliasOf=r&&r.record;const f=K(t,e),p=[u];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)p.push(l({},u,{components:r?r.record.components:u.components,path:e,aliasOf:r?r.record:u}))}let d,h;for(const t of p){const{path:l}=t;if(n&&"/"!==l[0]){const e=n.record.path,r="/"===e[e.length-1]?"":"/";t.path=n.record.path+(l&&r+l)}if(d=$(t,n,f),r?r.alias.push(d):(h=h||d,h!==d&&h.alias.push(d),s&&e.name&&!J(d)&&i(e.name)),u.children){const e=u.children;for(let t=0;t{i(h)}:a}function i(e){if(I(e)){const t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(i),t.alias.forEach(i))}else{const t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(i),e.alias.forEach(i))}}function c(e){let t=0;for(;t=0&&(e.record.path!==n[t].record.path||!G(e,n[t]));)t++;n.splice(t,0,e),e.record.name&&!J(e)&&r.set(e.record.name,e)}return t=K({strict:!1,end:!0,sensitive:!1},t),e.forEach((e=>o(e))),{addRoute:o,resolve:function(e,t){let o,i,c,a={};if("name"in e&&e.name){if(o=r.get(e.name),!o)throw N(1,{location:e});c=o.record.name,a=l(B(t.params,o.keys.filter((e=>!e.optional)).map((e=>e.name))),e.params&&B(e.params,o.keys.map((e=>e.name)))),i=o.stringify(a)}else if("path"in e)i=e.path,o=n.find((e=>e.re.test(i))),o&&(a=o.parse(i),c=o.record.name);else{if(o=t.name?r.get(t.name):n.find((e=>e.re.test(t.path))),!o)throw N(1,{location:e,currentLocation:t});c=o.record.name,a=l({},t.params,e.params),i=o.stringify(a)}const s=[];let u=o;for(;u;)s.unshift(u.record),u=u.parent;return{name:c,path:i,params:a,matched:s,meta:W(s)}},removeRoute:i,getRoutes:function(){return n},getRecordMatcher:function(e){return r.get(e)}}}(e.routes,e),n=e.parseQuery||he,u=e.stringifyQuery||me,f=e.history,d=we(),v=we(),y=we(),g=(0,o.XI)(x);let b=x;i&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const O=c.bind(null,(e=>""+e)),j=c.bind(null,pe),P=c.bind(null,de);function k(e,r){if(r=l({},r||g.value),"string"==typeof e){const o=p(n,e,r.path),i=t.resolve({path:o.path},r),c=f.createHref(o.fullPath);return l(o,i,{params:P(i.params),hash:de(o.hash),redirectedFrom:void 0,href:c})}let o;if("path"in e)o=l({},e,{path:p(n,e.path,r.path).path});else{const t=l({},e.params);for(const e in t)null==t[e]&&delete t[e];o=l({},e,{params:j(e.params)}),r.params=j(r.params)}const i=t.resolve(o,r),c=e.hash||"";i.params=O(P(i.params));const a=function(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(u,l({},e,{hash:(s=c,ue(s).replace(le,"{").replace(ae,"}").replace(oe,"^")),path:i.path}));var s;const d=f.createHref(a);return l({fullPath:a,hash:c,query:u===me?ve(e.query):e.query||{}},i,{redirectedFrom:void 0,href:d})}function C(e){return"string"==typeof e?p(n,e,g.value.path):l({},e)}function A(e,t){if(b!==e)return N(8,{from:t,to:e})}function D(e){return L(e)}function R(e){const t=e.matched[e.matched.length-1];if(t&&t.redirect){const{redirect:n}=t;let r="function"==typeof n?n(e):n;return"string"==typeof r&&(r=r.includes("?")||r.includes("#")?r=C(r):{path:r},r.params={}),l({query:e.query,hash:e.hash,params:"path"in r?{}:e.params},r)}}function L(e,t){const n=b=k(e),r=g.value,o=e.state,i=e.force,c=!0===e.replace,a=R(n);if(a)return L(l(C(a),{state:"object"==typeof a?l({},o,a.state):o,force:i,replace:c}),t||n);const s=n;let f;return s.redirectedFrom=t,!i&&function(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&h(t.matched[r],n.matched[o])&&m(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(u,r,n)&&(f=N(16,{to:s,from:r}),te(r,r,!0,!1)),(f?Promise.resolve(f):F(s,r)).catch((e=>T(e)?T(e,2)?e:ee(e):Q(e,s,r))).then((e=>{if(e){if(T(e,2))return L(l({replace:c},C(e.to),{state:"object"==typeof e.to?l({},o,e.to.state):o,force:i}),t||s)}else e=z(s,r,!0,c,o);return U(s,r,e),e}))}function M(e,t){const n=A(e,t);return n?Promise.reject(n):Promise.resolve()}function F(e,t){let n;const[r,o,i]=function(e,t){const n=[],r=[],o=[],i=Math.max(t.matched.length,e.matched.length);for(let l=0;lh(e,i)))?r.push(i):n.push(i));const c=e.matched[l];c&&(t.matched.find((e=>h(e,c)))||o.push(c))}return[n,r,o]}(e,t);n=Ee(r.reverse(),"beforeRouteLeave",e,t);for(const o of r)o.leaveGuards.forEach((r=>{n.push(Se(r,e,t))}));const l=M.bind(null,e,t);return n.push(l),De(n).then((()=>{n=[];for(const r of d.list())n.push(Se(r,e,t));return n.push(l),De(n)})).then((()=>{n=Ee(o,"beforeRouteUpdate",e,t);for(const r of o)r.updateGuards.forEach((r=>{n.push(Se(r,e,t))}));return n.push(l),De(n)})).then((()=>{n=[];for(const r of e.matched)if(r.beforeEnter&&!t.matched.includes(r))if(s(r.beforeEnter))for(const o of r.beforeEnter)n.push(Se(o,e,t));else n.push(Se(r.beforeEnter,e,t));return n.push(l),De(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=Ee(i,"beforeRouteEnter",e,t),n.push(l),De(n)))).then((()=>{n=[];for(const r of v.list())n.push(Se(r,e,t));return n.push(l),De(n)})).catch((e=>T(e,8)?e:Promise.reject(e)))}function U(e,t,n){for(const r of y.list())r(e,t,n)}function z(e,t,n,r,o){const c=A(e,t);if(c)return c;const a=t===x,s=i?history.state:{};n&&(r||a?f.replace(e.fullPath,l({scroll:a&&s&&s.scroll},o)):f.push(e.fullPath,o)),g.value=e,te(e,t,n,a),ee()}let q;let Y,Z=we(),X=we();function Q(e,t,n){ee(e);const r=X.list();return r.length?r.forEach((r=>r(e,t,n))):console.error(e),Promise.reject(e)}function ee(e){return Y||(Y=!e,q||(q=f.listen(((e,t,n)=>{if(!ce.listening)return;const r=k(e),o=R(r);if(o)return void L(l(o,{replace:!0}),r).catch(a);b=r;const c=g.value;var s,u;i&&(s=S(c.fullPath,n.delta),u=w(),E.set(s,u)),F(r,c).catch((e=>T(e,12)?e:T(e,2)?(L(e.to,r).then((e=>{T(e,20)&&!n.delta&&n.type===_.pop&&f.go(-1,!1)})).catch(a),Promise.reject()):(n.delta&&f.go(-n.delta,!1),Q(e,r,c)))).then((e=>{(e=e||z(r,c,!1))&&(n.delta&&!T(e,8)?f.go(-n.delta,!1):n.type===_.pop&&T(e,20)&&f.go(-1,!1)),U(r,c,e)})).catch(a)}))),Z.list().forEach((([t,n])=>e?n(e):t())),Z.reset()),e}function te(t,n,o,l){const{scrollBehavior:c}=e;if(!i||!c)return Promise.resolve();const a=!o&&function(e){const t=E.get(e);return E.delete(e),t}(S(t.fullPath,0))||(l||!o)&&history.state&&history.state.scroll||null;return(0,r.Y3)().then((()=>c(t,n,a))).then((e=>e&&function(e){let t;if("el"in e){const n=e.el,r="string"==typeof n&&n.startsWith("#"),o="string"==typeof n?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=function(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.pageXOffset,null!=t.top?t.top:window.pageYOffset)}(e))).catch((e=>Q(e,t,n)))}const ne=e=>f.go(e);let re;const ie=new Set,ce={currentRoute:g,listening:!0,addRoute:function(e,n){let r,o;return I(e)?(r=t.getRecordMatcher(e),o=n):o=e,t.addRoute(o,r)},removeRoute:function(e){const n=t.getRecordMatcher(e);n&&t.removeRoute(n)},hasRoute:function(e){return!!t.getRecordMatcher(e)},getRoutes:function(){return t.getRoutes().map((e=>e.record))},resolve:k,options:e,push:D,replace:function(e){return D(l(C(e),{replace:!0}))},go:ne,back:()=>ne(-1),forward:()=>ne(1),beforeEach:d.add,beforeResolve:v.add,afterEach:y.add,onError:X.add,isReady:function(){return Y&&g.value!==x?Promise.resolve():new Promise(((e,t)=>{Z.add([e,t])}))},install(e){e.component("RouterLink",Pe),e.component("RouterView",xe),e.config.globalProperties.$router=this,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>(0,o.SU)(g)}),i&&!re&&g.value===x&&(re=!0,D(f.location).catch((e=>{})));const t={};for(const e in x)t[e]=(0,r.Fl)((()=>g.value[e]));e.provide(ge,this),e.provide(be,(0,o.qj)(t)),e.provide(Oe,g);const n=e.unmount;ie.add(e),e.unmount=function(){ie.delete(e),ie.size<1&&(b=x,q&&q(),q=null,g.value=x,re=!1,Y=!1),n()}}};return ce}function De(e){return e.reduce(((e,t)=>e.then((()=>t()))),Promise.resolve())}function Ne(){return(0,r.f3)(ge)}function Te(){return(0,r.f3)(be)}}}]); \ No newline at end of file diff --git a/assets/js/399.ea3dd8a2.js.LICENSE.txt b/assets/js/399.ae8be0a6.js.LICENSE.txt similarity index 92% rename from assets/js/399.ea3dd8a2.js.LICENSE.txt rename to assets/js/399.ae8be0a6.js.LICENSE.txt index 53646f7e..7b058ed8 100644 --- a/assets/js/399.ea3dd8a2.js.LICENSE.txt +++ b/assets/js/399.ae8be0a6.js.LICENSE.txt @@ -2,7 +2,7 @@ * @license MIT */ /*! - * vue-router v4.1.5 + * vue-router v4.1.6 * (c) 2022 Eduardo San Martin Morote * @license MIT */ diff --git a/assets/js/399.ea3dd8a2.js b/assets/js/399.ea3dd8a2.js deleted file mode 100644 index 06657d10..00000000 --- a/assets/js/399.ea3dd8a2.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see 399.ea3dd8a2.js.LICENSE.txt */ -(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[399],{2262:(e,t,n)=>{"use strict";n.d(t,{BK:()=>Re,Bj:()=>i,EB:()=>c,Fl:()=>Ue,IU:()=>Oe,Jd:()=>O,OT:()=>me,PG:()=>ye,SU:()=>De,Um:()=>he,WL:()=>Te,X$:()=>j,X3:()=>be,XI:()=>Ie,Xl:()=>we,dq:()=>ke,iH:()=>Ce,j:()=>S,lk:()=>w,nZ:()=>l,qj:()=>de,qq:()=>y,yT:()=>ge});var r=n(3577);let o;class i{constructor(e=!1){this.active=!0,this.effects=[],this.cleanups=[],!e&&o&&(this.parent=o,this.index=(o.scopes||(o.scopes=[])).push(this)-1)}run(e){if(this.active){const t=o;try{return o=this,e()}finally{o=t}}}on(){o=this}off(){o=this.parent}stop(e){if(this.active){let t,n;for(t=0,n=this.effects.length;t{const t=new Set(e);return t.w=0,t.n=0,t},s=e=>(e.w&h)>0,u=e=>(e.n&h)>0,f=new WeakMap;let p,d=0,h=1;const m=Symbol(""),v=Symbol("");class y{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,function(e,t=o){t&&t.active&&t.effects.push(e)}(this,n)}run(){if(!this.active)return this.fn();let e=p,t=g;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=p,p=this,g=!0,h=1<<++d,d<=30?(({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r{("length"===t||t>=o)&&s.push(e)}));else switch(void 0!==n&&s.push(c.get(n)),t){case"add":(0,r.kJ)(e)?(0,r.S0)(n)&&s.push(c.get("length")):(s.push(c.get(m)),(0,r._N)(e)&&s.push(c.get(v)));break;case"delete":(0,r.kJ)(e)||(s.push(c.get(m)),(0,r._N)(e)&&s.push(c.get(v)));break;case"set":(0,r._N)(e)&&s.push(c.get(m))}if(1===s.length)s[0]&&P(s[0]);else{const e=[];for(const t of s)t&&e.push(...t);P(a(e))}}function P(e,t){const n=(0,r.kJ)(e)?e:[...e];for(const e of n)e.computed&&k(e);for(const e of n)e.computed||k(e)}function k(e,t){(e!==p||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const C=(0,r.fY)("__proto__,__v_isRef,__isVue"),I=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(r.yk)),x=R(),A=R(!1,!0),D=R(!0),N=T();function T(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=Oe(this);for(let e=0,t=this.length;e{e[t]=function(...e){O();const n=Oe(this)[t].apply(this,e);return w(),n}})),e}function R(e=!1,t=!1){return function(n,o,i){if("__v_isReactive"===o)return!e;if("__v_isReadonly"===o)return e;if("__v_isShallow"===o)return t;if("__v_raw"===o&&i===(e?t?pe:fe:t?ue:se).get(n))return n;const l=(0,r.kJ)(n);if(!e&&l&&(0,r.RI)(N,o))return Reflect.get(N,o,i);const c=Reflect.get(n,o,i);return((0,r.yk)(o)?I.has(o):C(o))?c:(e||S(n,0,o),t?c:ke(c)?l&&(0,r.S0)(o)?c:c.value:(0,r.Kn)(c)?e?me(c):de(c):c)}}const L=M(),F=M(!0);function M(e=!1){return function(t,n,o,i){let l=t[n];if(_e(l)&&ke(l)&&!ke(o))return!1;if(!e&&(ge(o)||_e(o)||(l=Oe(l),o=Oe(o)),!(0,r.kJ)(t)&&ke(l)&&!ke(o)))return l.value=o,!0;const c=(0,r.kJ)(t)&&(0,r.S0)(n)?Number(n)!0,deleteProperty:(e,t)=>!0},z=(0,r.l7)({},H,{get:A,set:F}),q=e=>e,$=e=>Reflect.getPrototypeOf(e);function B(e,t,n=!1,r=!1){const o=Oe(e=e.__v_raw),i=Oe(t);n||(t!==i&&S(o,0,t),S(o,0,i));const{has:l}=$(o),c=r?q:n?Ee:Se;return l.call(o,t)?c(e.get(t)):l.call(o,i)?c(e.get(i)):void(e!==o&&e.get(t))}function V(e,t=!1){const n=this.__v_raw,r=Oe(n),o=Oe(e);return t||(e!==o&&S(r,0,e),S(r,0,o)),e===o?n.has(e):n.has(e)||n.has(o)}function J(e,t=!1){return e=e.__v_raw,!t&&S(Oe(e),0,m),Reflect.get(e,"size",e)}function W(e){e=Oe(e);const t=Oe(this);return $(t).has.call(t,e)||(t.add(e),j(t,"add",e,e)),this}function K(e,t){t=Oe(t);const n=Oe(this),{has:o,get:i}=$(n);let l=o.call(n,e);l||(e=Oe(e),l=o.call(n,e));const c=i.call(n,e);return n.set(e,t),l?(0,r.aU)(t,c)&&j(n,"set",e,t):j(n,"add",e,t),this}function G(e){const t=Oe(this),{has:n,get:r}=$(t);let o=n.call(t,e);o||(e=Oe(e),o=n.call(t,e)),r&&r.call(t,e);const i=t.delete(e);return o&&j(t,"delete",e,void 0),i}function Y(){const e=Oe(this),t=0!==e.size,n=e.clear();return t&&j(e,"clear",void 0,void 0),n}function Z(e,t){return function(n,r){const o=this,i=o.__v_raw,l=Oe(i),c=t?q:e?Ee:Se;return!e&&S(l,0,m),i.forEach(((e,t)=>n.call(r,c(e),c(t),o)))}}function X(e,t,n){return function(...o){const i=this.__v_raw,l=Oe(i),c=(0,r._N)(l),a="entries"===e||e===Symbol.iterator&&c,s="keys"===e&&c,u=i[e](...o),f=n?q:t?Ee:Se;return!t&&S(l,0,s?v:m),{next(){const{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:a?[f(e[0]),f(e[1])]:f(e),done:t}},[Symbol.iterator](){return this}}}}function Q(e){return function(...t){return"delete"!==e&&this}}function ee(){const e={get(e){return B(this,e)},get size(){return J(this)},has:V,add:W,set:K,delete:G,clear:Y,forEach:Z(!1,!1)},t={get(e){return B(this,e,!1,!0)},get size(){return J(this)},has:V,add:W,set:K,delete:G,clear:Y,forEach:Z(!1,!0)},n={get(e){return B(this,e,!0)},get size(){return J(this,!0)},has(e){return V.call(this,e,!0)},add:Q("add"),set:Q("set"),delete:Q("delete"),clear:Q("clear"),forEach:Z(!0,!1)},r={get(e){return B(this,e,!0,!0)},get size(){return J(this,!0)},has(e){return V.call(this,e,!0)},add:Q("add"),set:Q("set"),delete:Q("delete"),clear:Q("clear"),forEach:Z(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((o=>{e[o]=X(o,!1,!1),n[o]=X(o,!0,!1),t[o]=X(o,!1,!0),r[o]=X(o,!0,!0)})),[e,n,t,r]}const[te,ne,re,oe]=ee();function ie(e,t){const n=t?e?oe:re:e?ne:te;return(t,o,i)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get((0,r.RI)(n,o)&&o in t?n:t,o,i)}const le={get:ie(!1,!1)},ce={get:ie(!1,!0)},ae={get:ie(!0,!1)},se=new WeakMap,ue=new WeakMap,fe=new WeakMap,pe=new WeakMap;function de(e){return _e(e)?e:ve(e,!1,H,le,se)}function he(e){return ve(e,!1,z,ce,ue)}function me(e){return ve(e,!0,U,ae,fe)}function ve(e,t,n,o,i){if(!(0,r.Kn)(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const l=i.get(e);if(l)return l;const c=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((0,r.W7)(a));var a;if(0===c)return e;const s=new Proxy(e,2===c?o:n);return i.set(e,s),s}function ye(e){return _e(e)?ye(e.__v_raw):!(!e||!e.__v_isReactive)}function _e(e){return!(!e||!e.__v_isReadonly)}function ge(e){return!(!e||!e.__v_isShallow)}function be(e){return ye(e)||_e(e)}function Oe(e){const t=e&&e.__v_raw;return t?Oe(t):e}function we(e){return(0,r.Nj)(e,"__v_skip",!0),e}const Se=e=>(0,r.Kn)(e)?de(e):e,Ee=e=>(0,r.Kn)(e)?me(e):e;function je(e){g&&p&&E((e=Oe(e)).dep||(e.dep=a()))}function Pe(e,t){(e=Oe(e)).dep&&P(e.dep)}function ke(e){return!(!e||!0!==e.__v_isRef)}function Ce(e){return xe(e,!1)}function Ie(e){return xe(e,!0)}function xe(e,t){return ke(e)?e:new Ae(e,t)}class Ae{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:Oe(e),this._value=t?e:Se(e)}get value(){return je(this),this._value}set value(e){const t=this.__v_isShallow||ge(e)||_e(e);e=t?e:Oe(e),(0,r.aU)(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:Se(e),Pe(this))}}function De(e){return ke(e)?e.value:e}const Ne={get:(e,t,n)=>De(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return ke(o)&&!ke(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function Te(e){return ye(e)?e:new Proxy(e,Ne)}function Re(e){const t=(0,r.kJ)(e)?new Array(e.length):{};for(const n in e)t[n]=Fe(e,n);return t}class Le{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}}function Fe(e,t,n){const r=e[t];return ke(r)?r:new Le(e,t,n)}var Me;class He{constructor(e,t,n,r){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this[Me]=!1,this._dirty=!0,this.effect=new y(e,(()=>{this._dirty||(this._dirty=!0,Pe(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=n}get value(){const e=Oe(this);return je(e),!e._dirty&&e._cacheable||(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function Ue(e,t,n=!1){let o,i;const l=(0,r.mf)(e);return l?(o=e,i=r.dG):(o=e.get,i=e.set),new He(o,i,l||!i,n)}Me="__v_isReadonly"},6252:(e,t,n)=>{"use strict";n.d(t,{$d:()=>l,Ah:()=>ve,Eo:()=>ut,FN:()=>Bt,Fl:()=>Xt,HY:()=>dt,JJ:()=>F,Jd:()=>me,Ko:()=>ke,P$:()=>W,Q6:()=>Q,RC:()=>ne,U2:()=>G,Uk:()=>Nt,WI:()=>Ce,Wm:()=>At,Y3:()=>y,Y8:()=>V,YP:()=>U,_:()=>xt,aZ:()=>ee,bv:()=>pe,dG:()=>Ht,f3:()=>M,h:()=>Qt,iD:()=>St,ic:()=>he,j4:()=>Et,kq:()=>Rt,nK:()=>X,uE:()=>Tt,up:()=>Ee,w5:()=>A,wg:()=>gt,wy:()=>Oe});var r=n(2262),o=n(3577);function i(e,t,n,r){let o;try{o=r?e(...r):e()}catch(e){c(e,t,n)}return o}function l(e,t,n,r){if((0,o.mf)(e)){const l=i(e,t,n,r);return l&&(0,o.tI)(l)&&l.catch((e=>{c(e,t,n)})),l}const a=[];for(let o=0;o>>1;w(u[r])w(e)-w(t))),h=0;hnull==e.id?1/0:e.id,S=(e,t)=>{const n=w(e)-w(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function E(e){s=!1,a=!0,u.sort(S),o.dG;try{for(f=0;fe.trim()))),t&&(i=n.map(o.He))}let s,u=r[s=(0,o.hR)(t)]||r[s=(0,o.hR)((0,o._A)(t))];!u&&c&&(u=r[s=(0,o.hR)((0,o.rs)(t))]),u&&l(u,e,6,i);const f=r[s+"Once"];if(f){if(e.emitted){if(e.emitted[s])return}else e.emitted={};e.emitted[s]=!0,l(f,e,6,i)}}function P(e,t,n=!1){const r=t.emitsCache,i=r.get(e);if(void 0!==i)return i;const l=e.emits;let c={},a=!1;if(!(0,o.mf)(e)){const r=e=>{const n=P(e,t,!0);n&&(a=!0,(0,o.l7)(c,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return l||a?((0,o.kJ)(l)?l.forEach((e=>c[e]=null)):(0,o.l7)(c,l),(0,o.Kn)(e)&&r.set(e,c),c):((0,o.Kn)(e)&&r.set(e,null),null)}function k(e,t){return!(!e||!(0,o.F7)(t))&&(t=t.slice(2).replace(/Once$/,""),(0,o.RI)(e,t[0].toLowerCase()+t.slice(1))||(0,o.RI)(e,(0,o.rs)(t))||(0,o.RI)(e,t))}new Set,new Map;let C=null,I=null;function x(e){const t=C;return C=e,I=e&&e.type.__scopeId||null,t}function A(e,t=C,n){if(!t)return e;if(e._n)return e;const r=(...n)=>{r._d&&Ot(-1);const o=x(t),i=e(...n);return x(o),r._d&&Ot(1),i};return r._n=!0,r._c=!0,r._d=!0,r}function D(e){const{type:t,vnode:n,proxy:r,withProxy:i,props:l,propsOptions:[a],slots:s,attrs:u,emit:f,render:p,renderCache:d,data:h,setupState:m,ctx:v,inheritAttrs:y}=e;let _,g;const b=x(e);try{if(4&n.shapeFlag){const e=i||r;_=Lt(p.call(e,e,d,l,m,h,v)),g=u}else{const e=t;_=Lt(e.length>1?e(l,{attrs:u,slots:s,emit:f}):e(l,null)),g=t.props?u:N(u)}}catch(t){yt.length=0,c(t,e,1),_=At(mt)}let O=_;if(g&&!1!==y){const e=Object.keys(g),{shapeFlag:t}=O;e.length&&7&t&&(a&&e.some(o.tR)&&(g=T(g,a)),O=Dt(O,g))}return n.dirs&&(O=Dt(O),O.dirs=O.dirs?O.dirs.concat(n.dirs):n.dirs),n.transition&&(O.transition=n.transition),_=O,x(b),_}const N=e=>{let t;for(const n in e)("class"===n||"style"===n||(0,o.F7)(n))&&((t||(t={}))[n]=e[n]);return t},T=(e,t)=>{const n={};for(const r in e)(0,o.tR)(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function R(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o1)return n&&(0,o.mf)(t)?t.call(r.proxy):t}}const H={};function U(e,t,n){return z(e,t,n)}function z(e,t,{immediate:n,deep:c,flush:a,onTrack:s,onTrigger:u}=o.kT){const f=$t;let p,d,h=!1,m=!1;if((0,r.dq)(e)?(p=()=>e.value,h=(0,r.yT)(e)):(0,r.PG)(e)?(p=()=>e,c=!0):(0,o.kJ)(e)?(m=!0,h=e.some((e=>(0,r.PG)(e)||(0,r.yT)(e))),p=()=>e.map((e=>(0,r.dq)(e)?e.value:(0,r.PG)(e)?B(e):(0,o.mf)(e)?i(e,f,2):void 0))):p=(0,o.mf)(e)?t?()=>i(e,f,2):()=>{if(!f||!f.isUnmounted)return d&&d(),l(e,f,3,[v])}:o.dG,t&&c){const e=p;p=()=>B(e())}let v=e=>{d=O.onStop=()=>{i(e,f,4)}};if(Kt)return v=o.dG,t?n&&l(t,f,3,[p(),m?[]:void 0,v]):p(),o.dG;let y=m?[]:H;const g=()=>{if(O.active)if(t){const e=O.run();(c||h||(m?e.some(((e,t)=>(0,o.aU)(e,y[t]))):(0,o.aU)(e,y)))&&(d&&d(),l(t,f,3,[e,y===H?void 0:y,v]),y=e)}else O.run()};let b;g.allowRecurse=!!t,"sync"===a?b=g:"post"===a?b=()=>st(g,f&&f.suspense):(g.pre=!0,f&&(g.id=f.uid),b=()=>_(g));const O=new r.qq(p,b);return t?n?g():y=O.run():"post"===a?st(O.run.bind(O),f&&f.suspense):O.run(),()=>{O.stop(),f&&f.scope&&(0,o.Od)(f.scope.effects,O)}}function q(e,t,n){const r=this.proxy,i=(0,o.HD)(e)?e.includes(".")?$(r,e):()=>r[e]:e.bind(r,r);let l;(0,o.mf)(t)?l=t:(l=t.handler,n=t);const c=$t;Vt(this);const a=z(i,l.bind(r),n);return c?Vt(c):Jt(),a}function $(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{B(e,t)}));else if((0,o.PO)(e))for(const n in e)B(e[n],t);return e}function V(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return pe((()=>{e.isMounted=!0})),me((()=>{e.isUnmounting=!0})),e}const J=[Function,Array],W={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:J,onEnter:J,onAfterEnter:J,onEnterCancelled:J,onBeforeLeave:J,onLeave:J,onAfterLeave:J,onLeaveCancelled:J,onBeforeAppear:J,onAppear:J,onAfterAppear:J,onAppearCancelled:J},setup(e,{slots:t}){const n=Bt(),o=V();let i;return()=>{const l=t.default&&Q(t.default(),!0);if(!l||!l.length)return;let c=l[0];if(l.length>1){let e=!1;for(const t of l)if(t.type!==mt){c=t,e=!0;break}}const a=(0,r.IU)(e),{mode:s}=a;if(o.isLeaving)return Y(c);const u=Z(c);if(!u)return Y(c);const f=G(u,a,o,n);X(u,f);const p=n.subTree,d=p&&Z(p);let h=!1;const{getTransitionKey:m}=u.type;if(m){const e=m();void 0===i?i=e:e!==i&&(i=e,h=!0)}if(d&&d.type!==mt&&(!Pt(u,d)||h)){const e=G(d,a,o,n);if(X(d,e),"out-in"===s)return o.isLeaving=!0,e.afterLeave=()=>{o.isLeaving=!1,n.update()},Y(c);"in-out"===s&&u.type!==mt&&(e.delayLeave=(e,t,n)=>{K(o,d)[String(d.key)]=d,e._leaveCb=()=>{t(),e._leaveCb=void 0,delete f.delayedLeave},f.delayedLeave=n})}return c}}};function K(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function G(e,t,n,r){const{appear:i,mode:c,persisted:a=!1,onBeforeEnter:s,onEnter:u,onAfterEnter:f,onEnterCancelled:p,onBeforeLeave:d,onLeave:h,onAfterLeave:m,onLeaveCancelled:v,onBeforeAppear:y,onAppear:_,onAfterAppear:g,onAppearCancelled:b}=t,O=String(e.key),w=K(n,e),S=(e,t)=>{e&&l(e,r,9,t)},E=(e,t)=>{const n=t[1];S(e,t),(0,o.kJ)(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},j={mode:c,persisted:a,beforeEnter(t){let r=s;if(!n.isMounted){if(!i)return;r=y||s}t._leaveCb&&t._leaveCb(!0);const o=w[O];o&&Pt(e,o)&&o.el._leaveCb&&o.el._leaveCb(),S(r,[t])},enter(e){let t=u,r=f,o=p;if(!n.isMounted){if(!i)return;t=_||u,r=g||f,o=b||p}let l=!1;const c=e._enterCb=t=>{l||(l=!0,S(t?o:r,[e]),j.delayedLeave&&j.delayedLeave(),e._enterCb=void 0)};t?E(t,[e,c]):c()},leave(t,r){const o=String(e.key);if(t._enterCb&&t._enterCb(!0),n.isUnmounting)return r();S(d,[t]);let i=!1;const l=t._leaveCb=n=>{i||(i=!0,r(),S(n?v:m,[t]),t._leaveCb=void 0,w[o]===e&&delete w[o])};w[o]=e,h?E(h,[t,l]):l()},clone:e=>G(e,t,n,r)};return j}function Y(e){if(oe(e))return(e=Dt(e)).children=null,e}function Z(e){return oe(e)?e.children?e.children[0]:void 0:e}function X(e,t){6&e.shapeFlag&&e.component?X(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Q(e,t=!1,n){let r=[],o=0;for(let i=0;i1)for(let e=0;e!!e.type.__asyncLoader;function ne(e){(0,o.mf)(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:i,delay:l=200,timeout:a,suspensible:s=!0,onError:u}=e;let f,p=null,d=0;const h=()=>{let e;return p||(e=p=t().catch((e=>{if(e=e instanceof Error?e:new Error(String(e)),u)return new Promise(((t,n)=>{u(e,(()=>t((d++,p=null,h()))),(()=>n(e)),d+1)}));throw e})).then((t=>e!==p&&p?p:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),f=t,t))))};return ee({name:"AsyncComponentWrapper",__asyncLoader:h,get __asyncResolved(){return f},setup(){const e=$t;if(f)return()=>re(f,e);const t=t=>{p=null,c(t,e,13,!i)};if(s&&e.suspense||Kt)return h().then((t=>()=>re(t,e))).catch((e=>(t(e),()=>i?At(i,{error:e}):null)));const o=(0,r.iH)(!1),u=(0,r.iH)(),d=(0,r.iH)(!!l);return l&&setTimeout((()=>{d.value=!1}),l),null!=a&&setTimeout((()=>{if(!o.value&&!u.value){const e=new Error(`Async component timed out after ${a}ms.`);t(e),u.value=e}}),a),h().then((()=>{o.value=!0,e.parent&&oe(e.parent.vnode)&&_(e.parent.update)})).catch((e=>{t(e),u.value=e})),()=>o.value&&f?re(f,e):u.value&&i?At(i,{error:u.value}):n&&!d.value?At(n):void 0}})}function re(e,{vnode:{ref:t,props:n,children:r,shapeFlag:o},parent:i}){const l=At(e,n,r);return l.ref=t,l}const oe=e=>e.type.__isKeepAlive;function ie(e,t){ce(e,"a",t)}function le(e,t){ce(e,"da",t)}function ce(e,t,n=$t){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(se(t,r,n),n){let e=n.parent;for(;e&&e.parent;)oe(e.parent.vnode)&&ae(r,t,n,e),e=e.parent}}function ae(e,t,n,r){const i=se(t,e,r,!0);ve((()=>{(0,o.Od)(r[t],i)}),n)}function se(e,t,n=$t,o=!1){if(n){const i=n[e]||(n[e]=[]),c=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;(0,r.Jd)(),Vt(n);const i=l(t,n,e,o);return Jt(),(0,r.lk)(),i});return o?i.unshift(c):i.push(c),c}}RegExp,RegExp;const ue=e=>(t,n=$t)=>(!Kt||"sp"===e)&&se(e,t,n),fe=ue("bm"),pe=ue("m"),de=ue("bu"),he=ue("u"),me=ue("bum"),ve=ue("um"),ye=ue("sp"),_e=ue("rtg"),ge=ue("rtc");function be(e,t=$t){se("ec",e,t)}function Oe(e,t){const n=C;if(null===n)return e;const r=Zt(n)||n.proxy,i=e.dirs||(e.dirs=[]);for(let e=0;et(e,n,void 0,l&&l[n])));else{const n=Object.keys(e);i=new Array(n.length);for(let r=0,o=n.length;r!jt(e)||e.type!==mt&&!(e.type===dt&&!Ie(e.children))))?e:null}const xe=e=>e?Wt(e)?Zt(e)||e.proxy:xe(e.parent):null,Ae=(0,o.l7)(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>xe(e.parent),$root:e=>xe(e.root),$emit:e=>e.emit,$options:e=>Le(e),$forceUpdate:e=>e.f||(e.f=()=>_(e.update)),$nextTick:e=>e.n||(e.n=y.bind(e.proxy)),$watch:e=>q.bind(e)}),De={get({_:e},t){const{ctx:n,setupState:i,data:l,props:c,accessCache:a,type:s,appContext:u}=e;let f;if("$"!==t[0]){const r=a[t];if(void 0!==r)switch(r){case 1:return i[t];case 2:return l[t];case 4:return n[t];case 3:return c[t]}else{if(i!==o.kT&&(0,o.RI)(i,t))return a[t]=1,i[t];if(l!==o.kT&&(0,o.RI)(l,t))return a[t]=2,l[t];if((f=e.propsOptions[0])&&(0,o.RI)(f,t))return a[t]=3,c[t];if(n!==o.kT&&(0,o.RI)(n,t))return a[t]=4,n[t];Ne&&(a[t]=0)}}const p=Ae[t];let d,h;return p?("$attrs"===t&&(0,r.j)(e,"get",t),p(e)):(d=s.__cssModules)&&(d=d[t])?d:n!==o.kT&&(0,o.RI)(n,t)?(a[t]=4,n[t]):(h=u.config.globalProperties,(0,o.RI)(h,t)?h[t]:void 0)},set({_:e},t,n){const{data:r,setupState:i,ctx:l}=e;return i!==o.kT&&(0,o.RI)(i,t)?(i[t]=n,!0):r!==o.kT&&(0,o.RI)(r,t)?(r[t]=n,!0):!((0,o.RI)(e.props,t)||"$"===t[0]&&t.slice(1)in e||(l[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:l}},c){let a;return!!n[c]||e!==o.kT&&(0,o.RI)(e,c)||t!==o.kT&&(0,o.RI)(t,c)||(a=l[0])&&(0,o.RI)(a,c)||(0,o.RI)(r,c)||(0,o.RI)(Ae,c)||(0,o.RI)(i.config.globalProperties,c)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:(0,o.RI)(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};let Ne=!0;function Te(e,t,n){l((0,o.kJ)(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function Re(e,t,n,r){const i=r.includes(".")?$(n,r):()=>n[r];if((0,o.HD)(e)){const n=t[e];(0,o.mf)(n)&&U(i,n)}else if((0,o.mf)(e))U(i,e.bind(n));else if((0,o.Kn)(e))if((0,o.kJ)(e))e.forEach((e=>Re(e,t,n,r)));else{const r=(0,o.mf)(e.handler)?e.handler.bind(n):t[e.handler];(0,o.mf)(r)&&U(i,r,e)}}function Le(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:l,config:{optionMergeStrategies:c}}=e.appContext,a=l.get(t);let s;return a?s=a:i.length||n||r?(s={},i.length&&i.forEach((e=>Fe(s,e,c,!0))),Fe(s,t,c)):s=t,(0,o.Kn)(t)&&l.set(t,s),s}function Fe(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&Fe(e,i,n,!0),o&&o.forEach((t=>Fe(e,t,n,!0)));for(const o in t)if(r&&"expose"===o);else{const r=Me[o]||n&&n[o];e[o]=r?r(e[o],t[o]):t[o]}return e}const Me={data:He,props:qe,emits:qe,methods:qe,computed:qe,beforeCreate:ze,created:ze,beforeMount:ze,mounted:ze,beforeUpdate:ze,updated:ze,beforeDestroy:ze,beforeUnmount:ze,destroyed:ze,unmounted:ze,activated:ze,deactivated:ze,errorCaptured:ze,serverPrefetch:ze,components:qe,directives:qe,watch:function(e,t){if(!e)return t;if(!t)return e;const n=(0,o.l7)(Object.create(null),e);for(const r in t)n[r]=ze(e[r],t[r]);return n},provide:He,inject:function(e,t){return qe(Ue(e),Ue(t))}};function He(e,t){return t?e?function(){return(0,o.l7)((0,o.mf)(e)?e.call(this,this):e,(0,o.mf)(t)?t.call(this,this):t)}:t:e}function Ue(e){if((0,o.kJ)(e)){const t={};for(let n=0;n{s=!0;const[n,r]=Ve(e,t,!0);(0,o.l7)(c,n),r&&a.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!l&&!s)return(0,o.Kn)(e)&&r.set(e,o.Z6),o.Z6;if((0,o.kJ)(l))for(let e=0;e-1,r[1]=n<0||e-1||(0,o.RI)(r,"default"))&&a.push(t)}}}const u=[c,a];return(0,o.Kn)(e)&&r.set(e,u),u}function Je(e){return"$"!==e[0]}function We(e){const t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:null===e?"null":""}function Ke(e,t){return We(e)===We(t)}function Ge(e,t){return(0,o.kJ)(t)?t.findIndex((t=>Ke(t,e))):(0,o.mf)(t)&&Ke(t,e)?0:-1}const Ye=e=>"_"===e[0]||"$stable"===e,Ze=e=>(0,o.kJ)(e)?e.map(Lt):[Lt(e)],Xe=(e,t,n)=>{if(t._n)return t;const r=A(((...e)=>Ze(t(...e))),n);return r._c=!1,r},Qe=(e,t,n)=>{const r=e._ctx;for(const n in e){if(Ye(n))continue;const i=e[n];if((0,o.mf)(i))t[n]=Xe(0,i,r);else if(null!=i){const e=Ze(i);t[n]=()=>e}}},et=(e,t)=>{const n=Ze(t);e.slots.default=()=>n};function tt(){return{app:null,config:{isNativeTag:o.NO,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let nt=0;function rt(e,t){return function(n,r=null){(0,o.mf)(n)||(n=Object.assign({},n)),null==r||(0,o.Kn)(r)||(r=null);const i=tt(),l=new Set;let c=!1;const a=i.app={_uid:nt++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:en,get config(){return i.config},set config(e){},use:(e,...t)=>(l.has(e)||(e&&(0,o.mf)(e.install)?(l.add(e),e.install(a,...t)):(0,o.mf)(e)&&(l.add(e),e(a,...t))),a),mixin:e=>(i.mixins.includes(e)||i.mixins.push(e),a),component:(e,t)=>t?(i.components[e]=t,a):i.components[e],directive:(e,t)=>t?(i.directives[e]=t,a):i.directives[e],mount(o,l,s){if(!c){const u=At(n,r);return u.appContext=i,l&&t?t(u,o):e(u,o,s),c=!0,a._container=o,o.__vue_app__=a,Zt(u.component)||u.component.proxy}},unmount(){c&&(e(null,a._container),delete a._container.__vue_app__)},provide:(e,t)=>(i.provides[e]=t,a)};return a}}function ot(e,t,n,l,c=!1){if((0,o.kJ)(e))return void e.forEach(((e,r)=>ot(e,t&&((0,o.kJ)(t)?t[r]:t),n,l,c)));if(te(l)&&!c)return;const a=4&l.shapeFlag?Zt(l.component)||l.component.proxy:l.el,s=c?null:a,{i:u,r:f}=e,p=t&&t.r,d=u.refs===o.kT?u.refs={}:u.refs,h=u.setupState;if(null!=p&&p!==f&&((0,o.HD)(p)?(d[p]=null,(0,o.RI)(h,p)&&(h[p]=null)):(0,r.dq)(p)&&(p.value=null)),(0,o.mf)(f))i(f,u,12,[s,d]);else{const t=(0,o.HD)(f),i=(0,r.dq)(f);if(t||i){const r=()=>{if(e.f){const n=t?d[f]:f.value;c?(0,o.kJ)(n)&&(0,o.Od)(n,a):(0,o.kJ)(n)?n.includes(a)||n.push(a):t?(d[f]=[a],(0,o.RI)(h,f)&&(h[f]=d[f])):(f.value=[a],e.k&&(d[e.k]=f.value))}else t?(d[f]=s,(0,o.RI)(h,f)&&(h[f]=s)):i&&(f.value=s,e.k&&(d[e.k]=s))};s?(r.id=-1,st(r,n)):r()}}}let it=!1;const lt=e=>/svg/.test(e.namespaceURI)&&"foreignObject"!==e.tagName,ct=e=>8===e.nodeType;function at(e){const{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:l,parentNode:c,remove:a,insert:s,createComment:u}}=e,f=(n,r,o,a,u,y=!1)=>{const _=ct(n)&&"["===n.data,g=()=>m(n,r,o,a,u,_),{type:b,ref:O,shapeFlag:w,patchFlag:S}=r,E=n.nodeType;r.el=n,-2===S&&(y=!1,r.dynamicChildren=null);let j=null;switch(b){case ht:3!==E?""===r.children?(s(r.el=i(""),c(n),n),j=n):j=g():(n.data!==r.children&&(it=!0,n.data=r.children),j=l(n));break;case mt:j=8!==E||_?g():l(n);break;case vt:if(1===E||3===E){j=n;const e=!r.children.length;for(let t=0;t{c=c||!!t.dynamicChildren;const{type:s,props:u,patchFlag:f,shapeFlag:p,dirs:h}=t,m="input"===s&&h||"option"===s;if(m||-1!==f){if(h&&we(t,null,n,"created"),u)if(m||!c||48&f)for(const t in u)(m&&t.endsWith("value")||(0,o.F7)(t)&&!(0,o.Gg)(t))&&r(e,t,null,u[t],!1,void 0,n);else u.onClick&&r(e,"onClick",null,u.onClick,!1,void 0,n);let s;if((s=u&&u.onVnodeBeforeMount)&&Ut(s,n,t),h&&we(t,null,n,"beforeMount"),((s=u&&u.onVnodeMounted)||h)&&L((()=>{s&&Ut(s,n,t),h&&we(t,null,n,"mounted")}),i),16&p&&(!u||!u.innerHTML&&!u.textContent)){let r=d(e.firstChild,t,e,n,i,l,c);for(;r;){it=!0;const e=r;r=r.nextSibling,a(e)}}else 8&p&&e.textContent!==t.children&&(it=!0,e.textContent=t.children)}return e.nextSibling},d=(e,t,r,o,i,l,c)=>{c=c||!!t.dynamicChildren;const a=t.children,s=a.length;for(let t=0;t{const{slotScopeIds:a}=t;a&&(o=o?o.concat(a):a);const f=c(e),p=d(l(e),t,f,n,r,o,i);return p&&ct(p)&&"]"===p.data?l(t.anchor=p):(it=!0,s(t.anchor=u("]"),f,p),p)},m=(e,t,r,o,i,s)=>{if(it=!0,t.el=null,s){const t=v(e);for(;;){const n=l(e);if(!n||n===t)break;a(n)}}const u=l(e),f=c(e);return a(e),n(null,t,f,u,r,o,lt(f),i),u},v=e=>{let t=0;for(;e;)if((e=l(e))&&ct(e)&&("["===e.data&&t++,"]"===e.data)){if(0===t)return l(e);t--}return e};return[(e,t)=>{if(!t.hasChildNodes())return n(null,e,t),O(),void(t._vnode=e);it=!1,f(t.firstChild,e,null,null,null),O(),t._vnode=e,it&&console.error("Hydration completed but contains mismatches.")},f]}const st=L;function ut(e){return function(e,t){(0,o.E9)().__VUE__=!0;const{insert:n,remove:l,patchProp:a,createElement:s,createText:p,createComment:d,setText:h,setElementText:m,parentNode:v,nextSibling:y,setScopeId:g=o.dG,cloneNode:w,insertStaticContent:S}=e,E=(e,t,n,r=null,o=null,i=null,l=!1,c=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!Pt(e,t)&&(r=re(e),Z(e,o,i,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);const{type:s,ref:u,shapeFlag:f}=t;switch(s){case ht:C(e,t,n,r);break;case mt:I(e,t,n,r);break;case vt:null==e&&x(t,n,r,l);break;case dt:z(e,t,n,r,o,i,l,c,a);break;default:1&f?N(e,t,n,r,o,i,l,c,a):6&f?q(e,t,n,r,o,i,l,c,a):(64&f||128&f)&&s.process(e,t,n,r,o,i,l,c,a,le)}null!=u&&o&&ot(u,e&&e.ref,i,t||e,!t)},C=(e,t,r,o)=>{if(null==e)n(t.el=p(t.children),r,o);else{const n=t.el=e.el;t.children!==e.children&&h(n,t.children)}},I=(e,t,r,o)=>{null==e?n(t.el=d(t.children||""),r,o):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=S(e.children,t,n,r,e.el,e.anchor)},A=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=y(e),l(e),e=n;l(t)},N=(e,t,n,r,o,i,l,c,a)=>{l=l||"svg"===t.type,null==e?T(t,n,r,o,i,l,c,a):M(e,t,o,i,l,c,a)},T=(e,t,r,i,l,c,u,f)=>{let p,d;const{type:h,props:v,shapeFlag:y,transition:_,patchFlag:g,dirs:b}=e;if(e.el&&void 0!==w&&-1===g)p=e.el=w(e.el);else{if(p=e.el=s(e.type,c,v&&v.is,v),8&y?m(p,e.children):16&y&&F(e.children,p,null,i,l,c&&"foreignObject"!==h,u,f),b&&we(e,null,i,"created"),v){for(const t in v)"value"===t||(0,o.Gg)(t)||a(p,t,null,v[t],c,e.children,i,l,ne);"value"in v&&a(p,"value",null,v.value),(d=v.onVnodeBeforeMount)&&Ut(d,i,e)}L(p,e,e.scopeId,u,i)}b&&we(e,null,i,"beforeMount");const O=(!l||l&&!l.pendingBranch)&&_&&!_.persisted;O&&_.beforeEnter(p),n(p,t,r),((d=v&&v.onVnodeMounted)||O||b)&&st((()=>{d&&Ut(d,i,e),O&&_.enter(p),b&&we(e,null,i,"mounted")}),l)},L=(e,t,n,r,o)=>{if(n&&g(e,n),r)for(let t=0;t{for(let s=a;s{const s=t.el=e.el;let{patchFlag:u,dynamicChildren:f,dirs:p}=t;u|=16&e.patchFlag;const d=e.props||o.kT,h=t.props||o.kT;let v;n&&ft(n,!1),(v=h.onVnodeBeforeUpdate)&&Ut(v,n,t,e),p&&we(t,e,n,"beforeUpdate"),n&&ft(n,!0);const y=i&&"foreignObject"!==t.type;if(f?H(e.dynamicChildren,f,s,n,r,y,l):c||W(e,t,s,null,n,r,y,l,!1),u>0){if(16&u)U(s,t,d,h,n,r,i);else if(2&u&&d.class!==h.class&&a(s,"class",null,h.class,i),4&u&&a(s,"style",d.style,h.style,i),8&u){const o=t.dynamicProps;for(let t=0;t{v&&Ut(v,n,t,e),p&&we(t,e,n,"updated")}),r)},H=(e,t,n,r,o,i,l)=>{for(let c=0;c{if(n!==r){for(const s in r){if((0,o.Gg)(s))continue;const u=r[s],f=n[s];u!==f&&"value"!==s&&a(e,s,f,u,c,t.children,i,l,ne)}if(n!==o.kT)for(const s in n)(0,o.Gg)(s)||s in r||a(e,s,n[s],null,c,t.children,i,l,ne);"value"in r&&a(e,"value",n.value,r.value)}},z=(e,t,r,o,i,l,c,a,s)=>{const u=t.el=e?e.el:p(""),f=t.anchor=e?e.anchor:p("");let{patchFlag:d,dynamicChildren:h,slotScopeIds:m}=t;m&&(a=a?a.concat(m):m),null==e?(n(u,r,o),n(f,r,o),F(t.children,r,f,i,l,c,a,s)):d>0&&64&d&&h&&e.dynamicChildren?(H(e.dynamicChildren,h,r,i,l,c,a),(null!=t.key||i&&t===i.subTree)&&pt(e,t,!0)):W(e,t,r,f,i,l,c,a,s)},q=(e,t,n,r,o,i,l,c,a)=>{t.slotScopeIds=c,null==e?512&t.shapeFlag?o.ctx.activate(t,n,r,l,a):$(t,n,r,o,i,l,a):B(e,t,a)},$=(e,t,n,l,a,s,u)=>{const f=e.component=function(e,t,n){const i=e.type,l=(t?t.appContext:e.appContext)||zt,c={uid:qt++,vnode:e,type:i,parent:t,appContext:l,root:null,next:null,subTree:null,effect:null,update:null,scope:new r.Bj(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(l.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ve(i,l),emitsOptions:P(i,l),emit:null,emitted:null,propsDefaults:o.kT,inheritAttrs:i.inheritAttrs,ctx:o.kT,data:o.kT,props:o.kT,attrs:o.kT,slots:o.kT,refs:o.kT,setupState:o.kT,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return c.ctx={_:c},c.root=t?t.root:c,c.emit=j.bind(null,c),e.ce&&e.ce(c),c}(e,l,a);if(oe(e)&&(f.ctx.renderer=le),function(e,t=!1){Kt=t;const{props:n,children:l}=e.vnode,a=Wt(e);!function(e,t,n,i=!1){const l={},c={};(0,o.Nj)(c,kt,1),e.propsDefaults=Object.create(null),$e(e,t,l,c);for(const t in e.propsOptions[0])t in l||(l[t]=void 0);n?e.props=i?l:(0,r.Um)(l):e.type.props?e.props=l:e.props=c,e.attrs=c}(e,n,a,t),((e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=(0,r.IU)(t),(0,o.Nj)(t,"_",n)):Qe(t,e.slots={})}else e.slots={},t&&et(e,t);(0,o.Nj)(e.slots,kt,1)})(e,l);const s=a?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=(0,r.Xl)(new Proxy(e.ctx,De));const{setup:l}=n;if(l){const n=e.setupContext=l.length>1?function(e){const t=t=>{e.exposed=t||{}};let n;return{get attrs(){return n||(n=function(e){return new Proxy(e.attrs,{get:(t,n)=>((0,r.j)(e,"get","$attrs"),t[n])})}(e))},slots:e.slots,emit:e.emit,expose:t}}(e):null;Vt(e),(0,r.Jd)();const a=i(l,e,0,[e.props,n]);if((0,r.lk)(),Jt(),(0,o.tI)(a)){if(a.then(Jt,Jt),t)return a.then((n=>{Gt(e,n,t)})).catch((t=>{c(t,e,0)}));e.asyncDep=a}else Gt(e,a,t)}else Yt(e,t)}(e,t):void 0;Kt=!1}(f),f.asyncDep){if(a&&a.registerDep(f,V),!e.el){const e=f.subTree=At(mt);I(null,e,t,n)}}else V(f,e,t,n,a,s,u)},B=(e,t,n)=>{const r=t.component=e.component;if(function(e,t,n){const{props:r,children:o,component:i}=e,{props:l,children:c,patchFlag:a}=t,s=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&a>=0))return!(!o&&!c||c&&c.$stable)||r!==l&&(r?!l||R(r,l,s):!!l);if(1024&a)return!0;if(16&a)return r?R(r,l,s):!!l;if(8&a){const e=t.dynamicProps;for(let t=0;tf&&u.splice(t,1)}(r.update),r.update()}else t.el=e.el,r.vnode=t},V=(e,t,n,i,l,c,a)=>{const s=e.effect=new r.qq((()=>{if(e.isMounted){let t,{next:n,bu:r,u:i,parent:s,vnode:u}=e,f=n;ft(e,!1),n?(n.el=u.el,J(e,n,a)):n=u,r&&(0,o.ir)(r),(t=n.props&&n.props.onVnodeBeforeUpdate)&&Ut(t,s,n,u),ft(e,!0);const p=D(e),d=e.subTree;e.subTree=p,E(d,p,v(d.el),re(d),e,l,c),n.el=p.el,null===f&&function({vnode:e,parent:t},n){for(;t&&t.subTree===e;)(e=t.vnode).el=n,t=t.parent}(e,p.el),i&&st(i,l),(t=n.props&&n.props.onVnodeUpdated)&&st((()=>Ut(t,s,n,u)),l)}else{let r;const{el:a,props:s}=t,{bm:u,m:f,parent:p}=e,d=te(t);if(ft(e,!1),u&&(0,o.ir)(u),!d&&(r=s&&s.onVnodeBeforeMount)&&Ut(r,p,t),ft(e,!0),a&&ae){const n=()=>{e.subTree=D(e),ae(a,e.subTree,e,l,null)};d?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const r=e.subTree=D(e);E(null,r,n,i,e,l,c),t.el=r.el}if(f&&st(f,l),!d&&(r=s&&s.onVnodeMounted)){const e=t;st((()=>Ut(r,p,e)),l)}(256&t.shapeFlag||p&&te(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&st(e.a,l),e.isMounted=!0,t=n=i=null}}),(()=>_(u)),e.scope),u=e.update=()=>s.run();u.id=e.uid,ft(e,!0),u()},J=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,i){const{props:l,attrs:c,vnode:{patchFlag:a}}=e,s=(0,r.IU)(l),[u]=e.propsOptions;let f=!1;if(!(i||a>0)||16&a){let r;$e(e,t,l,c)&&(f=!0);for(const i in s)t&&((0,o.RI)(t,i)||(r=(0,o.rs)(i))!==i&&(0,o.RI)(t,r))||(u?!n||void 0===n[i]&&void 0===n[r]||(l[i]=Be(u,s,i,void 0,e,!0)):delete l[i]);if(c!==s)for(const e in c)t&&(0,o.RI)(t,e)||(delete c[e],f=!0)}else if(8&a){const n=e.vnode.dynamicProps;for(let r=0;r{const{vnode:r,slots:i}=e;let l=!0,c=o.kT;if(32&r.shapeFlag){const e=t._;e?n&&1===e?l=!1:((0,o.l7)(i,t),n||1!==e||delete i._):(l=!t.$stable,Qe(t,i)),c=t}else t&&(et(e,t),c={default:1});if(l)for(const e in i)Ye(e)||e in c||delete i[e]})(e,t.children,n),(0,r.Jd)(),b(),(0,r.lk)()},W=(e,t,n,r,o,i,l,c,a=!1)=>{const s=e&&e.children,u=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:d}=t;if(p>0){if(128&p)return void G(s,f,n,r,o,i,l,c,a);if(256&p)return void K(s,f,n,r,o,i,l,c,a)}8&d?(16&u&&ne(s,o,i),f!==s&&m(n,f)):16&u?16&d?G(s,f,n,r,o,i,l,c,a):ne(s,o,i,!0):(8&u&&m(n,""),16&d&&F(f,n,r,o,i,l,c,a))},K=(e,t,n,r,i,l,c,a,s)=>{e=e||o.Z6,t=t||o.Z6;const u=e.length,f=t.length,p=Math.min(u,f);let d;for(d=0;df?ne(e,i,l,!0,!1,p):F(t,n,r,i,l,c,a,s,p)},G=(e,t,n,r,i,l,c,a,s)=>{let u=0;const f=t.length;let p=e.length-1,d=f-1;for(;u<=p&&u<=d;){const r=e[u],o=t[u]=s?Ft(t[u]):Lt(t[u]);if(!Pt(r,o))break;E(r,o,n,null,i,l,c,a,s),u++}for(;u<=p&&u<=d;){const r=e[p],o=t[d]=s?Ft(t[d]):Lt(t[d]);if(!Pt(r,o))break;E(r,o,n,null,i,l,c,a,s),p--,d--}if(u>p){if(u<=d){const e=d+1,o=ed)for(;u<=p;)Z(e[u],i,l,!0),u++;else{const h=u,m=u,v=new Map;for(u=m;u<=d;u++){const e=t[u]=s?Ft(t[u]):Lt(t[u]);null!=e.key&&v.set(e.key,u)}let y,_=0;const g=d-m+1;let b=!1,O=0;const w=new Array(g);for(u=0;u=g){Z(r,i,l,!0);continue}let o;if(null!=r.key)o=v.get(r.key);else for(y=m;y<=d;y++)if(0===w[y-m]&&Pt(r,t[y])){o=y;break}void 0===o?Z(r,i,l,!0):(w[o-m]=u+1,o>=O?O=o:b=!0,E(r,t[o],n,null,i,l,c,a,s),_++)}const S=b?function(e){const t=e.slice(),n=[0];let r,o,i,l,c;const a=e.length;for(r=0;r>1,e[n[c]]0&&(t[r]=n[i-1]),n[i]=r)}}for(i=n.length,l=n[i-1];i-- >0;)n[i]=l,l=t[l];return n}(w):o.Z6;for(y=S.length-1,u=g-1;u>=0;u--){const e=m+u,o=t[e],p=e+1{const{el:l,type:c,transition:a,children:s,shapeFlag:u}=e;if(6&u)Y(e.component.subTree,t,r,o);else if(128&u)e.suspense.move(t,r,o);else if(64&u)c.move(e,t,r,le);else if(c!==dt)if(c!==vt)if(2!==o&&1&u&&a)if(0===o)a.beforeEnter(l),n(l,t,r),st((()=>a.enter(l)),i);else{const{leave:e,delayLeave:o,afterLeave:i}=a,c=()=>n(l,t,r),s=()=>{e(l,(()=>{c(),i&&i()}))};o?o(l,c,s):s()}else n(l,t,r);else(({el:e,anchor:t},r,o)=>{let i;for(;e&&e!==t;)i=y(e),n(e,r,o),e=i;n(t,r,o)})(e,t,r);else{n(l,t,r);for(let e=0;e{const{type:i,props:l,ref:c,children:a,dynamicChildren:s,shapeFlag:u,patchFlag:f,dirs:p}=e;if(null!=c&&ot(c,null,n,e,!0),256&u)return void t.ctx.deactivate(e);const d=1&u&&p,h=!te(e);let m;if(h&&(m=l&&l.onVnodeBeforeUnmount)&&Ut(m,t,e),6&u)ee(e.component,n,r);else{if(128&u)return void e.suspense.unmount(n,r);d&&we(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,o,le,r):s&&(i!==dt||f>0&&64&f)?ne(s,t,n,!1,!0):(i===dt&&384&f||!o&&16&u)&&ne(a,t,n),r&&X(e)}(h&&(m=l&&l.onVnodeUnmounted)||d)&&st((()=>{m&&Ut(m,t,e),d&&we(e,null,t,"unmounted")}),n)},X=e=>{const{type:t,el:n,anchor:r,transition:o}=e;if(t===dt)return void Q(n,r);if(t===vt)return void A(e);const i=()=>{l(n),o&&!o.persisted&&o.afterLeave&&o.afterLeave()};if(1&e.shapeFlag&&o&&!o.persisted){const{leave:t,delayLeave:r}=o,l=()=>t(n,i);r?r(e.el,i,l):l()}else i()},Q=(e,t)=>{let n;for(;e!==t;)n=y(e),l(e),e=n;l(t)},ee=(e,t,n)=>{const{bum:r,scope:i,update:l,subTree:c,um:a}=e;r&&(0,o.ir)(r),i.stop(),l&&(l.active=!1,Z(c,e,t,n)),a&&st(a,t),st((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},ne=(e,t,n,r=!1,o=!1,i=0)=>{for(let l=i;l6&e.shapeFlag?re(e.component.subTree):128&e.shapeFlag?e.suspense.next():y(e.anchor||e.el),ie=(e,t,n)=>{null==e?t._vnode&&Z(t._vnode,null,null,!0):E(t._vnode||null,e,t,null,null,null,n),b(),O(),t._vnode=e},le={p:E,um:Z,m:Y,r:X,mt:$,mc:F,pc:W,pbc:H,n:re,o:e};let ce,ae;return t&&([ce,ae]=t(le)),{render:ie,hydrate:ce,createApp:rt(ie,ce)}}(e,at)}function ft({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function pt(e,t,n=!1){const r=e.children,i=t.children;if((0,o.kJ)(r)&&(0,o.kJ)(i))for(let e=0;e0?_t||o.Z6:null,yt.pop(),_t=yt[yt.length-1]||null,bt>0&&_t&&_t.push(e),e}function St(e,t,n,r,o,i){return wt(xt(e,t,n,r,o,i,!0))}function Et(e,t,n,r,o){return wt(At(e,t,n,r,o,!0))}function jt(e){return!!e&&!0===e.__v_isVNode}function Pt(e,t){return e.type===t.type&&e.key===t.key}const kt="__vInternal",Ct=({key:e})=>null!=e?e:null,It=({ref:e,ref_key:t,ref_for:n})=>null!=e?(0,o.HD)(e)||(0,r.dq)(e)||(0,o.mf)(e)?{i:C,r:e,k:t,f:!!n}:e:null;function xt(e,t=null,n=null,r=0,i=null,l=(e===dt?0:1),c=!1,a=!1){const s={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ct(t),ref:t&&It(t),scopeId:I,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null};return a?(Mt(s,n),128&l&&e.normalize(s)):n&&(s.shapeFlag|=(0,o.HD)(n)?8:16),bt>0&&!c&&_t&&(s.patchFlag>0||6&l)&&32!==s.patchFlag&&_t.push(s),s}const At=function(e,t=null,n=null,i=0,l=null,c=!1){if(e&&e!==je||(e=mt),jt(e)){const r=Dt(e,t,!0);return n&&Mt(r,n),bt>0&&!c&&_t&&(6&r.shapeFlag?_t[_t.indexOf(e)]=r:_t.push(r)),r.patchFlag|=-2,r}if(a=e,(0,o.mf)(a)&&"__vccOpts"in a&&(e=e.__vccOpts),t){t=function(e){return e?(0,r.X3)(e)||kt in e?(0,o.l7)({},e):e:null}(t);let{class:e,style:n}=t;e&&!(0,o.HD)(e)&&(t.class=(0,o.C_)(e)),(0,o.Kn)(n)&&((0,r.X3)(n)&&!(0,o.kJ)(n)&&(n=(0,o.l7)({},n)),t.style=(0,o.j5)(n))}var a;return xt(e,t,n,i,l,(0,o.HD)(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:(0,o.Kn)(e)?4:(0,o.mf)(e)?2:0,c,!0)};function Dt(e,t,n=!1){const{props:r,ref:i,patchFlag:l,children:c}=e,a=t?Ht(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:a,key:a&&Ct(a),ref:t&&t.ref?n&&i?(0,o.kJ)(i)?i.concat(It(t)):[i,It(t)]:It(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:c,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==dt?-1===l?16:16|l:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Dt(e.ssContent),ssFallback:e.ssFallback&&Dt(e.ssFallback),el:e.el,anchor:e.anchor}}function Nt(e=" ",t=0){return At(ht,null,e,t)}function Tt(e,t){const n=At(vt,null,e);return n.staticCount=t,n}function Rt(e="",t=!1){return t?(gt(),Et(mt,null,e)):At(mt,null,e)}function Lt(e){return null==e||"boolean"==typeof e?At(mt):(0,o.kJ)(e)?At(dt,null,e.slice()):"object"==typeof e?Ft(e):At(ht,null,String(e))}function Ft(e){return null===e.el||e.memo?e:Dt(e)}function Mt(e,t){let n=0;const{shapeFlag:r}=e;if(null==t)t=null;else if((0,o.kJ)(t))n=16;else if("object"==typeof t){if(65&r){const n=t.default;return void(n&&(n._c&&(n._d=!1),Mt(e,n()),n._c&&(n._d=!0)))}{n=32;const r=t._;r||kt in t?3===r&&C&&(1===C.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=C}}else(0,o.mf)(t)?(t={default:t,_ctx:C},n=32):(t=String(t),64&r?(n=16,t=[Nt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ht(...e){const t={};for(let n=0;n$t||C,Vt=e=>{$t=e,e.scope.on()},Jt=()=>{$t&&$t.scope.off(),$t=null};function Wt(e){return 4&e.vnode.shapeFlag}let Kt=!1;function Gt(e,t,n){(0,o.mf)(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:(0,o.Kn)(t)&&(e.setupState=(0,r.WL)(t)),Yt(e,n)}function Yt(e,t,n){const i=e.type;e.render||(e.render=i.render||o.dG),Vt(e),(0,r.Jd)(),function(e){const t=Le(e),n=e.proxy,i=e.ctx;Ne=!1,t.beforeCreate&&Te(t.beforeCreate,e,"bc");const{data:l,computed:c,methods:a,watch:s,provide:u,inject:f,created:p,beforeMount:d,mounted:h,beforeUpdate:m,updated:v,activated:y,deactivated:_,beforeDestroy:g,beforeUnmount:b,destroyed:O,unmounted:w,render:S,renderTracked:E,renderTriggered:j,errorCaptured:P,serverPrefetch:k,expose:C,inheritAttrs:I,components:x,directives:A,filters:D}=t;if(f&&function(e,t,n=o.dG,i=!1){(0,o.kJ)(e)&&(e=Ue(e));for(const n in e){const l=e[n];let c;c=(0,o.Kn)(l)?"default"in l?M(l.from||n,l.default,!0):M(l.from||n):M(l),(0,r.dq)(c)&&i?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>c.value,set:e=>c.value=e}):t[n]=c}}(f,i,null,e.appContext.config.unwrapInjectedRef),a)for(const e in a){const t=a[e];(0,o.mf)(t)&&(i[e]=t.bind(n))}if(l){const t=l.call(n,n);(0,o.Kn)(t)&&(e.data=(0,r.qj)(t))}if(Ne=!0,c)for(const e in c){const t=c[e],r=(0,o.mf)(t)?t.bind(n,n):(0,o.mf)(t.get)?t.get.bind(n,n):o.dG,l=!(0,o.mf)(t)&&(0,o.mf)(t.set)?t.set.bind(n):o.dG,a=Xt({get:r,set:l});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(s)for(const e in s)Re(s[e],i,n,e);if(u){const e=(0,o.mf)(u)?u.call(n):u;Reflect.ownKeys(e).forEach((t=>{F(t,e[t])}))}function N(e,t){(0,o.kJ)(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(p&&Te(p,e,"c"),N(fe,d),N(pe,h),N(de,m),N(he,v),N(ie,y),N(le,_),N(be,P),N(ge,E),N(_e,j),N(me,b),N(ve,w),N(ye,k),(0,o.kJ)(C))if(C.length){const t=e.exposed||(e.exposed={});C.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});S&&e.render===o.dG&&(e.render=S),null!=I&&(e.inheritAttrs=I),x&&(e.components=x),A&&(e.directives=A)}(e),(0,r.lk)(),Jt()}function Zt(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy((0,r.WL)((0,r.Xl)(e.exposed)),{get:(t,n)=>n in t?t[n]:n in Ae?Ae[n](e):void 0}))}const Xt=(e,t)=>(0,r.Fl)(e,t,Kt);function Qt(e,t,n){const r=arguments.length;return 2===r?(0,o.Kn)(t)&&!(0,o.kJ)(t)?jt(t)?At(e,null,[t]):At(e,t):At(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&jt(n)&&(n=[n]),At(e,t,n))}Symbol("");const en="3.2.39"},9963:(e,t,n)=>{"use strict";n.d(t,{F8:()=>T,uT:()=>w,vr:()=>H});var r=n(3577),o=n(6252);n(2262);const i="undefined"!=typeof document?document:null,l=i&&i.createElement("template"),c={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t?i.createElementNS("http://www.w3.org/2000/svg",e):i.createElement(e,n?{is:n}:void 0);return"select"===e&&r&&null!=r.multiple&&o.setAttribute("multiple",r.multiple),o},createText:e=>i.createTextNode(e),createComment:e=>i.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>i.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode(e){const t=e.cloneNode(!0);return"_value"in e&&(t._value=e._value),t},insertStaticContent(e,t,n,r,o,i){const c=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),o!==i&&(o=o.nextSibling););else{l.innerHTML=r?`${e}`:e;const o=l.content;if(r){const e=o.firstChild;for(;e.firstChild;)o.appendChild(e.firstChild);o.removeChild(e)}t.insertBefore(o,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},a=/\s*!important$/;function s(e,t,n){if((0,r.kJ)(n))n.forEach((n=>s(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=f[t];if(n)return n;let o=(0,r._A)(t);if("filter"!==o&&o in e)return f[t]=o;o=(0,r.kC)(o);for(let n=0;n{let e=Date.now,t=!1;if("undefined"!=typeof window){Date.now()>document.createEvent("Event").timeStamp&&(e=performance.now.bind(performance));const n=navigator.userAgent.match(/firefox\/(\d+)/i);t=!!(n&&Number(n[1])<=53)}return[e,t]})();let m=0;const v=Promise.resolve(),y=()=>{m=0};const _=/(?:Once|Passive|Capture)$/,g=/^on[a-z]/;"undefined"!=typeof HTMLElement&&HTMLElement;const b="transition",O="animation",w=(e,{slots:t})=>(0,o.h)(o.P$,function(e){const t={};for(const n in e)n in S||(t[n]=e[n]);if(!1===e.css)return t;const{name:n="v",type:o,duration:i,enterFromClass:l=`${n}-enter-from`,enterActiveClass:c=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:s=l,appearActiveClass:u=c,appearToClass:f=a,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:d=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,m=function(e){if(null==e)return null;if((0,r.Kn)(e))return[P(e.enter),P(e.leave)];{const t=P(e);return[t,t]}}(i),v=m&&m[0],y=m&&m[1],{onBeforeEnter:_,onEnter:g,onEnterCancelled:b,onLeave:O,onLeaveCancelled:w,onBeforeAppear:x=_,onAppear:D=g,onAppearCancelled:N=b}=t,T=(e,t,n)=>{C(e,t?f:a),C(e,t?u:c),n&&n()},R=(e,t)=>{e._isLeaving=!1,C(e,p),C(e,h),C(e,d),t&&t()},L=e=>(t,n)=>{const r=e?D:g,i=()=>T(t,e,n);E(r,[t,i]),I((()=>{C(t,e?s:l),k(t,e?f:a),j(r)||A(t,o,v,i)}))};return(0,r.l7)(t,{onBeforeEnter(e){E(_,[e]),k(e,l),k(e,c)},onBeforeAppear(e){E(x,[e]),k(e,s),k(e,u)},onEnter:L(!1),onAppear:L(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>R(e,t);k(e,p),document.body.offsetHeight,k(e,d),I((()=>{e._isLeaving&&(C(e,p),k(e,h),j(O)||A(e,o,y,n))})),E(O,[e,n])},onEnterCancelled(e){T(e,!1),E(b,[e])},onAppearCancelled(e){T(e,!0),E(N,[e])},onLeaveCancelled(e){R(e),E(w,[e])}})}(e),t);w.displayName="Transition";const S={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},E=(w.props=(0,r.l7)({},o.P$.props,S),(e,t=[])=>{(0,r.kJ)(e)?e.forEach((e=>e(...t))):e&&e(...t)}),j=e=>!!e&&((0,r.kJ)(e)?e.some((e=>e.length>1)):e.length>1);function P(e){return(0,r.He)(e)}function k(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e._vtc||(e._vtc=new Set)).add(t)}function C(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function I(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let x=0;function A(e,t,n,r){const o=e._endId=++x,i=()=>{o===e._endId&&r()};if(n)return setTimeout(i,n);const{type:l,timeout:c,propCount:a}=function(e,t){const n=window.getComputedStyle(e),r=e=>(n[e]||"").split(", "),o=r("transitionDelay"),i=r("transitionDuration"),l=D(o,i),c=r("animationDelay"),a=r("animationDuration"),s=D(c,a);let u=null,f=0,p=0;return t===b?l>0&&(u=b,f=l,p=i.length):t===O?s>0&&(u=O,f=s,p=a.length):(f=Math.max(l,s),u=f>0?l>s?b:O:null,p=u?u===b?i.length:a.length:0),{type:u,timeout:f,propCount:p,hasTransform:u===b&&/\b(transform|all)(,|$)/.test(n.transitionProperty)}}(e,t);if(!l)return r();const s=l+"end";let u=0;const f=()=>{e.removeEventListener(s,p),i()},p=t=>{t.target===e&&++u>=a&&f()};setTimeout((()=>{uN(t)+N(e[n]))))}function N(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}new WeakMap,new WeakMap;const T={beforeMount(e,{value:t},{transition:n}){e._vod="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):R(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),R(e,!0),r.enter(e)):r.leave(e,(()=>{R(e,!1)})):R(e,t))},beforeUnmount(e,{value:t}){R(e,t)}};function R(e,t){e.style.display=t?e._vod:"none"}const L=(0,r.l7)({patchProp:(e,t,n,i,l=!1,c,a,u,f)=>{"class"===t?function(e,t,n){const r=e._vtc;r&&(t=(t?[t,...r]:[...r]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,i,l):"style"===t?function(e,t,n){const o=e.style,i=(0,r.HD)(n);if(n&&!i){for(const e in n)s(o,e,n[e]);if(t&&!(0,r.HD)(t))for(const e in t)null==n[e]&&s(o,e,"")}else{const r=o.display;i?t!==n&&(o.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(o.display=r)}}(e,n,i):(0,r.F7)(t)?(0,r.tR)(t)||function(e,t,n,i,l=null){const c=e._vei||(e._vei={}),a=c[t];if(i&&a)a.value=i;else{const[n,s]=function(e){let t;if(_.test(e)){let n;for(t={};n=e.match(_);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):(0,r.rs)(e.slice(2)),t]}(t);if(i){const a=c[t]=function(e,t){const n=e=>{const i=e.timeStamp||d();(h||i>=n.attached-1)&&(0,o.$d)(function(e,t){if((0,r.kJ)(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=m||(v.then(y),m=d()),n}(i,l);!function(e,t,n,r){e.addEventListener(t,n,r)}(e,n,a,s)}else a&&(function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,a,s),c[t]=void 0)}}(e,t,0,i,a):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,o){return o?"innerHTML"===t||"textContent"===t||!!(t in e&&g.test(t)&&(0,r.mf)(n)):"spellcheck"!==t&&"draggable"!==t&&"translate"!==t&&("form"!==t&&(("list"!==t||"INPUT"!==e.tagName)&&(("type"!==t||"TEXTAREA"!==e.tagName)&&((!g.test(t)||!(0,r.HD)(n))&&t in e))))}(e,t,i,l))?function(e,t,n,o,i,l,c){if("innerHTML"===t||"textContent"===t)return o&&c(o,i,l),void(e[t]=null==n?"":n);if("value"===t&&"PROGRESS"!==e.tagName&&!e.tagName.includes("-")){e._value=n;const r=null==n?"":n;return e.value===r&&"OPTION"!==e.tagName||(e.value=r),void(null==n&&e.removeAttribute(t))}let a=!1;if(""===n||null==n){const o=typeof e[t];"boolean"===o?n=(0,r.yA)(n):null==n&&"string"===o?(n="",a=!0):"number"===o&&(n=0,a=!0)}try{e[t]=n}catch(e){}a&&e.removeAttribute(t)}(e,t,i,c,a,u,f):("true-value"===t?e._trueValue=i:"false-value"===t&&(e._falseValue=i),function(e,t,n,o,i){if(o&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(p,t.slice(6,t.length)):e.setAttributeNS(p,t,n);else{const o=(0,r.Pq)(t);null==n||o&&!(0,r.yA)(n)?e.removeAttribute(t):e.setAttribute(t,o?"":n)}}(e,t,i,l))}},c);let F,M=!1;const H=(...e)=>{const t=(F=M?F:(0,o.Eo)(L),M=!0,F).createApp(...e),{mount:n}=t;return t.mount=e=>{const t=function(e){if((0,r.HD)(e))return document.querySelector(e);return e}(e);if(t)return n(t,!0,t instanceof SVGElement)},t}},3577:(e,t,n)=>{"use strict";function r(e,t){const n=Object.create(null),r=e.split(",");for(let e=0;e!!n[e.toLowerCase()]:e=>!!n[e]}n.d(t,{C_:()=>f,DM:()=>I,E9:()=>ee,F7:()=>O,Gg:()=>z,HD:()=>D,He:()=>X,Kn:()=>T,NO:()=>g,Nj:()=>Z,Od:()=>E,PO:()=>H,Pq:()=>i,RI:()=>P,S0:()=>U,W7:()=>M,WV:()=>p,Z6:()=>y,_A:()=>B,_N:()=>C,aU:()=>G,dG:()=>_,e1:()=>o,fY:()=>r,hR:()=>K,hq:()=>d,ir:()=>Y,j5:()=>c,kC:()=>W,kJ:()=>k,kT:()=>v,l7:()=>S,mf:()=>A,rs:()=>J,tI:()=>R,tR:()=>w,yA:()=>l,yk:()=>N,zw:()=>h});const o=r("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt"),i=r("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function l(e){return!!e||""===e}function c(e){if(k(e)){const t={};for(let n=0;n{if(e){const n=e.split(s);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function f(e){let t="";if(D(e))t=e;else if(k(e))for(let n=0;np(e,t)))}const h=e=>D(e)?e:null==e?"":k(e)||T(e)&&(e.toString===L||!A(e.toString))?JSON.stringify(e,m,2):String(e),m=(e,t)=>t&&t.__v_isRef?m(e,t.value):C(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n])=>(e[`${t} =>`]=n,e)),{})}:I(t)?{[`Set(${t.size})`]:[...t.values()]}:!T(t)||k(t)||H(t)?t:String(t),v={},y=[],_=()=>{},g=()=>!1,b=/^on[^a-z]/,O=e=>b.test(e),w=e=>e.startsWith("onUpdate:"),S=Object.assign,E=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},j=Object.prototype.hasOwnProperty,P=(e,t)=>j.call(e,t),k=Array.isArray,C=e=>"[object Map]"===F(e),I=e=>"[object Set]"===F(e),x=e=>"[object Date]"===F(e),A=e=>"function"==typeof e,D=e=>"string"==typeof e,N=e=>"symbol"==typeof e,T=e=>null!==e&&"object"==typeof e,R=e=>T(e)&&A(e.then)&&A(e.catch),L=Object.prototype.toString,F=e=>L.call(e),M=e=>F(e).slice(8,-1),H=e=>"[object Object]"===F(e),U=e=>D(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,z=r(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),q=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},$=/-(\w)/g,B=q((e=>e.replace($,((e,t)=>t?t.toUpperCase():"")))),V=/\B([A-Z])/g,J=q((e=>e.replace(V,"-$1").toLowerCase())),W=q((e=>e.charAt(0).toUpperCase()+e.slice(1))),K=q((e=>e?`on${W(e)}`:"")),G=(e,t)=>!Object.is(e,t),Y=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},X=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Q;const ee=()=>Q||(Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{})},5698:(e,t,n)=>{"use strict";var r=n(3131),o=n(9947),i=n(4611),l=n(6056),c=n(4634),a=n(7788),s=n(9963),u=n(6252),f=n(2201),p=n(4546),d=n(3447),h=n(704);const m=s.vr,v=f.PO;(async()=>{const e=m({name:"VuepressApp",setup(){(0,p.BK)();for(const e of i.l)e();return()=>[(0,u.h)(f.MA),...o.p.map((e=>(0,u.h)(e)))]}}),t=(0,f.p7)({history:v((0,a.U1)(p.HM.value.base)),routes:c.g,scrollBehavior:(e,t,n)=>n||(e.hash?{el:e.hash}:{top:0})});t.beforeResolve((async(e,t)=>{var n;e.path===t.path&&t!==f.AJ||([p.Xp.value]=await Promise.all([(0,p.C4)(e.name),null===(n=l.b[e.name])||void 0===n?void 0:n.__asyncLoader()]))})),((e,t)=>{const n=(0,u.Fl)((()=>(0,p.S)(p.HM.value.locales,t.currentRoute.value.path))),r=(0,u.Fl)((()=>(0,p.kY)(p.HM.value,n.value))),o=(0,u.Fl)((()=>(0,p.hN)(p.Xp.value))),i=(0,u.Fl)((()=>(0,p.lp)(p.Xp.value,r.value))),l=(0,u.Fl)((()=>(0,p.nl)(i.value,o.value,r.value))),c=(0,u.Fl)((()=>(0,p.Vo)(p.Xp.value)));e.provide(p.C3,n),e.provide(p.AE,r),e.provide(p.PY,o),e.provide(p.et,i),e.provide(p.VV,l),e.provide(p.b5,c),Object.defineProperties(e.config.globalProperties,{$frontmatter:{get:()=>o.value},$headTitle:{get:()=>i.value},$lang:{get:()=>c.value},$page:{get:()=>p.Xp.value},$routeLocale:{get:()=>n.value},$site:{get:()=>p.HM.value},$siteLocale:{get:()=>r.value},$withBase:{get:()=>d.pJ}})})(e,t),(e=>{e.component("ClientOnly",h.qx),e.component("Content",h.VY),e.component("OutboundLink",h.MS)})(e);for(const n of r.g)await n({app:e,router:t,siteData:p.HM});return e.use(t),{app:e,router:t}})().then((({app:e,router:t})=>{t.isReady().then((()=>{e.mount("#app")}))}))},4802:(e,t,n)=>{"use strict";n.d(t,{Y:()=>c});var r=n(4150),o=n(7788),i=n(6252),l=n(4546);const c=(0,i.aZ)({name:"Vuepress",setup(){const e=(0,l.Vi)(),t=(0,i.Fl)((()=>{let t;if(e.value.path){const n=e.value.frontmatter.layout;t=(0,o.HD)(n)?n:"Layout"}else t="404";return r.Z[t]||(0,i.up)(t,!1)}));return()=>(0,i.h)(t.value)}})},704:(e,t,n)=>{"use strict";n.d(t,{qx:()=>i,VY:()=>a,MS:()=>u});var r=n(6252),o=n(2262);const i=(0,r.aZ)({setup(e,t){const n=(0,o.iH)(!1);return(0,r.bv)((()=>{n.value=!0})),()=>{var e,r;return n.value?null===(r=(e=t.slots).default)||void 0===r?void 0:r.call(e):null}}});var l=n(6056),c=n(4546);const a=e=>{let t;t=e.pageKey?e.pageKey:(0,c.Vi)().value.key;const n=l.b[t];return n?(0,r.h)(n):(0,r.h)("div","404 Not Found")};a.displayName="Content",a.props={pageKey:{type:String,required:!1}};const s=(0,r.h)("svg",{class:"icon outbound",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"},[(0,r.h)("path",{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}),(0,r.h)("polygon",{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"})]),u=(e,{slots:t})=>{var n;return(0,r.h)("span",[s,null===(n=t.default)||void 0===n?void 0:n.call(t)])};u.displayName="OutboundLink",n(4802)},4546:(e,t,n)=>{"use strict";n.d(t,{Xp:()=>c,PY:()=>f,VV:()=>m,et:()=>y,b5:()=>g,C4:()=>s,hN:()=>d,nl:()=>v,lp:()=>_,Vo:()=>O,S:()=>E,kY:()=>x,C3:()=>w,BK:()=>N,HM:()=>P,AE:()=>C,Vi:()=>a,I2:()=>p,Ym:()=>b,I:()=>S,WF:()=>k,I5:()=>I});var r=n(2262),o=n(9706);const i=(0,r.iH)(o.T),l=(0,r.OT)({key:"",path:"",title:"",lang:"",frontmatter:{},excerpt:"",headers:[]}),c=(0,r.iH)(l),a=()=>c,s=async e=>{const t=i.value[e];if(!t)return l;const n=await t();return null!=n?n:l};var u=n(6252);const f=Symbol(""),p=()=>{const e=(0,u.f3)(f);if(!e)throw new Error("usePageFrontmatter() is called without provider.");return e},d=e=>e.frontmatter;var h=n(7788);const m=Symbol(""),v=(e,t,n)=>{const r=(0,h.HD)(t.description)?t.description:n.description,o=[...(0,h.kJ)(t.head)?t.head:[],...n.head,["title",{},e],["meta",{name:"description",content:r}]];return(0,h.H7)(o)},y=Symbol(""),_=(e,t)=>`${e.title?`${e.title} | `:""}${t.title}`,g=Symbol(""),b=()=>{const e=(0,u.f3)(g);if(!e)throw new Error("usePageLang() is called without provider.");return e},O=e=>e.lang||"en",w=Symbol(""),S=()=>{const e=(0,u.f3)(w);if(!e)throw new Error("useRouteLocale() is called without provider.");return e},E=(e,t)=>(0,h.gb)(e,t);var j=n(5220);const P=(0,r.iH)(j.H),k=()=>P,C=Symbol(""),I=()=>{const e=(0,u.f3)(C);if(!e)throw new Error("useSiteLocaleData() is called without provider.");return e},x=(e,t)=>({...e,...e.locales[t]});var A=n(2201);const D=Symbol(""),N=()=>{const e=(0,A.yj)(),t=(()=>{const e=(0,u.f3)(m);if(!e)throw new Error("usePageHead() is called without provider.");return e})(),n=b(),o=(0,r.iH)([]),i=()=>{document.documentElement.lang=n.value,o.value.forEach((e=>{e.parentNode===document.head&&document.head.removeChild(e)})),o.value.splice(0,o.value.length),t.value.forEach((e=>{const t=R(e);null!==t&&(document.head.appendChild(t),o.value.push(t))}))};(0,u.JJ)(D,i),(0,u.bv)((()=>{t.value.forEach((e=>{const t=T(e);t&&o.value.push(t)})),i(),(0,u.YP)((()=>e.path),(()=>i()))}))},T=([e,t,n=""])=>{const r=`head > ${e}${Object.entries(t).map((([e,t])=>(0,h.HD)(t)?`[${e}="${t}"]`:!0===t?`[${e}]`:"")).join("")}`;return Array.from(document.querySelectorAll(r)).find((e=>e.innerText===n))||null},R=([e,t,n])=>{if(!(0,h.HD)(e))return null;const r=document.createElement(e);return(0,h.PO)(t)&&Object.entries(t).forEach((([e,t])=>{(0,h.HD)(t)?r.setAttribute(e,t):!0===t&&r.setAttribute(e,"")})),(0,h.HD)(n)&&r.appendChild(document.createTextNode(n)),r}},7621:(e,t,n)=>{"use strict";n.d(t,{C3:()=>o.C3,F2:()=>i.F2,I:()=>o.I,I2:()=>o.I2,I5:()=>o.I5,MS:()=>r.MS,Vi:()=>o.Vi,WF:()=>o.WF,Ym:()=>o.Ym,pJ:()=>i.pJ,vW:()=>i.vW}),n(5698);var r=n(704),o=n(4546),i=n(3447)},3447:(e,t,n)=>{"use strict";n.d(t,{vW:()=>r,F2:()=>o,pJ:()=>c});const r=e=>e,o=e=>e;var i=n(7788),l=n(4546);const c=e=>(0,i.ak)(e)?e:`${(0,l.WF)().value.base}${(0,i.FY)(e)}`},1263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(7621),o=n(2938),i=n(6252),l=n(2201);const c=async(e,...t)=>{const{scrollBehavior:n}=e.options;e.options.scrollBehavior=void 0,await e.replace(...t).finally((()=>e.options.scrollBehavior=n))},a=(0,r.F2)((()=>{(({headerLinkSelector:e,headerAnchorSelector:t,delay:n,offset:a=5})=>{const s=(0,l.tv)(),u=(0,r.Vi)(),f=(0,o.D)((()=>(()=>{var n,r,o,i;const l=Array.from(document.querySelectorAll(e)),u=Array.from(document.querySelectorAll(t)).filter((e=>l.some((t=>t.hash===e.hash)))),f=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),p=window.innerHeight+f,d=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),h=Math.abs(d-p)=(null!==(r=null===(n=t.parentElement)||void 0===n?void 0:n.offsetTop)&&void 0!==r?r:0)-a,m=!l||f<(null!==(i=null===(o=l.parentElement)||void 0===o?void 0:o.offsetTop)&&void 0!==i?i:0)-a;if(!(p||d&&m))continue;const v=decodeURIComponent(s.currentRoute.value.hash),y=decodeURIComponent(t.hash);if(v===y)return;if(h)for(let t=e+1;t{f(),window.addEventListener("scroll",(()=>f()))})),(0,i.Jd)((()=>{window.removeEventListener("scroll",(()=>f()))})),(0,i.YP)((()=>u.value.path),(()=>f()))})({headerLinkSelector:"a.sidebar-item",headerAnchorSelector:".header-anchor",delay:200,offset:5})}))},3051:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(2938),o=n(6252),i=n(2262),l=n(9963);const c=()=>window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,a=()=>window.scrollTo({top:0,behavior:"smooth"}),s=(0,o.aZ)({name:"BackToTop",setup(){const e=(0,i.iH)(0),t=(0,o.Fl)((()=>e.value>300));(0,o.bv)((()=>{e.value=c(),window.addEventListener("scroll",(()=>(0,r.D)((()=>{e.value=c()}),100)))}));const n=(0,o.h)("div",{class:"back-to-top",onClick:a});return()=>(0,o.h)(l.uT,{name:"back-to-top"},{default:()=>t.value?n:null})}})},6934:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Br});var r=n(7621),o=n(6252);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){return(c=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n3)for(n=[n],i=3;i0?j(d.type,d.props,d.key,null,d.__v):d)){if(d.__=n,d.__b=n.__b+1,null===(p=y[u])||p&&d.key==p.key&&d.type===p.type)y[u]=void 0;else for(f=0;f<_;f++){if((p=y[f])&&d.key==p.key&&d.type===p.type){y[f]=void 0;break}p=null}U(e,d,p=p||g,o,i,l,c,a,s),h=d.__e,(f=d.ref)&&p.ref!=f&&(v||(v=[]),p.ref&&v.push(p.ref,null,d),v.push(f,d.__c||h,d)),null!=h?(null==m&&(m=h),"function"==typeof d.type&&null!=d.__k&&d.__k===p.__k?d.__d=a=N(d,a,e):a=R(e,d,p,y,h,a),s||"option"!==n.type?"function"==typeof n.type&&(n.__d=a):e.value=""):a&&p.__e==a&&a.parentNode!=e&&(a=C(p))}for(n.__e=m,u=_;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=C(r,u+1)),B(y[u],y[u]));if(v)for(u=0;u3)for(n=[n],i=3;i=n.__.length&&n.__.push({}),n.__[e]}function le(e){return X=1,ce(ve,e)}function ce(e,t,n){var r=ie(G++,2);return r.t=e,r.__c||(r.__=[n?n(t):ve(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=Y),r.__}function ae(e,t){var n=ie(G++,3);!h.__s&&me(n.__H,t)&&(n.__=e,n.__H=t,Y.__H.__h.push(n))}function se(e,t){var n=ie(G++,4);!h.__s&&me(n.__H,t)&&(n.__=e,n.__H=t,Y.__h.push(n))}function ue(e,t){var n=ie(G++,7);return me(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function fe(){Q.forEach((function(e){if(e.__P)try{e.__H.__h.forEach(de),e.__H.__h.forEach(he),e.__H.__h=[]}catch(t){e.__H.__h=[],h.__e(t,e.__v)}})),Q=[]}h.__b=function(e){Y=null,ee&&ee(e)},h.__r=function(e){te&&te(e),G=0;var t=(Y=e.__c).__H;t&&(t.__h.forEach(de),t.__h.forEach(he),t.__h=[])},h.diffed=function(e){ne&&ne(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==Q.push(t)&&Z===h.requestAnimationFrame||((Z=h.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),pe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);pe&&(t=requestAnimationFrame(n))})(fe)),Y=void 0},h.__c=function(e,t){t.some((function(e){try{e.__h.forEach(de),e.__h=e.__h.filter((function(e){return!e.__||he(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],h.__e(n,e.__v)}})),re&&re(e,t)},h.unmount=function(e){oe&&oe(e);var t=e.__c;if(t&&t.__H)try{t.__H.__.forEach(de)}catch(e){h.__e(e,t.__v)}};var pe="function"==typeof requestAnimationFrame;function de(e){var t=Y;"function"==typeof e.__c&&e.__c(),Y=t}function he(e){var t=Y;e.__c=e.__(),Y=t}function me(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function ve(e,t){return"function"==typeof t?t(e):t}function ye(e,t){for(var n in t)e[n]=t[n];return e}function _e(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function ge(e){this.props=e}(ge.prototype=new k).isPureReactComponent=!0,ge.prototype.shouldComponentUpdate=function(e,t){return _e(this.props,e)||_e(this.state,t)};var be=h.__b;h.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),be&&be(e)};var Oe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911,we=function(e,t){return null==e?null:T(T(e).map(t))},Se={map:we,forEach:we,count:function(e){return e?T(e).length:0},only:function(e){var t=T(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:T},Ee=h.__e;function je(){this.__u=0,this.t=null,this.__b=null}function Pe(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function ke(){this.u=null,this.o=null}h.__e=function(e,t,n){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);Ee(e,t,n)},(je.prototype=new k).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=Pe(r.__v),i=!1,l=function(){i||(i=!0,n.componentWillUnmount=n.__c,o?o(c):c())};n.__c=n.componentWillUnmount,n.componentWillUnmount=function(){l(),n.__c&&n.__c()};var c=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},a=!0===t.__h;r.__u++||a||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(l,l)},je.prototype.componentWillUnmount=function(){this.t=[]},je.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=ye({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__e&&E(P,null,e.fallback);return o&&(o.__h=null),[E(P,null,t.__e?null:e.children),o]};var Ce=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),J(E(Ie,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Ae(e,t){return E(xe,{__v:e,i:t})}(ke.prototype=new k).__e=function(e){var t=this,n=Pe(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Ce(t,e,r)):o()};n?n(i):i()}},ke.prototype.render=function(e){this.u=null,this.o=new Map;var t=T(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ke.prototype.componentDidUpdate=ke.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){Ce(e,n,t)}))};var De="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ne=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Te=function(e){return("undefined"!=typeof Symbol&&"symbol"==i(Symbol())?/fil|che|rad/i:/fil|che|ra/i).test(e)};function Re(e,t,n){return null==t.__k&&(t.textContent=""),J(e,t),"function"==typeof n&&n(),e?e.__c:null}k.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(k.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Le=h.event;function Fe(){}function Me(){return this.cancelBubble}function He(){return this.defaultPrevented}h.event=function(e){return Le&&(e=Le(e)),e.persist=Fe,e.isPropagationStopped=Me,e.isDefaultPrevented=He,e.nativeEvent=e};var Ue,ze={configurable:!0,get:function(){return this.class}},qe=h.vnode;h.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){for(var o in r={},n){var i=n[o];"value"===o&&"defaultValue"in n&&null==i||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===i?i="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!Te(n.type)?o="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():Ne.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===i&&(i=void 0),r[o]=i)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=T(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=T(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r}t&&n.class!=n.className&&(ze.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",ze)),e.$$typeof=De,qe&&qe(e)};var $e=h.__r;h.__r=function(e){$e&&$e(e),Ue=e.__c};var Be={ReactCurrentDispatcher:{current:{readContext:function(e){return Ue.__n[e.__c].props.value}}}};function Ve(e){return!!e&&e.$$typeof===De}"object"==("undefined"==typeof performance?"undefined":i(performance))&&"function"==typeof performance.now&&performance.now.bind(performance);var Je={useState:le,useReducer:ce,useEffect:ae,useLayoutEffect:se,useRef:function(e){return X=5,ue((function(){return{current:e}}),[])},useImperativeHandle:function(e,t,n){X=6,se((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))},useMemo:ue,useCallback:function(e,t){return X=8,ue((function(){return e}),t)},useContext:function(e){var t=Y.context[e.__c],n=ie(G++,9);return n.__c=e,t?(null==n.__&&(n.__=!0,t.sub(Y)),t.props.value):e.__},useDebugValue:function(e,t){h.useDebugValue&&h.useDebugValue(t?t(e):e)},version:"16.8.0",Children:Se,render:Re,hydrate:function(e,t,n){return W(e,t),"function"==typeof n&&n(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(J(null,e),!0)},createPortal:Ae,createElement:E,createContext:function(e,t){var n={__c:t="__cC"+_++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(x)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},createFactory:function(e){return E.bind(null,e)},cloneElement:function(e){return Ve(e)?K.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:P,isValidElement:Ve,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:k,PureComponent:ge,memo:function(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:_e(this.props,e)}function r(t){return this.shouldComponentUpdate=n,E(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r},forwardRef:function(e){function t(t,n){var r=ye({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=i(n)||"current"in n)?n:null)}return t.$$typeof=Oe,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:P,Suspense:je,SuspenseList:ke,lazy:function(e){var t,n,r;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return E(n,o)}return o.displayName="Lazy",o.__f=!0,o},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Be};function We(){return Je.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},Je.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}function Ke(){return Je.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},Je.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function Ge(){return(Ge=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["translations"]),i=r.buttonText,l=void 0===i?"Search":i,c=r.buttonAriaLabel,a=void 0===c?"Search":c,s=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var l,c=e[Symbol.iterator]();!(r=(l=c.next()).done)&&(n.push(l.value),2!==n.length);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}}(e)||function(e,t){if(e){if("string"==typeof e)return Ye(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ye(e,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(le(null)),u=s[0],f=s[1];return ae((function(){"undefined"!=typeof navigator&&f(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?"⌘":"Ctrl")}),[]),Je.createElement("button",Ge({type:"button",className:"DocSearch DocSearch-Button","aria-label":a},o,{ref:t}),Je.createElement("span",{className:"DocSearch-Button-Container"},Je.createElement(Ke,null),Je.createElement("span",{className:"DocSearch-Button-Placeholder"},l)),null!==u&&Je.createElement("span",{className:"DocSearch-Button-Keys"},Je.createElement("span",{className:"DocSearch-Button-Key"},"Ctrl"===u?Je.createElement(We,null):u),Je.createElement("span",{className:"DocSearch-Button-Key"},"K")))}));function Xe(e){return 0===e.collections.length?0:e.collections.reduce((function(e,t){return e+t.items.length}),0)}function Qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tt(e){return e.reduce((function(e,t){return e.concat(t)}),[])}var nt=0;function rt(e,t,n,r){if(e<0&&(null===t||null!==r&&0===t))return n+e;var o=(null===t?-1:t)+e;return o<=-1||o>=n?null===r?null:0:o}var ot=function(){};function it(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ct(e){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function at(e){var t=function(e){var t=e.collections.map((function(e){return e.items.length})).reduce((function(e,t,n){var r=(e[n-1]||0)+t;return e.push(r),e}),[]).reduce((function(t,n){return n<=e.activeItemId?t+1:t}),0);return e.collections[t]}(e);if(!t)return null;var n=t.items[function(e){for(var t=e.state,n=e.collection,r=!1,o=0,i=0;!1===r;){var l=t.collections[o];if(l===n){r=!0;break}i+=l.items.length,o++}return t.activeItemId-i}({state:e,collection:t})],r=t.source;return{item:n,itemInputValue:r.getItemInputValue({item:n,state:e}),itemUrl:r.getItemUrl({item:n,state:e}),source:r}}function st(e,t){return e===t||e.contains(t)}function ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ft(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["event","nextState","props","query","refresh","store"]);Ot&&o.environment.clearTimeout(Ot);var s,u=a.setCollections,f=a.setIsOpen,p=a.setQuery,d=a.setActiveItemId,h=a.setStatus;return p(i),d(o.defaultActiveItemId),i||!1!==o.openOnFocus?(h("loading"),Ot=o.environment.setTimeout((function(){h("stalled")}),o.stallThreshold),o.getSources(gt({query:i,refresh:l,state:c.getState()},a)).then((function(e){return h("loading"),Promise.all(e.map((function(e){return Promise.resolve(e.getItems(gt({query:i,refresh:l,state:c.getState()},a))).then((function(t){return Array.isArray(t),"The `getItems` function must return an array of items but returned type ".concat(JSON.stringify(yt(t)),":\n\n").concat(JSON.stringify(t,null,2)),{source:e,items:t}}))}))).then((function(e){var n;h("idle"),u(e);var s=o.shouldPanelOpen({state:c.getState()});f(null!==(n=r.isOpen)&&void 0!==n?n:o.openOnFocus&&!i&&s||s);var p=at(c.getState());if(null!==c.getState().activeItemId&&p){var d=p.item,m=p.itemInputValue,v=p.itemUrl,y=p.source;y.onActive(gt({event:t,item:d,itemInputValue:m,itemUrl:v,refresh:l,source:y,state:c.getState()},a))}})).finally((function(){Ot&&o.environment.clearTimeout(Ot)}))}))):(h("idle"),u(c.getState().collections.map((function(e){return gt(gt({},e),{},{items:[]})}))),f(null!==(s=r.isOpen)&&void 0!==s?s:o.shouldPanelOpen({state:c.getState()})),Promise.resolve())}function St(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Et(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function xt(e){var t=e.state;return!1===t.isOpen||null===t.activeItemId?null:at(t).itemInputValue||null}function At(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t0}},e),{},{id:null!==(n=e.id)&&void 0!==n?n:"autocomplete-".concat(nt++),plugins:o,initialState:mt({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var n;null===(n=e.onStateChange)||void 0===n||n.call(e,t),o.forEach((function(e){var n;return null===(n=e.onStateChange)||void 0===n?void 0:n.call(e,t)}))},onSubmit:function(t){var n;null===(n=e.onSubmit)||void 0===n||n.call(e,t),o.forEach((function(e){var n;return null===(n=e.onSubmit)||void 0===n?void 0:n.call(e,t)}))},onReset:function(t){var n;null===(n=e.onReset)||void 0===n||n.call(e,t),o.forEach((function(e){var n;return null===(n=e.onReset)||void 0===n?void 0:n.call(e,t)}))},getSources:function(n){return Promise.all([].concat(function(e){return function(e){if(Array.isArray(e))return dt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return dt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dt(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(o.map((function(e){return e.getSources}))),[e.getSources]).filter(Boolean).map((function(e){return function(e,t){return Promise.resolve(e(t)).then((function(e){return Array.isArray(e),"The `getSources` function must return an array of sources but returned type ".concat(JSON.stringify(ct(e)),":\n\n").concat(JSON.stringify(e,null,2)),Promise.all(e.filter((function(e){return Boolean(e)})).map((function(e){e.sourceId;var t=function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["event","props","refresh","store"]);if("ArrowUp"===t.key||"ArrowDown"===t.key){t.preventDefault(),o.dispatch(t.key,null);var l=n.environment.document.getElementById("".concat(n.id,"-item-").concat(o.getState().activeItemId));l&&(l.scrollIntoViewIfNeeded?l.scrollIntoViewIfNeeded(!1):l.scrollIntoView(!1));var c=at(o.getState());if(null!==o.getState().activeItemId&&c){var a=c.item,s=c.itemInputValue,u=c.itemUrl,f=c.source;f.onActive(Et({event:t,item:a,itemInputValue:s,itemUrl:u,refresh:r,source:f,state:o.getState()},i))}}else if("Escape"===t.key)t.preventDefault(),o.dispatch(t.key,null);else if("Enter"===t.key){if(null===o.getState().activeItemId||o.getState().collections.every((function(e){return 0===e.items.length})))return;t.preventDefault();var p=at(o.getState()),d=p.item,h=p.itemInputValue,m=p.itemUrl,v=p.source;if(t.metaKey||t.ctrlKey)void 0!==m&&(v.onSelect(Et({event:t,item:d,itemInputValue:h,itemUrl:m,refresh:r,source:v,state:o.getState()},i)),n.navigator.navigateNewTab({itemUrl:m,item:d,state:o.getState()}));else if(t.shiftKey)void 0!==m&&(v.onSelect(Et({event:t,item:d,itemInputValue:h,itemUrl:m,refresh:r,source:v,state:o.getState()},i)),n.navigator.navigateNewWindow({itemUrl:m,item:d,state:o.getState()}));else if(t.altKey);else{if(void 0!==m)return v.onSelect(Et({event:t,item:d,itemInputValue:h,itemUrl:m,refresh:r,source:v,state:o.getState()},i)),void n.navigator.navigate({itemUrl:m,item:d,state:o.getState()});wt(Et({event:t,nextState:{isOpen:!1},props:n,query:h,refresh:r,store:o},i)).then((function(){v.onSelect(Et({event:t,item:d,itemInputValue:h,itemUrl:m,refresh:r,source:v,state:o.getState()},i))}))}}}(kt({event:e,props:t,refresh:n,store:r},o))},onFocus:i,onBlur:function(){l||r.dispatch("blur",null)},onClick:function(n){e.inputElement!==t.environment.document.activeElement||r.getState().isOpen||i(n)}},u)},getPanelProps:function(e){return kt({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){r.dispatch("mouseleave",null)}},e)},getListProps:function(e){return kt({role:"listbox","aria-labelledby":"".concat(t.id,"-label"),id:"".concat(t.id,"-list")},e)},getItemProps:function(e){var i=e.item,l=e.source,c=It(e,["item","source"]);return kt({id:"".concat(t.id,"-item-").concat(i.__autocomplete_id),role:"option","aria-selected":r.getState().activeItemId===i.__autocomplete_id,onMouseMove:function(e){if(i.__autocomplete_id!==r.getState().activeItemId){r.dispatch("mousemove",i.__autocomplete_id);var t=at(r.getState());if(null!==r.getState().activeItemId&&t){var l=t.item,c=t.itemInputValue,a=t.itemUrl,s=t.source;s.onActive(kt({event:e,item:l,itemInputValue:c,itemUrl:a,refresh:n,source:s,state:r.getState()},o))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var c=l.getItemInputValue({item:i,state:r.getState()}),a=l.getItemUrl({item:i,state:r.getState()});(a?Promise.resolve():wt(kt({event:e,nextState:{isOpen:!1},props:t,query:c,refresh:n,store:r},o))).then((function(){l.onSelect(kt({event:e,item:i,itemInputValue:c,itemUrl:a,refresh:n,source:l,state:r.getState()},o))}))}},c)}}}(Lt({props:n,refresh:l,store:r},o));function l(){return wt(Lt({event:new Event("input"),nextState:{isOpen:r.getState().isOpen},props:n,query:r.getState().query,refresh:l,store:r},o))}return n.plugins.forEach((function(e){var n;return null===(n=e.subscribe)||void 0===n?void 0:n.call(e,Lt(Lt({},o),{},{refresh:l,onSelect:function(e){t.push({onSelect:e})},onActive:function(e){t.push({onActive:e})}}))})),Lt(Lt({refresh:l},i),o)}var Ht="1.0.0-alpha.44";function Ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zt(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&Je.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},Je.createElement("p",{className:"DocSearch-Help"},"Try searching for:"),Je.createElement("ul",null,t.slice(0,3).reduce((function(t,n){return[].concat(function(e){return function(e){if(Array.isArray(e))return cn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return cn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t),[Je.createElement("li",{key:n},Je.createElement("button",{className:"DocSearch-Prefill",key:n,onClick:function(){e.setQuery(n.toLowerCase()+" "),e.refresh(),e.inputRef.current.focus()}},n))])}),[]))),Je.createElement("p",{className:"DocSearch-Help"},"Believe this query should return results?"," ",Je.createElement("a",{href:"https://github.com/algolia/docsearch-configs/issues/new?template=Missing_results.md&title=[".concat(e.indexName,']+Missing+results+for+query+"').concat(e.state.query,'"'),target:"_blank",rel:"noopener noreferrer"},"Let us know"),"."))}function sn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function un(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["hit","attribute","tagName"])),{},{dangerouslySetInnerHTML:{__html:pn(t,"_snippetResult.".concat(n,".value"))||pn(t,n)}}))}function hn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var l,c=e[Symbol.iterator]();!(r=(l=c.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return mn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}));return e.state.query?!1===t?Je.createElement(an,e):Je.createElement(bn,e):Je.createElement(wn,Sn({},e,{hasCollections:t}))}),(function(e,t){return"loading"===t.state.status||"stalled"===t.state.status}));function jn(){return(jn=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["_highlightResult","_snippetResult"])),l=i.findIndex((function(e){return e.objectID===n.objectID}));l>-1&&i.splice(l,1),i.unshift(n),i=i.slice(0,r),o.setItem(i)},remove:function(e){i=i.filter((function(t){return t.objectID!==e.objectID})),o.setItem(i)},getAll:function(){return i}}}function Cn(e){var t,n="algoliasearch-client-js-".concat(e.key),r=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},o=function(){return JSON.parse(r().getItem(n)||"{}")};return{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var n=JSON.stringify(e),r=o()[n];return Promise.all([r||t(),void 0!==r])})).then((function(e){var t=u(e,2),r=t[0],o=t[1];return Promise.all([r,o||n.miss(r)])})).then((function(e){return u(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var i=o();return i[JSON.stringify(e)]=t,r().setItem(n,JSON.stringify(i)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=o();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){r().removeItem(n)}))}}}function In(e){var t=f(e.caches),n=t.shift();return void 0===n?{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},r=t();return r.then((function(e){return Promise.all([e,n.miss(e)])})).then((function(e){return u(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,o).catch((function(){return In({caches:t}).get(e,r,o)}))},set:function(e,r){return n.set(e,r).catch((function(){return In({caches:t}).set(e,r)}))},delete:function(e){return n.delete(e).catch((function(){return In({caches:t}).delete(e)}))},clear:function(){return n.clear().catch((function(){return In({caches:t}).clear()}))}}}function xn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},i=JSON.stringify(n);if(i in t)return Promise.resolve(e.serializable?JSON.parse(t[i]):t[i]);var l=r(),c=o&&o.miss||function(){return Promise.resolve()};return l.then((function(e){return c(e)})).then((function(){return l}))},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function An(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function Dn(e,t){return t?(Object.keys(t).forEach((function(n){e[n]=t[n](e)})),e):e}function Nn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}var Rn={Read:1,Write:2,Any:3};function Ln(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return s(s({},e),{},{status:t,lastUpdate:Date.now()})}function Fn(e){return"string"==typeof e?{protocol:"https",url:e,accept:Rn.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||Rn.Any}}var Mn="POST";function Hn(e,t,n,r){var o=[],i=function(e,t){if("GET"!==e.method&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:s(s({},e.data),t.data);return JSON.stringify(n)}}(n,r),l=function(e,t){var n=s(s({},e.headers),t.headers),r={};return Object.keys(n).forEach((function(e){var t=n[e];r[e.toLowerCase()]=t})),r}(e,r),c=n.method,a="GET"!==n.method?{}:s(s({},n.data),r.data),u=s(s(s({"x-algolia-agent":e.userAgent.value},e.queryParameters),a),r.queryParameters),p=0,d=function t(a,s){var f=a.pop();if(void 0===f)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:$n(o)};var d={data:i,headers:l,method:c,url:zn(f,n.path,u),connectTimeout:s(p,e.timeouts.connect),responseTimeout:s(p,r.timeout)},h=function(e){var t={request:d,response:e,host:f,triesLeft:a.length};return o.push(t),t},m={onSucess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var r=h(n);return n.isTimedOut&&p++,Promise.all([e.logger.info("Retryable failure",Bn(r)),e.hostsCache.set(f,Ln(f,n.isTimedOut?3:2))]).then((function(){return t(a,s)}))},onFail:function(e){throw h(e),function(e,t){var n=e.content,r=e.status,o=n;try{o=JSON.parse(n).message}catch(e){}return function(e,t,n){return{name:"ApiError",message:e,status:t,transporterStackTrace:n}}(o,r,t)}(e,$n(o))}};return e.requester.send(d).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,n=e.status;return!t&&0==~~n}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSucess(e):t.onFail(e)}(e,m)}))};return function(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(Ln(t))}))}))).then((function(e){var n=e.filter((function(e){return function(e){return 1===e.status||Date.now()-e.lastUpdate>12e4}(e)})),r=e.filter((function(e){return function(e){return 3===e.status&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(f(n),f(r));return{getTimeout:function(e,t){return(0===r.length&&0===e?1:r.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return Fn(e)})):t}}))}(e.hostsCache,t).then((function(e){return d(f(e.statelessHosts).reverse(),e.getTimeout)}))}function Un(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}function zn(e,t,n){var r=qn(n),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return r.length&&(o+="?".concat(r)),o}function qn(e){return Object.keys(e).map((function(t){return Nn("%s=%s",t,(n=e[t],"[object Object]"===Object.prototype.toString.call(n)||"[object Array]"===Object.prototype.toString.call(n)?JSON.stringify(e[t]):e[t]));var n})).join("&")}function $n(e){return e.map((function(e){return Bn(e)}))}function Bn(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return s(s({},e),{},{request:s(s({},e.request),{},{headers:s(s({},e.request.headers),t)})})}var Vn=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={transporter:e.transporter,appId:e.appId,indexName:t};return Dn(r,n.methods)}},Jn=function(e){return function(t,n){var r=t.map((function(e){return s(s({},e),{},{params:qn(e.params||{})})}));return e.transporter.read({method:Mn,path:"1/indexes/*/queries",data:{requests:r},cacheable:!0},n)}},Wn=function(e){return function(t,n){return Promise.all(t.map((function(t){var r=t.params,o=r.facetName,i=r.facetQuery,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(r,["facetName","facetQuery"]);return Vn(e)(t.indexName,{methods:{searchForFacetValues:Yn}}).searchForFacetValues(o,i,s(s({},n),l))})))}},Kn=function(e){return function(t,n,r){return e.transporter.read({method:Mn,path:Nn("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:n},cacheable:!0},r)}},Gn=function(e){return function(t,n){return e.transporter.read({method:Mn,path:Nn("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},n)}},Yn=function(e){return function(t,n,r){return e.transporter.read({method:Mn,path:Nn("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:n},cacheable:!0},r)}};function Zn(e,t,n){var r={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return n.setRequestHeader(t,e.headers[t])}));var r,o=function(e,r){return setTimeout((function(){n.abort(),t({status:0,content:r,isTimedOut:!0})}),1e3*e)},i=o(e.connectTimeout,"Connection timeout");n.onreadystatechange=function(){n.readyState>n.OPENED&&void 0===r&&(clearTimeout(i),r=o(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(i),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(i),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)}))}},logger:{debug:function(e,t){return Promise.resolve()},info:function(e,t){return Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}},responsesCache:xn(),requestsCache:xn({serializable:!1}),hostsCache:In({caches:[Cn({key:"".concat("4.8.5","-").concat(e)}),xn()]}),userAgent:Un("4.8.5").add({segment:"Browser",version:"lite"}),authMode:0};return function(e){var t=e.appId,n=function(e,t,n){var r={"x-algolia-api-key":n,"x-algolia-application-id":t};return{headers:function(){return 1===e?r:{}},queryParameters:function(){return 0===e?r:{}}}}(void 0!==e.authMode?e.authMode:1,t,e.apiKey),r=function(e){var t=e.hostsCache,n=e.logger,r=e.requester,o=e.requestsCache,i=e.responsesCache,l=e.timeouts,c=e.userAgent,a=e.hosts,s=e.queryParameters,f={hostsCache:t,logger:n,requester:r,requestsCache:o,responsesCache:i,timeouts:l,userAgent:c,headers:e.headers,queryParameters:s,hosts:a.map((function(e){return Fn(e)})),read:function(e,t){var n=Tn(t,f.timeouts.read),r=function(){return Hn(f,f.hosts.filter((function(e){return 0!=(e.accept&Rn.Read)})),e,n)};if(!0!==(void 0!==n.cacheable?n.cacheable:e.cacheable))return r();var o={request:e,mappedRequestOptions:n,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(o,(function(){return f.requestsCache.get(o,(function(){return f.requestsCache.set(o,r()).then((function(e){return Promise.all([f.requestsCache.delete(o),e])}),(function(e){return Promise.all([f.requestsCache.delete(o),Promise.reject(e)])})).then((function(e){var t=u(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(o,e)}})},write:function(e,t){return Hn(f,f.hosts.filter((function(e){return 0!=(e.accept&Rn.Write)})),e,Tn(t,f.timeouts.write))}};return f}(s(s({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:Rn.Read},{url:"".concat(t,".algolia.net"),accept:Rn.Write}].concat(An([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:s(s(s({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:s(s({},n.queryParameters()),e.queryParameters)}));return Dn({transporter:r,appId:t,addAlgoliaAgent:function(e,t){r.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([r.requestsCache.clear(),r.responsesCache.clear()]).then((function(){}))}},e.methods)}(s(s(s({},r),n),{},{methods:{search:Jn,searchForFacetValues:Wn,multipleQueries:Jn,multipleSearchForFacetValues:Wn,initIndex:function(e){return function(t){return Vn(e)(t,{methods:{search:Gn,searchForFacetValues:Yn,findAnswers:Kn}})}}}}))}function Xn(e,t){return e.reduce((function(e,n){var r=t(n);return e.hasOwnProperty(r)||(e[r]=[]),e[r].length<5&&e[r].push(n),e}),{})}function Qn(e){return e}function er(){}function tr(){return(tr=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n",highlightPostTag:"",hitsPerPage:20},c)}]}).catch((function(e){throw"RetryError"===e.name&&i("error"),e})).then((function(e){var t=e[0].hits,o=e[0].nbHits,i=Xn(t,(function(e){return e.hierarchy.lvl0}));return n.context.searchSuggestions.length0&&($(),D.current&&D.current.focus())}),[R,$]),Je.useEffect((function(){function e(){if(I.current){var e=.01*window.innerHeight;I.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),Je.createElement("div",tr({ref:C},q({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===P.status&&"DocSearch-Container--Stalled","error"===P.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),onMouseDown:function(e){e.target===e.currentTarget&&s()}}),Je.createElement("div",{className:"DocSearch-Modal",ref:I},Je.createElement("header",{className:"DocSearch-SearchBar",ref:x},Je.createElement(Pn,tr({},U,{state:P,autoFocus:0===R.length,onClose:s,inputRef:D,isFromSelection:Boolean(R)&&R===T}))),Je.createElement("div",{className:"DocSearch-Dropdown",ref:A},Je.createElement(En,tr({},U,{indexName:o,state:P,hitComponent:d,resultsFooterComponent:m,disableUserPersonalization:w,recentSearches:M,favoriteSearches:F,onItemClick:function(e){H(e),s()},inputRef:D}))),Je.createElement("footer",{className:"DocSearch-Footer"},Je.createElement(Vt,null))))}function cr(){return(cr=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?wr(d.type,d.props,d.key,d.ref?d.ref:null,d.__v):d)){if(d.__=n,d.__b=n.__b+1,null===(p=y[u])||p&&d.key==p.key&&d.type===p.type)y[u]=void 0;else for(f=0;f<_;f++){if((p=y[f])&&d.key==p.key&&d.type===p.type){y[f]=void 0;break}p=null}Lr(e,d,p=p||yr,o,i,l,c,a,s),h=d.__e,(f=d.ref)&&p.ref!=f&&(v||(v=[]),p.ref&&v.push(p.ref,null,d),v.push(f,d.__c||h,d)),null!=h?(null==m&&(m=h),"function"==typeof d.type&&d.__k===p.__k?d.__d=a=xr(d,a,e):a=Ar(e,d,p,y,h,a),"function"==typeof n.type&&(n.__d=a)):a&&p.__e==a&&a.parentNode!=e&&(a=jr(p))}for(n.__e=m,u=_;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=jr(r,u+1)),Hr(y[u],y[u]));if(v)for(u=0;u{const e=(0,zr.tv)(),t=(0,r.WF)();return{transformItems:e=>e.map((e=>({...e,url:(0,vr.rl)(e.url,t.value.base)}))),hitComponent:({hit:t,children:n})=>function(e,t,n){var r,o,i,l={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?fr.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===l[i]&&(l[i]=e.defaultProps[i]);return wr(e,l,r,o,null)}("a",{href:t.url,onClick:n=>{(e=>1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)(n)||(n.preventDefault(),e.push(t.url))}},n),navigator:{navigate:({itemUrl:t})=>{e.push(t)}}}})(),l=(0,o.Fl)((()=>{var n;return{...e.options,...null===(n=e.options.locales)||void 0===n?void 0:n[t.value]}})),a=[],s=()=>{var e,t;a.splice(0,a.length,`lang:${n.value}`,...null!==(t=null===(e=l.value.searchParameters)||void 0===e?void 0:e.facetFilters)&&void 0!==t?t:[]),function(e){Re(Je.createElement(ur,c({},e,{transformSearchClient:function(t){return t.addAlgoliaAgent("docsearch.js","3.0.0-alpha.34"),e.transformSearchClient?e.transformSearchClient(t):t}})),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return"string"==typeof e?t.document.querySelector(e):e}(e.container,e.environment))}({...i,...l.value,container:"#docsearch-container",searchParameters:{...l.value.searchParameters,facetFilters:a}})};return(0,o.bv)((()=>{s(),(0,o.YP)([t,l],(([e,t],[n,r])=>{e!==n&&JSON.stringify(t)!==JSON.stringify(r)&&s()})),(0,o.YP)(n,((e,t)=>{if(e!==t){const n=a.findIndex((e=>e===`lang:${t}`));n>-1&&a.splice(n,1,`lang:${e}`)}}))})),()=>(0,o.h)("div",{id:"docsearch-container"})}}),$r={appId:"4ZF3BCJTP5",apiKey:"09ff75bbe16bc6e166e103ffb57e10ea",indexName:"fesjs",locales:{"/":{placeholder:"搜索文档"}}},Br=(0,r.vW)((({app:e})=>{e.component("Docsearch",(()=>(0,o.h)(qr,{options:$r})))}))},6971:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(7621),o=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r=window.Promise||function(e){function t(){}e(t,t)},i=function(e){var t=e.target;t!==D?-1!==P.indexOf(t)&&w({target:t}):O()},p=function(){if(!C&&A.original){var e=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(I-e)>x.scrollOffset&&setTimeout(O,150)}},d=function(e){var t=e.key||e.keyCode;"Escape"!==t&&"Esc"!==t&&27!==t||O()},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e;if(e.background&&(D.style.background=e.background),e.container&&e.container instanceof Object&&(t.container=o({},x.container,e.container)),e.template){var n=l(e.template)?e.template:document.querySelector(e.template);t.template=n}return x=o({},x,t),P.forEach((function(e){e.dispatchEvent(f("medium-zoom:update",{detail:{zoom:N}}))})),N},m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e(o({},x,t))},v=function(){for(var e=arguments.length,t=Array(e),n=0;n0?t.reduce((function(e,t){return[].concat(e,a(t))}),[]):P;return r.forEach((function(e){e.classList.remove("medium-zoom-image"),e.dispatchEvent(f("medium-zoom:detach",{detail:{zoom:N}}))})),P=P.filter((function(e){return-1===r.indexOf(e)})),N},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P.forEach((function(r){r.addEventListener("medium-zoom:"+e,t,n)})),k.push({type:"medium-zoom:"+e,listener:t,options:n}),N},g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P.forEach((function(r){r.removeEventListener("medium-zoom:"+e,t,n)})),k=k.filter((function(n){return!(n.type==="medium-zoom:"+e&&n.listener.toString()===t.toString())})),N},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=function(){var e={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},t=void 0,n=void 0;if(x.container)if(x.container instanceof Object)t=(e=o({},e,x.container)).width-e.left-e.right-2*x.margin,n=e.height-e.top-e.bottom-2*x.margin;else{var r=(l(x.container)?x.container:document.querySelector(x.container)).getBoundingClientRect(),i=r.width,a=r.height,s=r.left,u=r.top;e=o({},e,{width:i,height:a,left:s,top:u})}t=t||e.width-2*x.margin,n=n||e.height-2*x.margin;var f=A.zoomedHd||A.original,p=c(f)?t:f.naturalWidth||t,d=c(f)?n:f.naturalHeight||n,h=f.getBoundingClientRect(),m=h.top,v=h.left,y=h.width,_=h.height,g=Math.min(p,t)/y,b=Math.min(d,n)/_,O=Math.min(g,b),w="scale("+O+") translate3d("+((t-y)/2-v+x.margin+e.left)/O+"px, "+((n-_)/2-m+x.margin+e.top)/O+"px, 0)";A.zoomed.style.transform=w,A.zoomedHd&&(A.zoomedHd.style.transform=w)};return new r((function(e){if(t&&-1===P.indexOf(t))e(N);else if(A.zoomed)e(N);else{if(t)A.original=t;else{if(!(P.length>0))return void e(N);var r=P;A.original=r[0]}if(A.original.dispatchEvent(f("medium-zoom:open",{detail:{zoom:N}})),I=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,C=!0,A.zoomed=u(A.original),document.body.appendChild(D),x.template){var o=l(x.template)?x.template:document.querySelector(x.template);A.template=document.createElement("div"),A.template.appendChild(o.content.cloneNode(!0)),document.body.appendChild(A.template)}if(document.body.appendChild(A.zoomed),window.requestAnimationFrame((function(){document.body.classList.add("medium-zoom--opened")})),A.original.classList.add("medium-zoom-image--hidden"),A.zoomed.classList.add("medium-zoom-image--opened"),A.zoomed.addEventListener("click",O),A.zoomed.addEventListener("transitionend",(function t(){C=!1,A.zoomed.removeEventListener("transitionend",t),A.original.dispatchEvent(f("medium-zoom:opened",{detail:{zoom:N}})),e(N)})),A.original.getAttribute("data-zoom-src")){A.zoomedHd=A.zoomed.cloneNode(),A.zoomedHd.removeAttribute("srcset"),A.zoomedHd.removeAttribute("sizes"),A.zoomedHd.src=A.zoomed.getAttribute("data-zoom-src"),A.zoomedHd.onerror=function(){clearInterval(i),console.warn("Unable to reach the zoom image target "+A.zoomedHd.src),A.zoomedHd=null,n()};var i=setInterval((function(){A.zoomedHd.complete&&(clearInterval(i),A.zoomedHd.classList.add("medium-zoom-image--opened"),A.zoomedHd.addEventListener("click",O),document.body.appendChild(A.zoomedHd),n())}),10)}else if(A.original.hasAttribute("srcset")){A.zoomedHd=A.zoomed.cloneNode(),A.zoomedHd.removeAttribute("sizes"),A.zoomedHd.removeAttribute("loading");var c=A.zoomedHd.addEventListener("load",(function(){A.zoomedHd.removeEventListener("load",c),A.zoomedHd.classList.add("medium-zoom-image--opened"),A.zoomedHd.addEventListener("click",O),document.body.appendChild(A.zoomedHd),n()}))}else n()}}))},O=function(){return new r((function(e){!C&&A.original?(C=!0,document.body.classList.remove("medium-zoom--opened"),A.zoomed.style.transform="",A.zoomedHd&&(A.zoomedHd.style.transform=""),A.template&&(A.template.style.transition="opacity 150ms",A.template.style.opacity=0),A.original.dispatchEvent(f("medium-zoom:close",{detail:{zoom:N}})),A.zoomed.addEventListener("transitionend",(function t(){A.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(A.zoomed),A.zoomedHd&&document.body.removeChild(A.zoomedHd),document.body.removeChild(D),A.zoomed.classList.remove("medium-zoom-image--opened"),A.template&&document.body.removeChild(A.template),C=!1,A.zoomed.removeEventListener("transitionend",t),A.original.dispatchEvent(f("medium-zoom:closed",{detail:{zoom:N}})),A.original=null,A.zoomed=null,A.zoomedHd=null,A.template=null,e(N)}))):e(N)}))},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target;return A.original?O():b({target:t})},S=function(){return x},E=function(){return P},j=function(){return A.original},P=[],k=[],C=!1,I=0,x=n,A={original:null,zoomed:null,zoomedHd:null,template:null};"[object Object]"===Object.prototype.toString.call(t)?x=t:(t||"string"==typeof t)&&v(t),x=o({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},x);var D=s(x.background);document.addEventListener("click",i),document.addEventListener("keyup",d),document.addEventListener("scroll",p),window.addEventListener("resize",O);var N={open:b,close:O,toggle:w,update:h,clone:m,attach:v,detach:y,on:_,off:g,getOptions:S,getImages:E,getZoomedImage:j};return N},d=Symbol("mediumZoom"),h={},m=(0,r.vW)((({app:e,router:t})=>{const n=p(h);n.refresh=(e=".theme-default-content > img, .theme-default-content :not(a) > img")=>{n.detach(),n.attach(e)},e.provide(d,n),t.afterEach((()=>{setTimeout((()=>n.refresh()),400)}))}))},6243:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(7621),o=n(4865),i=n(6252),l=n(2201);const c=(0,r.F2)((()=>{(0,i.bv)((()=>{const e=(0,l.tv)(),t=new Set;t.add(e.currentRoute.value.path),o.configure({showSpinner:!1}),e.beforeEach((e=>{t.has(e.path)||o.start()})),e.afterEach((e=>{t.add(e.path),o.done()}))}))}))},8341:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(6252),o=n(7621),i=n(743),l=n(2262),c=n(9963);const a=(0,r.aZ)({name:"PwaPopup",props:{locales:{type:Object,required:!1,default:()=>({})}},setup(e){const t=(0,i.f$)(),n=(0,o.I)(),a=(0,r.Fl)((()=>{var t;return null!==(t=e.locales[n.value])&&void 0!==t?t:{message:"New content is available.",buttonText:"Refresh"}})),s=(0,l.iH)(!1),u=(0,l.iH)(null),f=()=>{s.value=!1,u.value&&((0,i.NY)(u.value),location.reload(!0))};return t.on("updated",(e=>{e&&(u.value=e,s.value=!0)})),()=>(0,r.h)(c.uT,{name:"pwa-popup"},{default:()=>s.value?(0,r.h)("div",{class:"pwa-popup"},[a.value.message,(0,r.h)("br"),(0,r.h)("button",{onClick:f},a.value.buttonText)]):null})}}),s={"/":{message:"发现新内容可用",buttonText:"刷新"}},u=()=>(0,r.h)(a,{locales:s});u.displayName="PwaPopupWrapper";const f=u},4862:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(7621),o=n(6252),i=n(743);const l=(0,r.F2)((()=>{const e=(...e)=>console.log("[@vuepress/plugin-pwa]",...e),t={all:l=l||new Map,on:function(e,t){var n=l.get(e);n?n.push(t):l.set(e,[t])},off:function(e,t){var n=l.get(e);n&&(t?n.splice(n.indexOf(t)>>>0,1):l.set(e,[]))},emit:function(e,t){var n=l.get(e);n&&n.slice().map((function(e){e(t)})),(n=l.get("*"))&&n.slice().map((function(n){n(e,t)}))}};var l;(0,o.JJ)(i.Lg,t),(0,o.bv)((async()=>{const{register:o}=await n.e(205).then(n.bind(n,5205));o((0,r.pJ)("service-worker.js"),{ready(n){e("Service worker is active."),t.emit("ready",n)},registered(n){e("Service worker has been registered."),t.emit("registered",n)},cached(n){e("Content has been cached for offline use."),t.emit("cached",n)},updatefound(n){e("New content is downloading."),t.emit("updatefound",n)},updated(n){e("New content is available, please refresh."),t.emit("updated",n)},offline(){e("No internet connection found. App is running in offline mode."),t.emit("offline")},error(n){e("Error during service worker registration:",n),t.emit("error",n)}})}))}))},743:(e,t,n)=>{"use strict";n.d(t,{Lg:()=>o,f$:()=>i,NY:()=>l});var r=n(6252);const o=Symbol("pwaEvent"),i=()=>{const e=(0,r.f3)(o);if(!e)throw new Error("usePwaEvent() is called without provider.");return e},l=e=>{const t=e.waiting;if(!t)return;const n=new MessageChannel;t.postMessage({type:"SKIP_WAITING"},[n.port2])}},1598:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(7621),o=n(6252),i=n(3197);const l=(0,r.vW)((({app:e})=>{const t=(0,i.BV)(),n=e._context.provides[r.C3],l=(0,o.Fl)((()=>(0,i.g$)(t.value,n.value)));e.provide(i.ZS,l),Object.defineProperties(e.config.globalProperties,{$theme:{get:()=>t.value},$themeLocale:{get:()=>l.value}})}))},3197:(e,t,n)=>{"use strict";n.d(t,{g$:()=>s,ZS:()=>c,BV:()=>i,X6:()=>a});var r=n(2232);const o=(0,n(2262).iH)(r.f),i=()=>o;var l=n(6252);const c=Symbol(""),a=()=>{const e=(0,l.f3)(c);if(!e)throw new Error("useThemeLocaleData() is called without provider.");return e},s=(e,t)=>{var n;return{...e,...null===(n=e.locales)||void 0===n?void 0:n[t]}}},7788:(e,t,n)=>{"use strict";n.d(t,{H7:()=>o,kJ:()=>r.kJ,mf:()=>r.mf,ak:()=>i,B2:()=>l,R5:()=>c,PO:()=>a,HD:()=>r.HD,U1:()=>s,FY:()=>u,gb:()=>f,rl:()=>p});var r=n(3577);const o=e=>{const t=new Set,n=[];return e.forEach((e=>{const r=(([e,t,n])=>"meta"===e&&t.name?`${e}.${t.name}`:["title","base"].includes(e)?e:"template"===e&&t.id?`${e}.${t.id}`:JSON.stringify([e,t,n]))(e);t.has(r)||(t.add(r),n.push(e))})),n},i=e=>/^(https?:)?\/\//.test(e),l=e=>/^mailto:/.test(e),c=e=>/^tel:/.test(e),a=e=>"[object Object]"===Object.prototype.toString.call(e),s=e=>e.replace(/\/$/,""),u=e=>e.replace(/^\//,""),f=(e,t)=>{const n=Object.keys(e).sort(((e,t)=>{const n=t.split("/").length-e.split("/").length;return 0!==n?n:t.length-e.length}));for(const e of n)if(t.startsWith(e))return e;return"/"},p=(e,t="/")=>e.replace(/^(https?:)?\/\/[^/]*/,"").replace(new RegExp(`^${t}`),"/")},2009:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(7621),o=n(6252),i=n(3577);const l=(0,o.aZ)({__name:"Badge",props:{type:{type:String,required:!1,default:"tip"},text:{type:String,required:!1,default:""},vertical:{type:String,required:!1,default:void 0}},setup:e=>(t,n)=>((0,o.wg)(),(0,o.iD)("span",{class:(0,i.C_)(["badge",e.type]),style:(0,i.j5)({verticalAlign:e.vertical})},[(0,o.WI)(t.$slots,"default",{},(()=>[(0,o.Uk)((0,i.zw)(e.text),1)]))],6))});var c=n(2262);const a=(0,o.aZ)({name:"CodeGroup",setup(e,{slots:t}){const n=(0,c.iH)(-1),r=(0,c.iH)([]);return()=>{var e;const i=((null===(e=t.default)||void 0===e?void 0:e.call(t))||[]).filter((e=>"CodeGroupItem"===e.type.name)).map((e=>(null===e.props&&(e.props={}),e)));return 0===i.length?null:(n.value<0||n.value>i.length-1?(n.value=i.findIndex((e=>""===e.props.active||!0===e.props.active)),-1===n.value&&(n.value=0)):i.forEach(((e,t)=>{e.props.active=t===n.value})),(0,o.h)("div",{class:"code-group"},[(0,o.h)("div",{class:"code-group__nav"},(0,o.h)("ul",{class:"code-group__ul"},i.map(((e,t)=>{const i=t===n.value;return(0,o.h)("li",{class:"code-group__li"},(0,o.h)("button",{ref:e=>{e&&(r.value[t]=e)},class:{"code-group__nav-tab":!0,"code-group__nav-tab-active":i},ariaPressed:i,ariaExpanded:i,onClick:()=>n.value=t,onKeydown:e=>((e,t)=>{" "===e.key||"Enter"===e.key?(e.preventDefault(),n.value=t):"ArrowRight"===e.key?(e.preventDefault(),((e=n.value)=>{e{n.value=e>0?e-1:r.value.length-1,r.value[n.value].focus()})(t))})(e,t)},e.props.title))})))),i]))}}}),s=["aria-selected"],u=(0,o.aZ)({name:"CodeGroupItem"}),f=(0,o.aZ)({...u,props:{title:{type:String,required:!0},active:{type:Boolean,required:!1,default:!1}},setup:e=>(t,n)=>((0,o.wg)(),(0,o.iD)("div",{class:(0,i.C_)(["code-group-item",{"code-group-item__active":e.active}]),"aria-selected":e.active},[(0,o.WI)(t.$slots,"default")],10,s))});var p=n(5885);const d={class:"sr-only"},h=(0,o.aZ)({__name:"OutboundLink",setup(e){const t=(0,p.X6)();return(e,n)=>((0,o.wg)(),(0,o.j4)((0,c.SU)(r.MS),null,{default:(0,o.w5)((()=>[(0,o._)("span",d,(0,i.zw)((0,c.SU)(t).openInNewWindow),1)])),_:1}))}}),m=(0,r.vW)((({app:e,router:t})=>{e.component("Badge",l),e.component("CodeGroup",a),e.component("CodeGroupItem",f),delete e._context.components.OutboundLink,e.component("OutboundLink",h),e.component("NavbarSearch",(()=>{const t=e.component("Docsearch")||e.component("SearchBox");return t?(0,o.h)(t):null}));const n=t.options.scrollBehavior;t.options.scrollBehavior=async(...e)=>(await(0,p.P$)().wait(),n(...e))}))},8866:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(7621),o=n(5885);const i=(0,r.F2)((()=>{(0,o.OX)(),(0,o.fR)()}))},5885:(e,t,n)=>{"use strict";n.d(t,{OX:()=>C,fR:()=>z,vs:()=>k,sC:()=>N,P$:()=>F,VU:()=>U,X6:()=>K});var r=n(2262),o=n(6252);function i(e){return!!(0,r.nZ)()&&((0,r.EB)(e),!0)}const l="undefined"!=typeof window,c=(Object.prototype.toString,()=>{});const a=e=>e();var s=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const p=l?window:void 0;l&&window.document,l&&window.navigator,l&&window.location,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h="__vueuse_ssr_handlers__";d[h]=d[h]||{};const m=d[h];const v={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))}};function y(e,t,n,l={}){var d;const{flush:h="pre",deep:y=!0,listenToStorageChanges:_=!0,writeDefaults:g=!0,shallow:b,window:O=p,eventFilter:w,onError:S=(e=>{console.error(e)})}=l,E=(0,r.SU)(t),j=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}(E),P=(b?r.XI:r.iH)(t),k=null!=(d=l.serializer)?d:v[j];if(!n)try{n=function(e,t){return m[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=p)?void 0:e.localStorage}))()}catch(e){S(e)}function C(t){if(n&&(!t||t.key===e))try{const r=t?t.newValue:n.getItem(e);null==r?(P.value=E,g&&null!==E&&n.setItem(e,k.write(E))):P.value="string"!=typeof r?r:k.read(r)}catch(e){S(e)}}return C(),O&&_&&function(...e){let t,n,l,a;if("string"==typeof e[0]?([n,l,a]=e,t=p):[t,n,l,a]=e,!t)return c;let s=c;const u=(0,o.YP)((()=>(0,r.SU)(t)),(e=>{s(),e&&(e.addEventListener(n,l,a),s=()=>{e.removeEventListener(n,l,a),s=c})}),{immediate:!0,flush:"post"}),f=()=>{u(),s()};i(f)}(O,"storage",(e=>setTimeout((()=>C(e)),0))),n&&function(e,t,n={}){const r=n,{eventFilter:i=a}=r,l=((e,t)=>{var n={};for(var r in e)u.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&s)for(var r of s(e))t.indexOf(r)<0&&f.call(e,r)&&(n[r]=e[r]);return n})(r,["eventFilter"]);return(0,o.YP)(e,(c=i,p=t,function(...e){c((()=>p.apply(this,e)),{fn:p,thisArg:this,args:e})}),l);var c,p}(P,(()=>{try{null==P.value?n.removeItem(e):n.setItem(e,k.write(P.value))}catch(e){S(e)}}),{flush:h,deep:y,eventFilter:w}),P}function _(e){return function(e,t={}){const{window:n=p}=t;let l;const c=(0,r.iH)(!1),a=()=>{n&&(l||(l=n.matchMedia(e)),c.value=l.matches)};return function(e,t=!0){(0,o.FN)()?(0,o.bv)(e):t?e():(0,o.Y3)(e)}((()=>{a(),l&&("addEventListener"in l?l.addEventListener("change",a):l.addListener(a),i((()=>{"removeEventListener"in a?l.removeEventListener("change",a):l.removeListener(a)})))})),c}("(prefers-color-scheme: dark)",e)}var g,b;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,l&&(null==window?void 0:window.navigator)&&(null==(g=null==window?void 0:window.navigator)?void 0:g.platform)&&/iP(ad|hone|od)/.test(null==(b=null==window?void 0:window.navigator)?void 0:b.platform),Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var O=Object.defineProperty,w=(Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols),S=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,j=(e,t,n)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;((e,t)=>{for(var n in t||(t={}))S.call(t,n)&&j(e,n,t[n]);if(w)for(var n of w(t))E.call(t,n)&&j(e,n,t[n])})({text:""},{top:0,left:0,bottom:0,right:0,height:0,width:0}),Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const P=Symbol(""),k=()=>{const e=(0,o.f3)(P);if(!e)throw new Error("useDarkMode() is called without provider.");return e},C=()=>{const e=K(),t=_(),n=y("vuepress-color-scheme","auto"),r=(0,o.Fl)({get:()=>!!e.value.darkMode&&("auto"===n.value?t.value:"dark"===n.value),set(e){e===t.value?n.value="auto":n.value=e?"dark":"light"}});(0,o.JJ)(P,r),I(r)},I=e=>{const t=(t=e.value)=>{const n=null===window||void 0===window?void 0:window.document.querySelector("html");null==n||n.classList.toggle("dark",t)};(0,o.bv)((()=>{(0,o.YP)(e,t,{immediate:!0})})),(0,o.Ah)((()=>t()))};var x=n(7788),A=n(2201);const D=(...e)=>{const t=(0,A.tv)().resolve(...e),n=t.matched[t.matched.length-1];if(!(null==n?void 0:n.redirect))return t;const{redirect:r}=n,o=(0,x.mf)(r)?r(t):r,i=(0,x.HD)(o)?{path:o}:o;return D({hash:t.hash,query:t.query,params:t.params,...i})},N=e=>{const t=D(e);return{text:t.meta.title||e,link:"404"===t.name?e:t.fullPath}};let T=null,R=null;const L={wait:()=>T,pending:()=>{T=new Promise((e=>R=e))},resolve:()=>{null==R||R(),T=null,R=null}},F=()=>L;var M=n(7621);const H=Symbol("sidebarItems"),U=()=>{const e=(0,o.f3)(H);if(!e)throw new Error("useSidebarItems() is called without provider.");return e},z=()=>{const e=K(),t=(0,M.I2)(),n=(0,o.Fl)((()=>q(t.value,e.value)));(0,o.JJ)(H,n)},q=(e,t)=>{var n,r,o,i;const l=null!==(r=null!==(n=e.sidebar)&&void 0!==n?n:t.sidebar)&&void 0!==r?r:"auto",c=null!==(i=null!==(o=e.sidebarDepth)&&void 0!==o?o:t.sidebarDepth)&&void 0!==i?i:2;return e.home||!1===l?[]:"auto"===l?B(c):(0,x.kJ)(l)?V(l,c):(0,x.PO)(l)?J(l,c):[]},$=(e,t)=>t>0?e.map((e=>((e,t)=>({text:e.title,link:`#${e.slug}`,children:$(e.children,t)}))(e,t-1))):[],B=e=>{const t=(0,M.Vi)();return[{text:t.value.title,children:$(t.value.headers,e)}]},V=(e,t)=>{const n=(0,A.yj)(),r=(0,M.Vi)(),o=e=>{var i;let l;if(l=(0,x.HD)(e)?N(e):e,l.children)return{...l,children:l.children.map((e=>o(e)))};if(l.link===n.path){const e=1===(null===(i=r.value.headers[0])||void 0===i?void 0:i.level)?r.value.headers[0].children:r.value.headers;return{...l,children:$(e,t)}}return l};return e.map((e=>o(e)))},J=(e,t)=>{var n;const r=(0,A.yj)(),o=null!==(n=e[(0,x.gb)(e,r.path)])&&void 0!==n?n:[];return V(o,t)};var W=n(3197);const K=()=>(0,W.X6)()},4865:function(e,t,n){var r,o;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function o(e,t,n){return en?n:e}function i(e){return 100*(-1+e)}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,r.minimum,1),n.status=1===e?null:e;var a=n.render(!t),s=a.querySelector(r.barSelector),u=r.speed,f=r.easing;return a.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),c(s,function(e,t,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+i(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+i(e)+"%,0)"}:{"margin-left":i(e)+"%"}).transition="all "+t+"ms "+n,o}(e,u,f)),1===e?(c(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout((function(){c(a,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");s(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var o,l=t.querySelector(r.barSelector),a=e?"-100":i(n.status||0),u=document.querySelector(r.parent);return c(l,{transition:"all 0 linear",transform:"translate3d("+a+"%,0,0)"}),r.showSpinner||(o=t.querySelector(r.spinnerSelector))&&p(o),u!=document.body&&s(u,"nprogress-custom-parent"),u.appendChild(t),t},n.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),c=function(){var e=["Webkit","O","Moz","ms"],t={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()})),t[n]||(t[n]=function(t){var n=document.body.style;if(t in n)return t;for(var r,o=e.length,i=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((r=e[o]+i)in n)return r;return t}(n))}function r(e,t,r){t=n(t),e.style[t]=r}return function(e,t){var n,o,i=arguments;if(2==i.length)for(n in t)void 0!==(o=t[n])&&t.hasOwnProperty(n)&&r(e,n,o);else r(e,i[1],i[2])}}();function a(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function s(e,t){var n=f(e),r=n+t;a(n,t)||(e.className=r.substring(1))}function u(e,t){var n,r=f(e);a(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(o=r.call(t,n,t,e))||(e.exports=o)},2938:(e,t,n)=>{"use strict";function r(e,t,n){var r,o,i;void 0===t&&(t=50),void 0===n&&(n={});var l=null!=(r=n.isImmediate)&&r,c=null!=(o=n.callback)&&o,a=n.maxWait,s=Date.now(),u=[];function f(){if(void 0!==a){var e=Date.now()-s;if(e+t>=a)return a-e}return t}var p=function(){var t=[].slice.call(arguments),n=this;return new Promise((function(r,o){var a=l&&void 0===i;if(void 0!==i&&clearTimeout(i),i=setTimeout((function(){if(i=void 0,s=Date.now(),!l){var r=e.apply(n,t);c&&c(r),u.forEach((function(e){return(0,e.resolve)(r)})),u=[]}}),f()),a){var p=e.apply(n,t);return c&&c(p),r(p)}u.push({resolve:r,reject:o})}))};return p.cancel=function(e){void 0!==i&&clearTimeout(i),u.forEach((function(t){return(0,t.reject)(e)})),u=[]},p}n.d(t,{D:()=>r})},2201:(e,t,n)=>{"use strict";n.d(t,{AJ:()=>I,MA:()=>Ie,PO:()=>k,p7:()=>xe,tv:()=>De,yj:()=>Ne});var r=n(6252),o=n(2262);const i="undefined"!=typeof window;const l=Object.assign;function c(e,t){const n={};for(const r in t){const o=t[r];n[r]=s(o)?o.map(e):e(o)}return n}const a=()=>{},s=Array.isArray,u=/\/$/;function f(e,t,n="/"){let r,o={},i="",l="";const c=t.indexOf("#");let a=t.indexOf("?");return c=0&&(a=-1),a>-1&&(r=t.slice(0,a),i=t.slice(a+1,c>-1?c:t.length),o=e(i)),c>-1&&(r=r||t.slice(0,c),l=t.slice(c,t.length)),r=function(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let o,i,l=n.length-1;for(o=0;o1&&l--}return n.slice(0,l).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}(null!=r?r:t,n),{fullPath:r+(i&&"?")+i+l,path:r,query:o,hash:l}}function p(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function d(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function h(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!m(e[n],t[n]))return!1;return!0}function m(e,t){return s(e)?v(e,t):s(t)?v(t,e):e===t}function v(e,t){return s(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}var y,_;!function(e){e.pop="pop",e.push="push"}(y||(y={})),function(e){e.back="back",e.forward="forward",e.unknown=""}(_||(_={}));const g=/^[^#]+#/;function b(e,t){return e.replace(g,"#")+t}const O=()=>({left:window.pageXOffset,top:window.pageYOffset});function w(e,t){return(history.state?history.state.position-t:-1)+e}const S=new Map;let E=()=>location.protocol+"//"+location.host;function j(e,t){const{pathname:n,search:r,hash:o}=t,i=e.indexOf("#");if(i>-1){let t=o.includes(e.slice(i))?e.slice(i).length:1,n=o.slice(t);return"/"!==n[0]&&(n="/"+n),p(n,"")}return p(n,e)+r+o}function P(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?O():null}}function k(e){const t=function(e){const{history:t,location:n}=window,r={value:j(e,n)},o={value:t.state};function i(r,i,l){const c=e.indexOf("#"),a=c>-1?(n.host&&document.querySelector("base")?e:e.slice(c))+r:E()+e+r;try{t[l?"replaceState":"pushState"](i,"",a),o.value=i}catch(e){console.error(e),n[l?"replace":"assign"](a)}}return o.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:r,state:o,push:function(e,n){const c=l({},o.value,t.state,{forward:e,scroll:O()});i(c.current,c,!0),i(e,l({},P(r.value,e,null),{position:c.position+1},n),!1),r.value=e},replace:function(e,n){i(e,l({},t.state,P(o.value.back,e,o.value.forward,!0),n,{position:o.value.position}),!0),r.value=e}}}(e=function(e){if(!e)if(i){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),e.replace(u,"")}(e)),n=function(e,t,n,r){let o=[],i=[],c=null;const a=({state:i})=>{const l=j(e,location),a=n.value,s=t.value;let u=0;if(i){if(n.value=l,t.value=i,c&&c===a)return void(c=null);u=s?i.position-s.position:0}else r(l);o.forEach((e=>{e(n.value,a,{delta:u,type:y.pop,direction:u?u>0?_.forward:_.back:_.unknown})}))};function s(){const{history:e}=window;e.state&&e.replaceState(l({},e.state,{scroll:O()}),"")}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",s),{pauseListeners:function(){c=n.value},listen:function(e){o.push(e);const t=()=>{const t=o.indexOf(e);t>-1&&o.splice(t,1)};return i.push(t),t},destroy:function(){for(const e of i)e();i=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",s)}}}(e,t.state,t.location,t.replace),r=l({location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:b.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function C(e){return"string"==typeof e||"symbol"==typeof e}const I={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},x=Symbol("");var A;function D(e,t){return l(new Error,{type:e,[x]:!0},t)}function N(e,t){return e instanceof Error&&x in e&&(null==t||!!(e.type&t))}!function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"}(A||(A={}));const T="[^/]+?",R={sensitive:!1,strict:!1,start:!0,end:!0},L=/[.+*?^${}()[\]/\\]/g;function F(e,t){let n=0;for(;nt.length?1===t.length&&80===t[0]?1:-1:0}function M(e,t){let n=0;const r=e.score,o=t.score;for(;n0&&t[t.length-1]<0}const U={type:0,value:""},z=/[a-zA-Z0-9_]/;function q(e,t,n){const r=function(e,t){const n=l({},R,t),r=[];let o=n.start?"^":"";const i=[];for(const t of e){const e=t.length?[]:[90];n.strict&&!t.length&&(o+="/");for(let r=0;r1&&("*"===c||"+"===c)&&t(`A repeatable param (${s}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:s,regexp:u,repeatable:"*"===c||"+"===c,optional:"*"===c||"?"===c})):t("Invalid state to consume buffer"),s="")}function p(){s+=c}for(;al(e,t.meta)),{})}function W(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function K(e,t){return t.children.some((t=>t===e||K(e,t)))}const G=/#/g,Y=/&/g,Z=/\//g,X=/=/g,Q=/\?/g,ee=/\+/g,te=/%5B/g,ne=/%5D/g,re=/%5E/g,oe=/%60/g,ie=/%7B/g,le=/%7C/g,ce=/%7D/g,ae=/%20/g;function se(e){return encodeURI(""+e).replace(le,"|").replace(te,"[").replace(ne,"]")}function ue(e){return se(e).replace(ee,"%2B").replace(ae,"+").replace(G,"%23").replace(Y,"%26").replace(oe,"`").replace(ie,"{").replace(ce,"}").replace(re,"^")}function fe(e){return null==e?"":function(e){return se(e).replace(G,"%23").replace(Q,"%3F")}(e).replace(Z,"%2F")}function pe(e){try{return decodeURIComponent(""+e)}catch(e){}return""+e}function de(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let e=0;ee&&ue(e))):[r&&ue(r)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))})):void 0!==r&&(t+=(t.length?"&":"")+n)}return t}function me(e){const t={};for(const n in e){const r=e[n];void 0!==r&&(t[n]=s(r)?r.map((e=>null==e?null:""+e)):null==r?r:""+r)}return t}const ve=Symbol(""),ye=Symbol(""),_e=Symbol(""),ge=Symbol(""),be=Symbol("");function Oe(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e,reset:function(){e=[]}}}function we(e,t,n,r,o){const i=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise(((l,c)=>{const a=e=>{var a;!1===e?c(D(4,{from:n,to:t})):e instanceof Error?c(e):"string"==typeof(a=e)||a&&"object"==typeof a?c(D(2,{from:t,to:e})):(i&&r.enterCallbacks[o]===i&&"function"==typeof e&&i.push(e),l())},s=e.call(r&&r.instances[o],t,n,a);let u=Promise.resolve(s);e.length<3&&(u=u.then(a)),u.catch((e=>c(e)))}))}function Se(e,t,n,r){const o=[];for(const l of e)for(const e in l.components){let c=l.components[e];if("beforeRouteEnter"===t||l.instances[e])if("object"==typeof(i=c)||"displayName"in i||"props"in i||"__vccOpts"in i){const i=(c.__vccOpts||c)[t];i&&o.push(we(i,n,r,l,e))}else{let i=c();o.push((()=>i.then((o=>{if(!o)return Promise.reject(new Error(`Couldn't resolve component "${e}" at "${l.path}"`));const i=(c=o).__esModule||"Module"===c[Symbol.toStringTag]?o.default:o;var c;l.components[e]=i;const a=(i.__vccOpts||i)[t];return a&&we(a,n,r,l,e)()}))))}}var i;return o}function Ee(e){const t=(0,r.f3)(_e),n=(0,r.f3)(ge),i=(0,r.Fl)((()=>t.resolve((0,o.SU)(e.to)))),l=(0,r.Fl)((()=>{const{matched:e}=i.value,{length:t}=e,r=e[t-1],o=n.matched;if(!r||!o.length)return-1;const l=o.findIndex(d.bind(null,r));if(l>-1)return l;const c=Pe(e[t-2]);return t>1&&Pe(r)===c&&o[o.length-1].path!==c?o.findIndex(d.bind(null,e[t-2])):l})),c=(0,r.Fl)((()=>l.value>-1&&function(e,t){for(const n in t){const r=t[n],o=e[n];if("string"==typeof r){if(r!==o)return!1}else if(!s(o)||o.length!==r.length||r.some(((e,t)=>e!==o[t])))return!1}return!0}(n.params,i.value.params))),u=(0,r.Fl)((()=>l.value>-1&&l.value===n.matched.length-1&&h(n.params,i.value.params)));return{route:i,href:(0,r.Fl)((()=>i.value.href)),isActive:c,isExactActive:u,navigate:function(n={}){return function(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||e.defaultPrevented||void 0!==e.button&&0!==e.button)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}(n)?t[(0,o.SU)(e.replace)?"replace":"push"]((0,o.SU)(e.to)).catch(a):Promise.resolve()}}}const je=(0,r.aZ)({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Ee,setup(e,{slots:t}){const n=(0,o.qj)(Ee(e)),{options:i}=(0,r.f3)(_e),l=(0,r.Fl)((()=>({[ke(e.activeClass,i.linkActiveClass,"router-link-active")]:n.isActive,[ke(e.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive})));return()=>{const o=t.default&&t.default(n);return e.custom?o:(0,r.h)("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:l.value},o)}}});function Pe(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const ke=(e,t,n)=>null!=e?e:null!=t?t:n;function Ce(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const Ie=(0,r.aZ)({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const i=(0,r.f3)(be),c=(0,r.Fl)((()=>e.route||i.value)),a=(0,r.f3)(ye,0),s=(0,r.Fl)((()=>{let e=(0,o.SU)(a);const{matched:t}=c.value;let n;for(;(n=t[e])&&!n.components;)e++;return e})),u=(0,r.Fl)((()=>c.value.matched[s.value]));(0,r.JJ)(ye,(0,r.Fl)((()=>s.value+1))),(0,r.JJ)(ve,u),(0,r.JJ)(be,c);const f=(0,o.iH)();return(0,r.YP)((()=>[f.value,u.value,e.name]),(([e,t,n],[r,o,i])=>{t&&(t.instances[n]=e,o&&o!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=o.leaveGuards),t.updateGuards.size||(t.updateGuards=o.updateGuards))),!e||!t||o&&d(t,o)&&r||(t.enterCallbacks[n]||[]).forEach((t=>t(e)))}),{flush:"post"}),()=>{const o=c.value,i=e.name,a=u.value,s=a&&a.components[i];if(!s)return Ce(n.default,{Component:s,route:o});const p=a.props[i],d=p?!0===p?o.params:"function"==typeof p?p(o):p:null,h=(0,r.h)(s,l({},d,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(a.instances[i]=null)},ref:f}));return Ce(n.default,{Component:h,route:o})||h}}});function xe(e){const t=function(e,t){const n=[],r=new Map;function o(e,n,r){const s=!r,u=function(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:B(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}(e);u.aliasOf=r&&r.record;const f=W(t,e),p=[u];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)p.push(l({},u,{components:r?r.record.components:u.components,path:e,aliasOf:r?r.record:u}))}let d,h;for(const t of p){const{path:l}=t;if(n&&"/"!==l[0]){const e=n.record.path,r="/"===e[e.length-1]?"":"/";t.path=n.record.path+(l&&r+l)}if(d=q(t,n,f),r?r.alias.push(d):(h=h||d,h!==d&&h.alias.push(d),s&&e.name&&!V(d)&&i(e.name)),u.children){const e=u.children;for(let t=0;t{i(h)}:a}function i(e){if(C(e)){const t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(i),t.alias.forEach(i))}else{const t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(i),e.alias.forEach(i))}}function c(e){let t=0;for(;t=0&&(e.record.path!==n[t].record.path||!K(e,n[t]));)t++;n.splice(t,0,e),e.record.name&&!V(e)&&r.set(e.record.name,e)}return t=W({strict:!1,end:!0,sensitive:!1},t),e.forEach((e=>o(e))),{addRoute:o,resolve:function(e,t){let o,i,c,a={};if("name"in e&&e.name){if(o=r.get(e.name),!o)throw D(1,{location:e});c=o.record.name,a=l($(t.params,o.keys.filter((e=>!e.optional)).map((e=>e.name))),e.params&&$(e.params,o.keys.map((e=>e.name)))),i=o.stringify(a)}else if("path"in e)i=e.path,o=n.find((e=>e.re.test(i))),o&&(a=o.parse(i),c=o.record.name);else{if(o=t.name?r.get(t.name):n.find((e=>e.re.test(t.path))),!o)throw D(1,{location:e,currentLocation:t});c=o.record.name,a=l({},t.params,e.params),i=o.stringify(a)}const s=[];let u=o;for(;u;)s.unshift(u.record),u=u.parent;return{name:c,path:i,params:a,matched:s,meta:J(s)}},removeRoute:i,getRoutes:function(){return n},getRecordMatcher:function(e){return r.get(e)}}}(e.routes,e),n=e.parseQuery||de,u=e.stringifyQuery||he,p=e.history,m=Oe(),v=Oe(),_=Oe(),g=(0,o.XI)(I);let b=I;i&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const E=c.bind(null,(e=>""+e)),j=c.bind(null,fe),P=c.bind(null,pe);function k(e,r){if(r=l({},r||g.value),"string"==typeof e){const o=f(n,e,r.path),i=t.resolve({path:o.path},r),c=p.createHref(o.fullPath);return l(o,i,{params:P(i.params),hash:pe(o.hash),redirectedFrom:void 0,href:c})}let o;if("path"in e)o=l({},e,{path:f(n,e.path,r.path).path});else{const t=l({},e.params);for(const e in t)null==t[e]&&delete t[e];o=l({},e,{params:j(e.params)}),r.params=j(r.params)}const i=t.resolve(o,r),c=e.hash||"";i.params=E(P(i.params));const a=function(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(u,l({},e,{hash:(s=c,se(s).replace(ie,"{").replace(ce,"}").replace(re,"^")),path:i.path}));var s;const d=p.createHref(a);return l({fullPath:a,hash:c,query:u===he?me(e.query):e.query||{}},i,{redirectedFrom:void 0,href:d})}function x(e){return"string"==typeof e?f(n,e,g.value.path):l({},e)}function A(e,t){if(b!==e)return D(8,{from:t,to:e})}function T(e){return L(e)}function R(e){const t=e.matched[e.matched.length-1];if(t&&t.redirect){const{redirect:n}=t;let r="function"==typeof n?n(e):n;return"string"==typeof r&&(r=r.includes("?")||r.includes("#")?r=x(r):{path:r},r.params={}),l({query:e.query,hash:e.hash,params:"path"in r?{}:e.params},r)}}function L(e,t){const n=b=k(e),r=g.value,o=e.state,i=e.force,c=!0===e.replace,a=R(n);if(a)return L(l(x(a),{state:"object"==typeof a?l({},o,a.state):o,force:i,replace:c}),t||n);const s=n;let f;return s.redirectedFrom=t,!i&&function(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&d(t.matched[r],n.matched[o])&&h(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(u,r,n)&&(f=D(16,{to:s,from:r}),te(r,r,!0,!1)),(f?Promise.resolve(f):H(s,r)).catch((e=>N(e)?N(e,2)?e:ee(e):Q(e,s,r))).then((e=>{if(e){if(N(e,2))return L(l({replace:c},x(e.to),{state:"object"==typeof e.to?l({},o,e.to.state):o,force:i}),t||s)}else e=z(s,r,!0,c,o);return U(s,r,e),e}))}function F(e,t){const n=A(e,t);return n?Promise.reject(n):Promise.resolve()}function H(e,t){let n;const[r,o,i]=function(e,t){const n=[],r=[],o=[],i=Math.max(t.matched.length,e.matched.length);for(let l=0;ld(e,i)))?r.push(i):n.push(i));const c=e.matched[l];c&&(t.matched.find((e=>d(e,c)))||o.push(c))}return[n,r,o]}(e,t);n=Se(r.reverse(),"beforeRouteLeave",e,t);for(const o of r)o.leaveGuards.forEach((r=>{n.push(we(r,e,t))}));const l=F.bind(null,e,t);return n.push(l),Ae(n).then((()=>{n=[];for(const r of m.list())n.push(we(r,e,t));return n.push(l),Ae(n)})).then((()=>{n=Se(o,"beforeRouteUpdate",e,t);for(const r of o)r.updateGuards.forEach((r=>{n.push(we(r,e,t))}));return n.push(l),Ae(n)})).then((()=>{n=[];for(const r of e.matched)if(r.beforeEnter&&!t.matched.includes(r))if(s(r.beforeEnter))for(const o of r.beforeEnter)n.push(we(o,e,t));else n.push(we(r.beforeEnter,e,t));return n.push(l),Ae(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=Se(i,"beforeRouteEnter",e,t),n.push(l),Ae(n)))).then((()=>{n=[];for(const r of v.list())n.push(we(r,e,t));return n.push(l),Ae(n)})).catch((e=>N(e,8)?e:Promise.reject(e)))}function U(e,t,n){for(const r of _.list())r(e,t,n)}function z(e,t,n,r,o){const c=A(e,t);if(c)return c;const a=t===I,s=i?history.state:{};n&&(r||a?p.replace(e.fullPath,l({scroll:a&&s&&s.scroll},o)):p.push(e.fullPath,o)),g.value=e,te(e,t,n,a),ee()}let G;let Y,Z=Oe(),X=Oe();function Q(e,t,n){ee(e);const r=X.list();return r.length?r.forEach((r=>r(e,t,n))):console.error(e),Promise.reject(e)}function ee(e){return Y||(Y=!e,G||(G=p.listen(((e,t,n)=>{if(!ae.listening)return;const r=k(e),o=R(r);if(o)return void L(l(o,{replace:!0}),r).catch(a);b=r;const c=g.value;var s,u;i&&(s=w(c.fullPath,n.delta),u=O(),S.set(s,u)),H(r,c).catch((e=>N(e,12)?e:N(e,2)?(L(e.to,r).then((e=>{N(e,20)&&!n.delta&&n.type===y.pop&&p.go(-1,!1)})).catch(a),Promise.reject()):(n.delta&&p.go(-n.delta,!1),Q(e,r,c)))).then((e=>{(e=e||z(r,c,!1))&&(n.delta&&!N(e,8)?p.go(-n.delta,!1):n.type===y.pop&&N(e,20)&&p.go(-1,!1)),U(r,c,e)})).catch(a)}))),Z.list().forEach((([t,n])=>e?n(e):t())),Z.reset()),e}function te(t,n,o,l){const{scrollBehavior:c}=e;if(!i||!c)return Promise.resolve();const a=!o&&function(e){const t=S.get(e);return S.delete(e),t}(w(t.fullPath,0))||(l||!o)&&history.state&&history.state.scroll||null;return(0,r.Y3)().then((()=>c(t,n,a))).then((e=>e&&function(e){let t;if("el"in e){const n=e.el,r="string"==typeof n&&n.startsWith("#"),o="string"==typeof n?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=function(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.pageXOffset,null!=t.top?t.top:window.pageYOffset)}(e))).catch((e=>Q(e,t,n)))}const ne=e=>p.go(e);let oe;const le=new Set,ae={currentRoute:g,listening:!0,addRoute:function(e,n){let r,o;return C(e)?(r=t.getRecordMatcher(e),o=n):o=e,t.addRoute(o,r)},removeRoute:function(e){const n=t.getRecordMatcher(e);n&&t.removeRoute(n)},hasRoute:function(e){return!!t.getRecordMatcher(e)},getRoutes:function(){return t.getRoutes().map((e=>e.record))},resolve:k,options:e,push:T,replace:function(e){return T(l(x(e),{replace:!0}))},go:ne,back:()=>ne(-1),forward:()=>ne(1),beforeEach:m.add,beforeResolve:v.add,afterEach:_.add,onError:X.add,isReady:function(){return Y&&g.value!==I?Promise.resolve():new Promise(((e,t)=>{Z.add([e,t])}))},install(e){e.component("RouterLink",je),e.component("RouterView",Ie),e.config.globalProperties.$router=this,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>(0,o.SU)(g)}),i&&!oe&&g.value===I&&(oe=!0,T(p.location).catch((e=>{})));const t={};for(const e in I)t[e]=(0,r.Fl)((()=>g.value[e]));e.provide(_e,this),e.provide(ge,(0,o.qj)(t)),e.provide(be,g);const n=e.unmount;le.add(e),e.unmount=function(){le.delete(e),le.size<1&&(b=I,G&&G(),G=null,g.value=I,oe=!1,Y=!1),n()}}};return ae}function Ae(e){return e.reduce(((e,t)=>e.then((()=>t()))),Promise.resolve())}function De(){return(0,r.f3)(_e)}function Ne(){return(0,r.f3)(ge)}}}]); \ No newline at end of file diff --git a/assets/js/491.94229b5b.js b/assets/js/491.d264dc1d.js similarity index 100% rename from assets/js/491.94229b5b.js rename to assets/js/491.d264dc1d.js diff --git a/assets/js/app.7d1580c9.js b/assets/js/app.d5bb65a0.js similarity index 81% rename from assets/js/app.7d1580c9.js rename to assets/js/app.d5bb65a0.js index 25edeb07..1c7249f0 100644 --- a/assets/js/app.7d1580c9.js +++ b/assets/js/app.d5bb65a0.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[143],{3131:(e,n,i)=>{i.d(n,{g:()=>c});var t=i(2009),d=i(6971),l=i(1598),r=i(6934);const c=[t.Z,d.Z,l.Z,r.Z]},9947:(e,n,i)=>{i.d(n,{p:()=>l});var t=i(3051),d=i(8341);const l=[t.Z,d.Z]},4611:(e,n,i)=>{i.d(n,{l:()=>c});var t=i(8866),d=i(1263),l=i(6243),r=i(4862);const c=[t.Z,d.Z,l.Z,r.Z]},4150:(e,n,i)=>{i.d(n,{Z:()=>d});var t=i(6252);const d={404:(0,t.RC)((()=>i.e(491).then(i.bind(i,8491)))),Layout:(0,t.RC)((()=>i.e(293).then(i.bind(i,3293))))}},6056:(e,n,i)=>{i.d(n,{b:()=>d});var t=i(6252);const d={"v-8daa1a0e":(0,t.RC)((()=>i.e(509).then(i.bind(i,8104)))),"v-fffb8e28":(0,t.RC)((()=>i.e(807).then(i.bind(i,5195)))),"v-85fa9b2a":(0,t.RC)((()=>i.e(445).then(i.bind(i,5942)))),"v-d7fa887a":(0,t.RC)((()=>i.e(617).then(i.bind(i,5938)))),"v-884fd4bc":(0,t.RC)((()=>i.e(229).then(i.bind(i,8568)))),"v-040800dc":(0,t.RC)((()=>i.e(256).then(i.bind(i,1842)))),"v-ef8c5e10":(0,t.RC)((()=>i.e(276).then(i.bind(i,3125)))),"v-37e1c06f":(0,t.RC)((()=>i.e(600).then(i.bind(i,4708)))),"v-fb0f0066":(0,t.RC)((()=>i.e(170).then(i.bind(i,2204)))),"v-528b8b6c":(0,t.RC)((()=>i.e(972).then(i.bind(i,2682)))),"v-00cf7e23":(0,t.RC)((()=>i.e(754).then(i.bind(i,5808)))),"v-1d14d5cc":(0,t.RC)((()=>i.e(507).then(i.bind(i,9959)))),"v-7b96e3a4":(0,t.RC)((()=>i.e(278).then(i.bind(i,6430)))),"v-6320961c":(0,t.RC)((()=>i.e(626).then(i.bind(i,7570)))),"v-3dba8814":(0,t.RC)((()=>i.e(448).then(i.bind(i,74)))),"v-7b48519a":(0,t.RC)((()=>i.e(938).then(i.bind(i,5213)))),"v-a1a49808":(0,t.RC)((()=>i.e(943).then(i.bind(i,3364)))),"v-a951be94":(0,t.RC)((()=>i.e(65).then(i.bind(i,1933)))),"v-76cd065c":(0,t.RC)((()=>i.e(476).then(i.bind(i,5930)))),"v-76cb52e8":(0,t.RC)((()=>i.e(872).then(i.bind(i,6761)))),"v-2c05b6e0":(0,t.RC)((()=>i.e(960).then(i.bind(i,502)))),"v-d61a9282":(0,t.RC)((()=>i.e(783).then(i.bind(i,671)))),"v-494b840e":(0,t.RC)((()=>i.e(861).then(i.bind(i,2754)))),"v-c5618810":(0,t.RC)((()=>i.e(287).then(i.bind(i,3221)))),"v-2fe128e7":(0,t.RC)((()=>i.e(484).then(i.bind(i,5364)))),"v-323bda7e":(0,t.RC)((()=>i.e(230).then(i.bind(i,5846)))),"v-c253c956":(0,t.RC)((()=>i.e(673).then(i.bind(i,9339)))),"v-0a0e491c":(0,t.RC)((()=>i.e(312).then(i.bind(i,8645)))),"v-3cd5a4ef":(0,t.RC)((()=>i.e(977).then(i.bind(i,914)))),"v-355ee23e":(0,t.RC)((()=>i.e(475).then(i.bind(i,2891)))),"v-411c0c9e":(0,t.RC)((()=>i.e(496).then(i.bind(i,4919)))),"v-3c4e521e":(0,t.RC)((()=>i.e(925).then(i.bind(i,7746)))),"v-6f2f6a5a":(0,t.RC)((()=>i.e(658).then(i.bind(i,1437)))),"v-b15becb0":(0,t.RC)((()=>i.e(172).then(i.bind(i,5574)))),"v-41dee210":(0,t.RC)((()=>i.e(919).then(i.bind(i,2434)))),"v-5bf80046":(0,t.RC)((()=>i.e(463).then(i.bind(i,5310)))),"v-5f4c684e":(0,t.RC)((()=>i.e(132).then(i.bind(i,4565)))),"v-1c0edac3":(0,t.RC)((()=>i.e(835).then(i.bind(i,5243)))),"v-392e58ee":(0,t.RC)((()=>i.e(802).then(i.bind(i,9673)))),"v-3706649a":(0,t.RC)((()=>i.e(88).then(i.bind(i,8109))))}},9706:(e,n,i)=>{i.d(n,{T:()=>t});const t={"v-8daa1a0e":()=>i.e(509).then(i.bind(i,6464)).then((({data:e})=>e)),"v-fffb8e28":()=>i.e(807).then(i.bind(i,9570)).then((({data:e})=>e)),"v-85fa9b2a":()=>i.e(445).then(i.bind(i,1759)).then((({data:e})=>e)),"v-d7fa887a":()=>i.e(617).then(i.bind(i,4148)).then((({data:e})=>e)),"v-884fd4bc":()=>i.e(229).then(i.bind(i,7657)).then((({data:e})=>e)),"v-040800dc":()=>i.e(256).then(i.bind(i,8145)).then((({data:e})=>e)),"v-ef8c5e10":()=>i.e(276).then(i.bind(i,9812)).then((({data:e})=>e)),"v-37e1c06f":()=>i.e(600).then(i.bind(i,4384)).then((({data:e})=>e)),"v-fb0f0066":()=>i.e(170).then(i.bind(i,3866)).then((({data:e})=>e)),"v-528b8b6c":()=>i.e(972).then(i.bind(i,2296)).then((({data:e})=>e)),"v-00cf7e23":()=>i.e(754).then(i.bind(i,6285)).then((({data:e})=>e)),"v-1d14d5cc":()=>i.e(507).then(i.bind(i,494)).then((({data:e})=>e)),"v-7b96e3a4":()=>i.e(278).then(i.bind(i,4731)).then((({data:e})=>e)),"v-6320961c":()=>i.e(626).then(i.bind(i,6254)).then((({data:e})=>e)),"v-3dba8814":()=>i.e(448).then(i.bind(i,1427)).then((({data:e})=>e)),"v-7b48519a":()=>i.e(938).then(i.bind(i,1362)).then((({data:e})=>e)),"v-a1a49808":()=>i.e(943).then(i.bind(i,5710)).then((({data:e})=>e)),"v-a951be94":()=>i.e(65).then(i.bind(i,8007)).then((({data:e})=>e)),"v-76cd065c":()=>i.e(476).then(i.bind(i,436)).then((({data:e})=>e)),"v-76cb52e8":()=>i.e(872).then(i.bind(i,7937)).then((({data:e})=>e)),"v-2c05b6e0":()=>i.e(960).then(i.bind(i,5822)).then((({data:e})=>e)),"v-d61a9282":()=>i.e(783).then(i.bind(i,6811)).then((({data:e})=>e)),"v-494b840e":()=>i.e(861).then(i.bind(i,4794)).then((({data:e})=>e)),"v-c5618810":()=>i.e(287).then(i.bind(i,4020)).then((({data:e})=>e)),"v-2fe128e7":()=>i.e(484).then(i.bind(i,2639)).then((({data:e})=>e)),"v-323bda7e":()=>i.e(230).then(i.bind(i,6062)).then((({data:e})=>e)),"v-c253c956":()=>i.e(673).then(i.bind(i,9073)).then((({data:e})=>e)),"v-0a0e491c":()=>i.e(312).then(i.bind(i,3442)).then((({data:e})=>e)),"v-3cd5a4ef":()=>i.e(977).then(i.bind(i,5393)).then((({data:e})=>e)),"v-355ee23e":()=>i.e(475).then(i.bind(i,1783)).then((({data:e})=>e)),"v-411c0c9e":()=>i.e(496).then(i.bind(i,565)).then((({data:e})=>e)),"v-3c4e521e":()=>i.e(925).then(i.bind(i,1371)).then((({data:e})=>e)),"v-6f2f6a5a":()=>i.e(658).then(i.bind(i,9465)).then((({data:e})=>e)),"v-b15becb0":()=>i.e(172).then(i.bind(i,8504)).then((({data:e})=>e)),"v-41dee210":()=>i.e(919).then(i.bind(i,2121)).then((({data:e})=>e)),"v-5bf80046":()=>i.e(463).then(i.bind(i,93)).then((({data:e})=>e)),"v-5f4c684e":()=>i.e(132).then(i.bind(i,8462)).then((({data:e})=>e)),"v-1c0edac3":()=>i.e(835).then(i.bind(i,4710)).then((({data:e})=>e)),"v-392e58ee":()=>i.e(802).then(i.bind(i,6865)).then((({data:e})=>e)),"v-3706649a":()=>i.e(88).then(i.bind(i,1801)).then((({data:e})=>e))}},4634:(e,n,i)=>{i.d(n,{g:()=>d});var t=i(4802);const d=[["v-8daa1a0e","/",{title:"首页"},["/index.html","/README.md"]],["v-fffb8e28","/guide/",{title:"介绍"},["/guide/index.html","/guide/README.md"]],["v-85fa9b2a","/guide/config.html",{title:"配置"},["/guide/config","/guide/config.md"]],["v-d7fa887a","/guide/contributing.html",{title:"贡献指南"},["/guide/contributing","/guide/contributing.md"]],["v-884fd4bc","/guide/css.html",{title:"使用 css"},["/guide/css","/guide/css.md"]],["v-040800dc","/guide/directory-structure.html",{title:"目录结构"},["/guide/directory-structure","/guide/directory-structure.md"]],["v-ef8c5e10","/guide/env.html",{title:"环境变量"},["/guide/env","/guide/env.md"]],["v-37e1c06f","/guide/faq.html",{title:"常见问题"},["/guide/faq","/guide/faq.md"]],["v-fb0f0066","/guide/getting-started.html",{title:"快速上手"},["/guide/getting-started","/guide/getting-started.md"]],["v-528b8b6c","/guide/image.html",{title:"使用图片"},["/guide/image","/guide/image.md"]],["v-00cf7e23","/guide/mock.html",{title:"Mock 数据"},["/guide/mock","/guide/mock.md"]],["v-1d14d5cc","/guide/plugin.html",{title:"插件"},["/guide/plugin","/guide/plugin.md"]],["v-7b96e3a4","/guide/public.html",{title:"静态资源"},["/guide/public","/guide/public.md"]],["v-6320961c","/guide/route.html",{title:"路由"},["/guide/route","/guide/route.md"]],["v-3dba8814","/guide/runtime-config.html",{title:"运行时配置"},["/guide/runtime-config","/guide/runtime-config.md"]],["v-7b48519a","/guide/template.html",{title:"HTML 模板"},["/guide/template","/guide/template.md"]],["v-a1a49808","/reference/api.html",{title:"API"},["/reference/api","/reference/api.md"]],["v-a951be94","/reference/cli.html",{title:"命令行接口"},["/reference/cli","/reference/cli.md"]],["v-76cd065c","/reference/api/",{title:"API"},["/reference/api/index.html","/reference/api/README.md"]],["v-76cb52e8","/reference/cli/",{title:"命令行工具"},["/reference/cli/index.html","/reference/cli/README.md"]],["v-2c05b6e0","/reference/config/",{title:"配置"},["/reference/config/index.html","/reference/config/README.md"]],["v-d61a9282","/reference/plugin/",{title:"介绍"},["/reference/plugin/index.html","/reference/plugin/README.md"]],["v-494b840e","/reference/plugin/dev/",{title:"插件介绍"},["/reference/plugin/dev/index.html","/reference/plugin/dev/README.md"]],["v-c5618810","/reference/plugin/dev/api.html",{title:"插件 API"},["/reference/plugin/dev/api","/reference/plugin/dev/api.md"]],["v-2fe128e7","/reference/plugin/plugins/access.html",{title:"@fesjs/plugin-access"},["/reference/plugin/plugins/access","/reference/plugin/plugins/access.md"]],["v-323bda7e","/reference/plugin/plugins/editor.html",{title:"@fesjs/plugin-monaco-editor"},["/reference/plugin/plugins/editor","/reference/plugin/plugins/editor.md"]],["v-c253c956","/reference/plugin/plugins/enums.html",{title:"@fesjs/plugin-enums"},["/reference/plugin/plugins/enums","/reference/plugin/plugins/enums.md"]],["v-0a0e491c","/reference/plugin/plugins/icon.html",{title:"@fesjs/plugin-icon"},["/reference/plugin/plugins/icon","/reference/plugin/plugins/icon.md"]],["v-3cd5a4ef","/reference/plugin/plugins/jest.html",{title:"@fesjs/plugin-jest"},["/reference/plugin/plugins/jest","/reference/plugin/plugins/jest.md"]],["v-355ee23e","/reference/plugin/plugins/layout.html",{title:"@fesjs/plugin-layout"},["/reference/plugin/plugins/layout","/reference/plugin/plugins/layout.md"]],["v-411c0c9e","/reference/plugin/plugins/locale.html",{title:"@fesjs/plugin-locale"},["/reference/plugin/plugins/locale","/reference/plugin/plugins/locale.md"]],["v-3c4e521e","/reference/plugin/plugins/model.html",{title:"@fesjs/plugin-model"},["/reference/plugin/plugins/model","/reference/plugin/plugins/model.md"]],["v-6f2f6a5a","/reference/plugin/plugins/pinia.html",{title:"@fesjs/plugin-pinia"},["/reference/plugin/plugins/pinia","/reference/plugin/plugins/pinia.md"]],["v-b15becb0","/reference/plugin/plugins/qiankun.html",{title:"@fesjs/plugin-qiankun"},["/reference/plugin/plugins/qiankun","/reference/plugin/plugins/qiankun.md"]],["v-41dee210","/reference/plugin/plugins/request.html",{title:"@fesjs/plugin-request"},["/reference/plugin/plugins/request","/reference/plugin/plugins/request.md"]],["v-5bf80046","/reference/plugin/plugins/sass.html",{title:"@fesjs/plugin-sass"},["/reference/plugin/plugins/sass","/reference/plugin/plugins/sass.md"]],["v-5f4c684e","/reference/plugin/plugins/vuex.html",{title:"@fesjs/plugin-vuex"},["/reference/plugin/plugins/vuex","/reference/plugin/plugins/vuex.md"]],["v-1c0edac3","/reference/plugin/plugins/watermark.html",{title:"@fesjs/plugin-watermark"},["/reference/plugin/plugins/watermark","/reference/plugin/plugins/watermark.md"]],["v-392e58ee","/reference/plugin/plugins/windicss.html",{title:"@fesjs/plugin-windicss"},["/reference/plugin/plugins/windicss","/reference/plugin/plugins/windicss.md"]],["v-3706649a","/404.html",{},["/404"]]].reduce(((e,[n,i,d,l])=>(e.push({name:n,path:i,component:t.Y,meta:d},...l.map((e=>({path:e,redirect:i})))),e)),[{name:"404",path:"/:catchAll(.*)",component:t.Y}])},5220:(e,n,i)=>{i.d(n,{H:()=>t});const t={base:"/fes.js/",lang:"en-US",title:"",description:"",head:[["link",{rel:"manifest",href:"/manifest.webmanifest"}],["link",{rel:"icon",href:"/logo.png"}]],locales:{"/":{lang:"zh-CN",title:"Fes.js",description:"一个好用的前端应用解决方案"}}}},2232:(e,n,i)=>{i.d(n,{f:()=>t});const t={logo:"/logo.png",repo:"WeBankFinTech/fes.js",docsDir:"docs",docsBranch:"master",locales:{"/":{navbar:[{text:"指南",link:"/guide/"},{text:"配置",link:"/reference/config/"},{text:"API",link:"/reference/api/"},{text:"插件",link:"/reference/plugin/"},{text:"CLI",link:"/reference/cli/"},{text:"v2.0",children:[{text:"v3.0",link:"https://fesjs.mumblefe.cn/next"},{text:"v1.0",link:"https://fesjs.mumblefe.cn/1.0"}]},{text:"了解更多",children:[{text:"更新日志",link:"https://github.com/WeBankFinTech/fes.js/blob/master/CHANGELOG.md"},{text:"fes-design",link:"http://fes-design.mumblefe.cn/"}]}],selectLanguageName:"简体中文",selectLanguageText:"选择语言",selectLanguageAriaLabel:"选择语言",sidebar:{"/guide/":[{text:"介绍",children:["/guide/README.md","/guide/getting-started.md"]},{text:"基础",children:["/guide/directory-structure.md","/guide/config.md","/guide/runtime-config.md","/guide/env.md","/guide/route.md","/guide/plugin.md","/guide/template.md","/guide/mock.md"]},{text:"样式和资源文件",children:["/guide/image.md","/guide/css.md","/guide/public.md"]},"/guide/contributing.md","/guide/faq.md"],"/reference/config/":["/reference/config/README.md"],"/reference/api/":["/reference/api/README.md"],"/reference/plugin/":["/reference/plugin/README.md",{text:"Plugins",children:["/reference/plugin/plugins/access.md","/reference/plugin/plugins/enums.md","/reference/plugin/plugins/icon.md","/reference/plugin/plugins/jest.md","/reference/plugin/plugins/layout.md","/reference/plugin/plugins/locale.md","/reference/plugin/plugins/model.md","/reference/plugin/plugins/request.md","/reference/plugin/plugins/vuex.md","/reference/plugin/plugins/qiankun.md","/reference/plugin/plugins/windicss.md","/reference/plugin/plugins/sass.md","/reference/plugin/plugins/editor.md","/reference/plugin/plugins/pinia.md","/reference/plugin/plugins/watermark.md"]},{text:"插件开发",children:["/reference/plugin/dev/README.md","/reference/plugin/dev/api.md"]}],"/reference/cli/":["/reference/cli/README.md"]},editLinkText:"在 GitHub 上编辑此页",lastUpdatedText:"上次更新",contributorsText:"贡献者",tip:"提示",warning:"注意",danger:"警告",notFound:["这里什么都没有","我们怎么到这来了?","这是一个 404 页面","看起来我们进入了错误的链接"],backToHome:"返回首页",openInNewWindow:"在新窗口打开"}},navbar:[],darkMode:!0,selectLanguageText:"Languages",selectLanguageAriaLabel:"Select language",sidebar:"auto",sidebarDepth:2,editLink:!0,editLinkText:"Edit this page",lastUpdated:!0,lastUpdatedText:"Last Updated",contributors:!0,contributorsText:"Contributors",notFound:["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],backToHome:"Take me home",openInNewWindow:"open in new window",toggleDarkMode:"toggle dark mode",toggleSidebar:"toggle sidebar"}}},e=>{e.O(0,[885,399],(()=>(5698,e(e.s=5698)))),e.O()}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[143],{3131:(e,n,i)=>{i.d(n,{g:()=>c});var t=i(2009),d=i(6971),l=i(1598),r=i(6934);const c=[t.Z,d.Z,l.Z,r.Z]},9947:(e,n,i)=>{i.d(n,{p:()=>l});var t=i(3051),d=i(8341);const l=[t.Z,d.Z]},4611:(e,n,i)=>{i.d(n,{l:()=>c});var t=i(8866),d=i(1263),l=i(6243),r=i(4862);const c=[t.Z,d.Z,l.Z,r.Z]},4150:(e,n,i)=>{i.d(n,{Z:()=>d});var t=i(6252);const d={404:(0,t.RC)((()=>i.e(491).then(i.bind(i,8491)))),Layout:(0,t.RC)((()=>i.e(293).then(i.bind(i,3293))))}},6056:(e,n,i)=>{i.d(n,{b:()=>d});var t=i(6252);const d={"v-8daa1a0e":(0,t.RC)((()=>i.e(509).then(i.bind(i,8104)))),"v-fffb8e28":(0,t.RC)((()=>i.e(807).then(i.bind(i,5195)))),"v-85fa9b2a":(0,t.RC)((()=>i.e(445).then(i.bind(i,5942)))),"v-d7fa887a":(0,t.RC)((()=>i.e(617).then(i.bind(i,5938)))),"v-884fd4bc":(0,t.RC)((()=>i.e(229).then(i.bind(i,8568)))),"v-040800dc":(0,t.RC)((()=>i.e(256).then(i.bind(i,1842)))),"v-ef8c5e10":(0,t.RC)((()=>i.e(276).then(i.bind(i,3125)))),"v-37e1c06f":(0,t.RC)((()=>i.e(600).then(i.bind(i,4708)))),"v-fb0f0066":(0,t.RC)((()=>i.e(170).then(i.bind(i,2204)))),"v-528b8b6c":(0,t.RC)((()=>i.e(972).then(i.bind(i,2682)))),"v-00cf7e23":(0,t.RC)((()=>i.e(754).then(i.bind(i,5808)))),"v-1d14d5cc":(0,t.RC)((()=>i.e(507).then(i.bind(i,9959)))),"v-7b96e3a4":(0,t.RC)((()=>i.e(278).then(i.bind(i,6430)))),"v-6320961c":(0,t.RC)((()=>i.e(626).then(i.bind(i,7570)))),"v-3dba8814":(0,t.RC)((()=>i.e(448).then(i.bind(i,74)))),"v-7b48519a":(0,t.RC)((()=>i.e(938).then(i.bind(i,5213)))),"v-a1a49808":(0,t.RC)((()=>i.e(943).then(i.bind(i,3364)))),"v-a951be94":(0,t.RC)((()=>i.e(65).then(i.bind(i,1933)))),"v-76cd065c":(0,t.RC)((()=>i.e(476).then(i.bind(i,5930)))),"v-76cb52e8":(0,t.RC)((()=>i.e(872).then(i.bind(i,6761)))),"v-2c05b6e0":(0,t.RC)((()=>i.e(960).then(i.bind(i,502)))),"v-d61a9282":(0,t.RC)((()=>i.e(783).then(i.bind(i,671)))),"v-494b840e":(0,t.RC)((()=>i.e(861).then(i.bind(i,2754)))),"v-c5618810":(0,t.RC)((()=>i.e(287).then(i.bind(i,3221)))),"v-2fe128e7":(0,t.RC)((()=>i.e(484).then(i.bind(i,5364)))),"v-323bda7e":(0,t.RC)((()=>i.e(230).then(i.bind(i,5846)))),"v-c253c956":(0,t.RC)((()=>i.e(673).then(i.bind(i,9339)))),"v-0a0e491c":(0,t.RC)((()=>i.e(312).then(i.bind(i,8645)))),"v-3cd5a4ef":(0,t.RC)((()=>i.e(977).then(i.bind(i,914)))),"v-355ee23e":(0,t.RC)((()=>i.e(475).then(i.bind(i,2891)))),"v-411c0c9e":(0,t.RC)((()=>i.e(496).then(i.bind(i,4919)))),"v-3c4e521e":(0,t.RC)((()=>i.e(925).then(i.bind(i,7746)))),"v-6f2f6a5a":(0,t.RC)((()=>i.e(658).then(i.bind(i,1437)))),"v-b15becb0":(0,t.RC)((()=>i.e(172).then(i.bind(i,5574)))),"v-41dee210":(0,t.RC)((()=>i.e(919).then(i.bind(i,2434)))),"v-5bf80046":(0,t.RC)((()=>i.e(463).then(i.bind(i,5310)))),"v-5f4c684e":(0,t.RC)((()=>i.e(132).then(i.bind(i,4565)))),"v-1c0edac3":(0,t.RC)((()=>i.e(835).then(i.bind(i,5243)))),"v-392e58ee":(0,t.RC)((()=>i.e(802).then(i.bind(i,9673)))),"v-3706649a":(0,t.RC)((()=>i.e(88).then(i.bind(i,8109))))}},9706:(e,n,i)=>{i.d(n,{T:()=>t});const t={"v-8daa1a0e":()=>i.e(509).then(i.bind(i,6464)).then((({data:e})=>e)),"v-fffb8e28":()=>i.e(807).then(i.bind(i,9570)).then((({data:e})=>e)),"v-85fa9b2a":()=>i.e(445).then(i.bind(i,1759)).then((({data:e})=>e)),"v-d7fa887a":()=>i.e(617).then(i.bind(i,4148)).then((({data:e})=>e)),"v-884fd4bc":()=>i.e(229).then(i.bind(i,7657)).then((({data:e})=>e)),"v-040800dc":()=>i.e(256).then(i.bind(i,8145)).then((({data:e})=>e)),"v-ef8c5e10":()=>i.e(276).then(i.bind(i,9812)).then((({data:e})=>e)),"v-37e1c06f":()=>i.e(600).then(i.bind(i,4384)).then((({data:e})=>e)),"v-fb0f0066":()=>i.e(170).then(i.bind(i,3866)).then((({data:e})=>e)),"v-528b8b6c":()=>i.e(972).then(i.bind(i,2296)).then((({data:e})=>e)),"v-00cf7e23":()=>i.e(754).then(i.bind(i,6285)).then((({data:e})=>e)),"v-1d14d5cc":()=>i.e(507).then(i.bind(i,494)).then((({data:e})=>e)),"v-7b96e3a4":()=>i.e(278).then(i.bind(i,4731)).then((({data:e})=>e)),"v-6320961c":()=>i.e(626).then(i.bind(i,6254)).then((({data:e})=>e)),"v-3dba8814":()=>i.e(448).then(i.bind(i,1427)).then((({data:e})=>e)),"v-7b48519a":()=>i.e(938).then(i.bind(i,1362)).then((({data:e})=>e)),"v-a1a49808":()=>i.e(943).then(i.bind(i,5710)).then((({data:e})=>e)),"v-a951be94":()=>i.e(65).then(i.bind(i,8007)).then((({data:e})=>e)),"v-76cd065c":()=>i.e(476).then(i.bind(i,436)).then((({data:e})=>e)),"v-76cb52e8":()=>i.e(872).then(i.bind(i,7937)).then((({data:e})=>e)),"v-2c05b6e0":()=>i.e(960).then(i.bind(i,5822)).then((({data:e})=>e)),"v-d61a9282":()=>i.e(783).then(i.bind(i,6811)).then((({data:e})=>e)),"v-494b840e":()=>i.e(861).then(i.bind(i,4794)).then((({data:e})=>e)),"v-c5618810":()=>i.e(287).then(i.bind(i,4020)).then((({data:e})=>e)),"v-2fe128e7":()=>i.e(484).then(i.bind(i,2639)).then((({data:e})=>e)),"v-323bda7e":()=>i.e(230).then(i.bind(i,6062)).then((({data:e})=>e)),"v-c253c956":()=>i.e(673).then(i.bind(i,9073)).then((({data:e})=>e)),"v-0a0e491c":()=>i.e(312).then(i.bind(i,3442)).then((({data:e})=>e)),"v-3cd5a4ef":()=>i.e(977).then(i.bind(i,5393)).then((({data:e})=>e)),"v-355ee23e":()=>i.e(475).then(i.bind(i,1783)).then((({data:e})=>e)),"v-411c0c9e":()=>i.e(496).then(i.bind(i,565)).then((({data:e})=>e)),"v-3c4e521e":()=>i.e(925).then(i.bind(i,1371)).then((({data:e})=>e)),"v-6f2f6a5a":()=>i.e(658).then(i.bind(i,9465)).then((({data:e})=>e)),"v-b15becb0":()=>i.e(172).then(i.bind(i,8504)).then((({data:e})=>e)),"v-41dee210":()=>i.e(919).then(i.bind(i,2121)).then((({data:e})=>e)),"v-5bf80046":()=>i.e(463).then(i.bind(i,93)).then((({data:e})=>e)),"v-5f4c684e":()=>i.e(132).then(i.bind(i,8462)).then((({data:e})=>e)),"v-1c0edac3":()=>i.e(835).then(i.bind(i,4710)).then((({data:e})=>e)),"v-392e58ee":()=>i.e(802).then(i.bind(i,6865)).then((({data:e})=>e)),"v-3706649a":()=>i.e(88).then(i.bind(i,1801)).then((({data:e})=>e))}},4634:(e,n,i)=>{i.d(n,{g:()=>d});var t=i(4802);const d=[["v-8daa1a0e","/",{title:"首页"},["/index.html","/README.md"]],["v-fffb8e28","/guide/",{title:"介绍"},["/guide/index.html","/guide/README.md"]],["v-85fa9b2a","/guide/config.html",{title:"配置"},["/guide/config","/guide/config.md"]],["v-d7fa887a","/guide/contributing.html",{title:"贡献指南"},["/guide/contributing","/guide/contributing.md"]],["v-884fd4bc","/guide/css.html",{title:"使用 css"},["/guide/css","/guide/css.md"]],["v-040800dc","/guide/directory-structure.html",{title:"目录结构"},["/guide/directory-structure","/guide/directory-structure.md"]],["v-ef8c5e10","/guide/env.html",{title:"环境变量"},["/guide/env","/guide/env.md"]],["v-37e1c06f","/guide/faq.html",{title:"常见问题"},["/guide/faq","/guide/faq.md"]],["v-fb0f0066","/guide/getting-started.html",{title:"快速上手"},["/guide/getting-started","/guide/getting-started.md"]],["v-528b8b6c","/guide/image.html",{title:"使用图片"},["/guide/image","/guide/image.md"]],["v-00cf7e23","/guide/mock.html",{title:"Mock 数据"},["/guide/mock","/guide/mock.md"]],["v-1d14d5cc","/guide/plugin.html",{title:"插件"},["/guide/plugin","/guide/plugin.md"]],["v-7b96e3a4","/guide/public.html",{title:"静态资源"},["/guide/public","/guide/public.md"]],["v-6320961c","/guide/route.html",{title:"路由"},["/guide/route","/guide/route.md"]],["v-3dba8814","/guide/runtime-config.html",{title:"运行时配置"},["/guide/runtime-config","/guide/runtime-config.md"]],["v-7b48519a","/guide/template.html",{title:"HTML 模板"},["/guide/template","/guide/template.md"]],["v-a1a49808","/reference/api.html",{title:"API"},["/reference/api","/reference/api.md"]],["v-a951be94","/reference/cli.html",{title:"命令行接口"},["/reference/cli","/reference/cli.md"]],["v-76cd065c","/reference/api/",{title:"API"},["/reference/api/index.html","/reference/api/README.md"]],["v-76cb52e8","/reference/cli/",{title:"命令行工具"},["/reference/cli/index.html","/reference/cli/README.md"]],["v-2c05b6e0","/reference/config/",{title:"配置"},["/reference/config/index.html","/reference/config/README.md"]],["v-d61a9282","/reference/plugin/",{title:"介绍"},["/reference/plugin/index.html","/reference/plugin/README.md"]],["v-494b840e","/reference/plugin/dev/",{title:"插件介绍"},["/reference/plugin/dev/index.html","/reference/plugin/dev/README.md"]],["v-c5618810","/reference/plugin/dev/api.html",{title:"插件 API"},["/reference/plugin/dev/api","/reference/plugin/dev/api.md"]],["v-2fe128e7","/reference/plugin/plugins/access.html",{title:"@fesjs/plugin-access"},["/reference/plugin/plugins/access","/reference/plugin/plugins/access.md"]],["v-323bda7e","/reference/plugin/plugins/editor.html",{title:"@fesjs/plugin-monaco-editor"},["/reference/plugin/plugins/editor","/reference/plugin/plugins/editor.md"]],["v-c253c956","/reference/plugin/plugins/enums.html",{title:"@fesjs/plugin-enums"},["/reference/plugin/plugins/enums","/reference/plugin/plugins/enums.md"]],["v-0a0e491c","/reference/plugin/plugins/icon.html",{title:"@fesjs/plugin-icon"},["/reference/plugin/plugins/icon","/reference/plugin/plugins/icon.md"]],["v-3cd5a4ef","/reference/plugin/plugins/jest.html",{title:"@fesjs/plugin-jest"},["/reference/plugin/plugins/jest","/reference/plugin/plugins/jest.md"]],["v-355ee23e","/reference/plugin/plugins/layout.html",{title:"@fesjs/plugin-layout"},["/reference/plugin/plugins/layout","/reference/plugin/plugins/layout.md"]],["v-411c0c9e","/reference/plugin/plugins/locale.html",{title:"@fesjs/plugin-locale"},["/reference/plugin/plugins/locale","/reference/plugin/plugins/locale.md"]],["v-3c4e521e","/reference/plugin/plugins/model.html",{title:"@fesjs/plugin-model"},["/reference/plugin/plugins/model","/reference/plugin/plugins/model.md"]],["v-6f2f6a5a","/reference/plugin/plugins/pinia.html",{title:"@fesjs/plugin-pinia"},["/reference/plugin/plugins/pinia","/reference/plugin/plugins/pinia.md"]],["v-b15becb0","/reference/plugin/plugins/qiankun.html",{title:"@fesjs/plugin-qiankun"},["/reference/plugin/plugins/qiankun","/reference/plugin/plugins/qiankun.md"]],["v-41dee210","/reference/plugin/plugins/request.html",{title:"@fesjs/plugin-request"},["/reference/plugin/plugins/request","/reference/plugin/plugins/request.md"]],["v-5bf80046","/reference/plugin/plugins/sass.html",{title:"@fesjs/plugin-sass"},["/reference/plugin/plugins/sass","/reference/plugin/plugins/sass.md"]],["v-5f4c684e","/reference/plugin/plugins/vuex.html",{title:"@fesjs/plugin-vuex"},["/reference/plugin/plugins/vuex","/reference/plugin/plugins/vuex.md"]],["v-1c0edac3","/reference/plugin/plugins/watermark.html",{title:"@fesjs/plugin-watermark"},["/reference/plugin/plugins/watermark","/reference/plugin/plugins/watermark.md"]],["v-392e58ee","/reference/plugin/plugins/windicss.html",{title:"@fesjs/plugin-windicss"},["/reference/plugin/plugins/windicss","/reference/plugin/plugins/windicss.md"]],["v-3706649a","/404.html",{},["/404"]]].reduce(((e,[n,i,d,l])=>(e.push({name:n,path:i,component:t.Y,meta:d},...l.map((e=>({path:e,redirect:i})))),e)),[{name:"404",path:"/:catchAll(.*)",component:t.Y}])},5220:(e,n,i)=>{i.d(n,{H:()=>t});const t={base:"/fes.js/",lang:"en-US",title:"",description:"",head:[["link",{rel:"manifest",href:"/manifest.webmanifest"}],["link",{rel:"icon",href:"/logo.png"}]],locales:{"/":{lang:"zh-CN",title:"Fes.js",description:"一个好用的前端应用解决方案"}}}},2232:(e,n,i)=>{i.d(n,{f:()=>t});const t={logo:"/logo.png",repo:"WeBankFinTech/fes.js",docsDir:"docs",docsBranch:"master",locales:{"/":{navbar:[{text:"指南",link:"/guide/"},{text:"配置",link:"/reference/config/"},{text:"API",link:"/reference/api/"},{text:"插件",link:"/reference/plugin/"},{text:"CLI",link:"/reference/cli/"},{text:"v2.0",children:[{text:"v3.0",link:"https://fesjs.mumblefe.cn"},{text:"v1.0",link:"https://fesjs.mumblefe.cn/1.0"}]},{text:"了解更多",children:[{text:"更新日志",link:"https://github.com/WeBankFinTech/fes.js/blob/2.0/CHANGELOG.md"},{text:"fes-design",link:"http://fes-design.mumblefe.cn/"}]}],selectLanguageName:"简体中文",selectLanguageText:"选择语言",selectLanguageAriaLabel:"选择语言",sidebar:{"/guide/":[{text:"介绍",children:["/guide/README.md","/guide/getting-started.md"]},{text:"基础",children:["/guide/directory-structure.md","/guide/config.md","/guide/runtime-config.md","/guide/env.md","/guide/route.md","/guide/plugin.md","/guide/template.md","/guide/mock.md"]},{text:"样式和资源文件",children:["/guide/image.md","/guide/css.md","/guide/public.md"]},"/guide/contributing.md","/guide/faq.md"],"/reference/config/":["/reference/config/README.md"],"/reference/api/":["/reference/api/README.md"],"/reference/plugin/":["/reference/plugin/README.md",{text:"Plugins",children:["/reference/plugin/plugins/access.md","/reference/plugin/plugins/enums.md","/reference/plugin/plugins/icon.md","/reference/plugin/plugins/jest.md","/reference/plugin/plugins/layout.md","/reference/plugin/plugins/locale.md","/reference/plugin/plugins/model.md","/reference/plugin/plugins/request.md","/reference/plugin/plugins/vuex.md","/reference/plugin/plugins/qiankun.md","/reference/plugin/plugins/windicss.md","/reference/plugin/plugins/sass.md","/reference/plugin/plugins/editor.md","/reference/plugin/plugins/pinia.md","/reference/plugin/plugins/watermark.md"]},{text:"插件开发",children:["/reference/plugin/dev/README.md","/reference/plugin/dev/api.md"]}],"/reference/cli/":["/reference/cli/README.md"]},editLinkText:"在 GitHub 上编辑此页",lastUpdatedText:"上次更新",contributorsText:"贡献者",tip:"提示",warning:"注意",danger:"警告",notFound:["这里什么都没有","我们怎么到这来了?","这是一个 404 页面","看起来我们进入了错误的链接"],backToHome:"返回首页",openInNewWindow:"在新窗口打开"}},navbar:[],darkMode:!0,selectLanguageText:"Languages",selectLanguageAriaLabel:"Select language",sidebar:"auto",sidebarDepth:2,editLink:!0,editLinkText:"Edit this page",lastUpdated:!0,lastUpdatedText:"Last Updated",contributors:!0,contributorsText:"Contributors",notFound:["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],backToHome:"Take me home",openInNewWindow:"open in new window",toggleDarkMode:"toggle dark mode",toggleSidebar:"toggle sidebar"}}},e=>{e.O(0,[296,399],(()=>(5698,e(e.s=5698)))),e.O()}]); \ No newline at end of file diff --git a/assets/js/runtime~app.626f1f2e.js b/assets/js/runtime~app.626f1f2e.js deleted file mode 100644 index d7a5d69d..00000000 --- a/assets/js/runtime~app.626f1f2e.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,a,r,t={},c={};function o(e){var a=c[e];if(void 0!==a)return a.exports;var r=c[e]={exports:{}};return t[e].call(r.exports,r,r.exports,o),r.exports}o.m=t,e=[],o.O=(a,r,t,c)=>{if(!r){var f=1/0;for(b=0;b=c)&&Object.keys(o.O).every((e=>o.O[e](r[d])))?r.splice(d--,1):(v=!1,c0&&e[b-1][2]>c;b--)e[b]=e[b-1];e[b]=[r,t,c]},o.d=(e,a)=>{for(var r in a)o.o(a,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((a,r)=>(o.f[r](e,a),a)),[])),o.u=e=>"assets/js/"+({65:"v-a951be94",88:"v-3706649a",132:"v-5f4c684e",170:"v-fb0f0066",172:"v-b15becb0",229:"v-884fd4bc",230:"v-323bda7e",256:"v-040800dc",276:"v-ef8c5e10",278:"v-7b96e3a4",287:"v-c5618810",312:"v-0a0e491c",445:"v-85fa9b2a",448:"v-3dba8814",463:"v-5bf80046",475:"v-355ee23e",476:"v-76cd065c",484:"v-2fe128e7",496:"v-411c0c9e",507:"v-1d14d5cc",509:"v-8daa1a0e",600:"v-37e1c06f",617:"v-d7fa887a",626:"v-6320961c",658:"v-6f2f6a5a",673:"v-c253c956",754:"v-00cf7e23",783:"v-d61a9282",802:"v-392e58ee",807:"v-fffb8e28",835:"v-1c0edac3",861:"v-494b840e",872:"v-76cb52e8",919:"v-41dee210",925:"v-3c4e521e",938:"v-7b48519a",943:"v-a1a49808",960:"v-2c05b6e0",972:"v-528b8b6c",977:"v-3cd5a4ef"}[e]||e)+"."+{65:"d6df9191",88:"87ee1900",132:"1ee28031",170:"5c369786",172:"e6d203bb",205:"fc028656",229:"85ac18fd",230:"a6270275",256:"323836dd",276:"9585488a",278:"3306cbb7",287:"81be60b6",293:"a51fb332",312:"556a9e41",445:"ec3ca3c5",448:"7cfcdbac",463:"7053c98c",475:"a37e2b48",476:"fabc8531",484:"8773c281",491:"94229b5b",496:"1c199fe9",507:"b570a951",509:"531dc54a",600:"9522953a",617:"0bcd6154",626:"a4f16bae",658:"e8179be8",673:"95173f2d",754:"c69d341d",783:"83f8c839",802:"c944921e",807:"91f97848",835:"54f56448",861:"ae393909",872:"50562b67",919:"11afeb11",925:"2dd96637",938:"56bce568",943:"55d17752",960:"89139121",972:"7f10a88c",977:"b28b8d5c"}[e]+".js",o.miniCssF=e=>{},o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),a={},r="fes.js:",o.l=(e,t,c,f)=>{if(a[e])a[e].push(t);else{var v,d;if(void 0!==c)for(var n=document.getElementsByTagName("script"),b=0;b{v.onerror=v.onload=null,clearTimeout(l);var c=a[e];if(delete a[e],v.parentNode&&v.parentNode.removeChild(v),c&&c.forEach((e=>e(t))),r)return r(t)},l=setTimeout(s.bind(null,void 0,{type:"timeout",target:v}),12e4);v.onerror=s.bind(null,v.onerror),v.onload=s.bind(null,v.onload),d&&document.head.appendChild(v)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="/fes.js/",(()=>{var e={523:0,885:0};o.f.j=(a,r)=>{var t=o.o(e,a)?e[a]:void 0;if(0!==t)if(t)r.push(t[2]);else if(/^(523|885)$/.test(a))e[a]=0;else{var c=new Promise(((r,c)=>t=e[a]=[r,c]));r.push(t[2]=c);var f=o.p+o.u(a),v=new Error;o.l(f,(r=>{if(o.o(e,a)&&(0!==(t=e[a])&&(e[a]=void 0),t)){var c=r&&("load"===r.type?"missing":r.type),f=r&&r.target&&r.target.src;v.message="Loading chunk "+a+" failed.\n("+c+": "+f+")",v.name="ChunkLoadError",v.type=c,v.request=f,t[1](v)}}),"chunk-"+a,a)}},o.O.j=a=>0===e[a];var a=(a,r)=>{var t,c,[f,v,d]=r,n=0;if(f.some((a=>0!==e[a]))){for(t in v)o.o(v,t)&&(o.m[t]=v[t]);if(d)var b=d(o)}for(a&&a(r);n{"use strict";var e,a,r,t={},f={};function c(e){var a=f[e];if(void 0!==a)return a.exports;var r=f[e]={exports:{}};return t[e].call(r.exports,r,r.exports,c),r.exports}c.m=t,e=[],c.O=(a,r,t,f)=>{if(!r){var d=1/0;for(i=0;i=f)&&Object.keys(c.O).every((e=>c.O[e](r[v])))?r.splice(v--,1):(o=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[r,t,f]},c.d=(e,a)=>{for(var r in a)c.o(a,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce(((a,r)=>(c.f[r](e,a),a)),[])),c.u=e=>"assets/js/"+({65:"v-a951be94",88:"v-3706649a",132:"v-5f4c684e",170:"v-fb0f0066",172:"v-b15becb0",229:"v-884fd4bc",230:"v-323bda7e",256:"v-040800dc",276:"v-ef8c5e10",278:"v-7b96e3a4",287:"v-c5618810",312:"v-0a0e491c",445:"v-85fa9b2a",448:"v-3dba8814",463:"v-5bf80046",475:"v-355ee23e",476:"v-76cd065c",484:"v-2fe128e7",496:"v-411c0c9e",507:"v-1d14d5cc",509:"v-8daa1a0e",600:"v-37e1c06f",617:"v-d7fa887a",626:"v-6320961c",658:"v-6f2f6a5a",673:"v-c253c956",754:"v-00cf7e23",783:"v-d61a9282",802:"v-392e58ee",807:"v-fffb8e28",835:"v-1c0edac3",861:"v-494b840e",872:"v-76cb52e8",919:"v-41dee210",925:"v-3c4e521e",938:"v-7b48519a",943:"v-a1a49808",960:"v-2c05b6e0",972:"v-528b8b6c",977:"v-3cd5a4ef"}[e]||e)+"."+{65:"9550ef17",88:"6d045efa",132:"004fc897",170:"f066a234",172:"9810a63f",205:"d4ef4058",229:"36a95eba",230:"778122f9",256:"1f1fb9d5",276:"01694dac",278:"033eb852",287:"c7e42791",293:"f5289c13",312:"37f99a72",445:"3f03d054",448:"9f07a8e3",463:"734741c7",475:"f2dde2a4",476:"270a37ed",484:"a15f3d55",491:"d264dc1d",496:"eb0a832d",507:"f6b678f3",509:"97e78117",600:"49408d07",617:"eec494da",626:"594d5357",658:"0a028df5",673:"71cde0f0",754:"1bc881cc",783:"315b2b24",802:"67937c7d",807:"7aa72175",835:"fe469da8",861:"3219979d",872:"0f619206",919:"18d5dcb0",925:"b813ace2",938:"741c8475",943:"5aa9c148",960:"7edc12ad",972:"e0560471",977:"7a6ef2c7"}[e]+".js",c.miniCssF=e=>{},c.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),a={},r="fes.js:",c.l=(e,t,f,d)=>{if(a[e])a[e].push(t);else{var o,v;if(void 0!==f)for(var n=document.getElementsByTagName("script"),i=0;i{o.onerror=o.onload=null,clearTimeout(l);var f=a[e];if(delete a[e],o.parentNode&&o.parentNode.removeChild(o),f&&f.forEach((e=>e(t))),r)return r(t)},l=setTimeout(b.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=b.bind(null,o.onerror),o.onload=b.bind(null,o.onload),v&&document.head.appendChild(o)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.p="/fes.js/",(()=>{var e={523:0,296:0};c.f.j=(a,r)=>{var t=c.o(e,a)?e[a]:void 0;if(0!==t)if(t)r.push(t[2]);else if(/^(296|523)$/.test(a))e[a]=0;else{var f=new Promise(((r,f)=>t=e[a]=[r,f]));r.push(t[2]=f);var d=c.p+c.u(a),o=new Error;c.l(d,(r=>{if(c.o(e,a)&&(0!==(t=e[a])&&(e[a]=void 0),t)){var f=r&&("load"===r.type?"missing":r.type),d=r&&r.target&&r.target.src;o.message="Loading chunk "+a+" failed.\n("+f+": "+d+")",o.name="ChunkLoadError",o.type=f,o.request=d,t[1](o)}}),"chunk-"+a,a)}},c.O.j=a=>0===e[a];var a=(a,r)=>{var t,f,[d,o,v]=r,n=0;if(d.some((a=>0!==e[a]))){for(t in o)c.o(o,t)&&(c.m[t]=o[t]);if(v)var i=v(c)}for(a&&a(r);n{a.r(s),a.d(s,{data:()=>p});const p={key:"v-00cf7e23",path:"/guide/mock.html",title:"Mock 数据",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"约定式 Mock 文件",slug:"约定式-mock-文件",children:[]},{level:2,title:"编写 Mock 文件",slug:"编写-mock-文件",children:[{level:3,title:"cgiMock \b参数",slug:"cgimock-参数",children:[]},{level:3,title:"mockjs 参数",slug:"mockjs-参数",children:[]},{level:3,title:"utils 参数",slug:"utils-参数",children:[]}]},{level:2,title:"配置 Mock",slug:"配置-mock",children:[]},{level:2,title:"关闭 Mock",slug:"关闭-mock",children:[]}],filePathRelative:"guide/mock.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5808:(n,s,a)=>{a.r(s),a.d(s,{default:()=>m});var p=a(6252);const t=(0,p.uE)('

Mock 数据

Mock 数据是前端开发过程中必不可少的一环,是分离前后端开发的关键链路。通过预先跟服务器端约定好的接口,模拟请求数据甚至逻辑,能够让前端开发独立自主,不会被服务端的开发所阻塞。

约定式 Mock 文件

Fes.js 约定 ./mock.js 为 mock 文件。

比如:

.\n├── mock.js\n└── src\n    └── pages\n        └── index.vue\n
1
2
3
4
5

编写 Mock 文件

可以参考如下 🌰:

export default function ({ cgiMock, mockjs, utils }) {\n    const { Random } = mockjs;\n\n    // 测试 proxy 与 mock 用例集合\n    cgiMock('/movie/in_theaters_mock', (req, res) => {\n        res.send(JSON.stringify({\n            code: '0',\n            msg: '',\n            result: {\n                text: 'movie:  movie/in_theaters_mock ~~~~~'\n            }\n        }));\n    });\n    cgiMock('/movie/test_mock', (req, res) => {\n        res.send(JSON.stringify({\n            code: '0',\n            msg: '',\n            result: {\n                text: 'mock:  movie/test_mock'\n            }\n        }));\n    });\n\n    // 测试用例: mock.js change,重现请求,需要能拉最新的数据\n    cgiMock('/watchtest', (req, res) => {\n        res.send(JSON.stringify({\n            code: '0',\n            msg: '',\n            result: {\n                text: '通过 register 测试 mock watch: 初始状态'\n            }\n        }));\n    });\n\n    // 返回一个数字\n    // cgiMock('/number', 666);\n    cgiMock('/number', 999);\n\n    // 返回一个json\n    cgiMock({\n        url: '/json',\n        result: {\n            code: '400101', msg: "不合法的请求:Missing cookie 'wb_app_id' for method parameter of type String", transactionTime: '20170309171146', success: false\n        }\n    });\n\n    // 利用 mock.js 产生随机文本\n    cgiMock('/text', Random.cparagraph());\n\n    // 返回一个字符串 利用 mock.js 产生随机字符\n    cgiMock('/random', mockjs.mock({\n        'string|1-10': '★'\n    }));\n\n    // 正则匹配url, 返回一个字符串\n    cgiMock(/\\/abc|\\/xyz/, 'regexp test!');\n\n    // option.result 参数如果是一个函数, 可以实现自定义返回内容, 接收的参数是是经过 express 封装的 req 和 res 对象.\n    cgiMock(/\\/function$/, (req, res) => {\n        res.send('function test');\n    });\n\n    // 返回文本 readFileSync\n    cgiMock('/file', utils.file('./package.json'));\n\n    // 更复杂的规则配置\n    cgiMock({\n        url: /\\/who/,\n        method: 'GET',\n        result(req, res) {\n            if (req.query.name === 'kwan') {\n                res.json({ kwan: '孤独患者' });\n            } else {\n                res.send('Nooooooooooo');\n            }\n        },\n        headers: {\n            'Content-Type': 'text/plain',\n            'Content-Length': '123',\n            ETag: '12345'\n        },\n        cookies: [\n            {\n                name: 'myname', value: 'kwan', maxAge: 900000, httpOnly: true\n            }\n        ]\n    });\n\n    // 携带参数的请求\n    cgiMock('/v2/audit/list', (req, res) => {\n        const {\n            currentPage, pageSize, isAudited\n        } = req.body;\n        res.send({\n            code: '0',\n            msg: '',\n            data: {\n                currentPage,\n                pageSize,\n                totalPage: 2,\n                totalCount: 12,\n                pageData: Array.from({ length: pageSize }, () => ({\n                    title: Random.title(),\n                    authorName: Random.cname(),\n                    authorId: Random.name(),\n                    createTime: Date.now(),\n                    updateTime: Date.now(),\n                    readCount: Random.integer(60, 1000),\n                    favoriteCount: Random.integer(1, 50),\n                    postId: '12323',\n                    serviceTag: '业务类型',\n                    productTag: '产品类型',\n                    requestTag: '需求类型',\n                    handleTag: '已采纳',\n                    postType: 'voice',\n                    postStatus: isAudited ? 'pass' : 'auditing',\n                    auditStatus: 'audit1'\n                }))\n            }\n        });\n    });\n\n    // multipart/form-data 类型\n    cgiMock('/v2/upload', (req, res) => {\n        res.send({\n            code: '0',\n            msg: '文件上传成功'\n        });\n    });\n};\n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130

cgiMock \b参数

创建一个 mock 接口,参数非常灵活,参考上面的 demo 即可。

mockjs 参数

',12),e={href:"http://mockjs.com/",target:"_blank",rel:"noopener noreferrer"},o=(0,p.Uk)("Mock.js"),c=(0,p.Uk)(" 是常用的辅助生成模拟数据的三方库,借助他可以提升我们的 mock 数据能力。"),l=(0,p.uE)('

比如:

export default function ({ cgiMock, mockjs, utils }) {\n    cgiMock('/random', mockjs.mock({\n        'string|1-10': '★'\n    }));\n}\n
1
2
3
4
5

utils 参数

工具函数:

  • utils.file(path),从项目根目录根据path寻找文件,返回文件流。

配置 Mock

',6),r=(0,p.Uk)("详见配置 "),u=(0,p.Uk)("mock"),i=(0,p.Uk)("。"),k=(0,p.uE)('

关闭 Mock

可以通过配置关闭。

export default {\n    mock: false,\n};\n
1
2
3
',3),b={},m=(0,a(3744).Z)(b,[["render",function(n,s){const a=(0,p.up)("OutboundLink"),b=(0,p.up)("RouterLink");return(0,p.wg)(),(0,p.iD)(p.HY,null,[t,(0,p._)("p",null,[(0,p._)("a",e,[o,(0,p.Wm)(a)]),c]),l,(0,p._)("p",null,[r,(0,p.Wm)(b,{to:"/reference/config/#mock"},{default:(0,p.w5)((()=>[u])),_:1}),i]),k],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[754],{6285:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-00cf7e23",path:"/guide/mock.html",title:"Mock 数据",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"约定式 Mock 文件",slug:"约定式-mock-文件",children:[]},{level:2,title:"编写 Mock 文件",slug:"编写-mock-文件",children:[{level:3,title:"cgiMock \b参数",slug:"cgimock-参数",children:[]},{level:3,title:"mockjs 参数",slug:"mockjs-参数",children:[]},{level:3,title:"utils 参数",slug:"utils-参数",children:[]}]},{level:2,title:"配置 Mock",slug:"配置-mock",children:[]},{level:2,title:"关闭 Mock",slug:"关闭-mock",children:[]}],filePathRelative:"guide/mock.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5808:(n,s,a)=>{a.r(s),a.d(s,{default:()=>r});var p=a(6252);const t=(0,p.uE)('

Mock 数据

Mock 数据是前端开发过程中必不可少的一环,是分离前后端开发的关键链路。通过预先跟服务器端约定好的接口,模拟请求数据甚至逻辑,能够让前端开发独立自主,不会被服务端的开发所阻塞。

约定式 Mock 文件

Fes.js 约定 ./mock.js 为 mock 文件。

比如:

.\n├── mock.js\n└── src\n    └── pages\n        └── index.vue\n
1
2
3
4
5

编写 Mock 文件

可以参考如下 🌰:

export default function ({ cgiMock, mockjs, utils }) {\n    const { Random } = mockjs;\n\n    // 测试 proxy 与 mock 用例集合\n    cgiMock('/movie/in_theaters_mock', (req, res) => {\n        res.send(JSON.stringify({\n            code: '0',\n            msg: '',\n            result: {\n                text: 'movie:  movie/in_theaters_mock ~~~~~'\n            }\n        }));\n    });\n    cgiMock('/movie/test_mock', (req, res) => {\n        res.send(JSON.stringify({\n            code: '0',\n            msg: '',\n            result: {\n                text: 'mock:  movie/test_mock'\n            }\n        }));\n    });\n\n    // 测试用例: mock.js change,重现请求,需要能拉最新的数据\n    cgiMock('/watchtest', (req, res) => {\n        res.send(JSON.stringify({\n            code: '0',\n            msg: '',\n            result: {\n                text: '通过 register 测试 mock watch: 初始状态'\n            }\n        }));\n    });\n\n    // 返回一个数字\n    // cgiMock('/number', 666);\n    cgiMock('/number', 999);\n\n    // 返回一个json\n    cgiMock({\n        url: '/json',\n        result: {\n            code: '400101', msg: "不合法的请求:Missing cookie 'wb_app_id' for method parameter of type String", transactionTime: '20170309171146', success: false\n        }\n    });\n\n    // 利用 mock.js 产生随机文本\n    cgiMock('/text', Random.cparagraph());\n\n    // 返回一个字符串 利用 mock.js 产生随机字符\n    cgiMock('/random', mockjs.mock({\n        'string|1-10': '★'\n    }));\n\n    // 正则匹配url, 返回一个字符串\n    cgiMock(/\\/abc|\\/xyz/, 'regexp test!');\n\n    // option.result 参数如果是一个函数, 可以实现自定义返回内容, 接收的参数是是经过 express 封装的 req 和 res 对象.\n    cgiMock(/\\/function$/, (req, res) => {\n        res.send('function test');\n    });\n\n    // 返回文本 readFileSync\n    cgiMock('/file', utils.file('./package.json'));\n\n    // 更复杂的规则配置\n    cgiMock({\n        url: /\\/who/,\n        method: 'GET',\n        result(req, res) {\n            if (req.query.name === 'kwan') {\n                res.json({ kwan: '孤独患者' });\n            } else {\n                res.send('Nooooooooooo');\n            }\n        },\n        headers: {\n            'Content-Type': 'text/plain',\n            'Content-Length': '123',\n            ETag: '12345'\n        },\n        cookies: [\n            {\n                name: 'myname', value: 'kwan', maxAge: 900000, httpOnly: true\n            }\n        ]\n    });\n\n    // 携带参数的请求\n    cgiMock('/v2/audit/list', (req, res) => {\n        const {\n            currentPage, pageSize, isAudited\n        } = req.body;\n        res.send({\n            code: '0',\n            msg: '',\n            data: {\n                currentPage,\n                pageSize,\n                totalPage: 2,\n                totalCount: 12,\n                pageData: Array.from({ length: pageSize }, () => ({\n                    title: Random.title(),\n                    authorName: Random.cname(),\n                    authorId: Random.name(),\n                    createTime: Date.now(),\n                    updateTime: Date.now(),\n                    readCount: Random.integer(60, 1000),\n                    favoriteCount: Random.integer(1, 50),\n                    postId: '12323',\n                    serviceTag: '业务类型',\n                    productTag: '产品类型',\n                    requestTag: '需求类型',\n                    handleTag: '已采纳',\n                    postType: 'voice',\n                    postStatus: isAudited ? 'pass' : 'auditing',\n                    auditStatus: 'audit1'\n                }))\n            }\n        });\n    });\n\n    // multipart/form-data 类型\n    cgiMock('/v2/upload', (req, res) => {\n        res.send({\n            code: '0',\n            msg: '文件上传成功'\n        });\n    });\n};\n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130

cgiMock \b参数

创建一个 mock 接口,参数非常灵活,参考上面的 demo 即可。

mockjs 参数

',12),e={href:"http://mockjs.com/",target:"_blank",rel:"noopener noreferrer"},o=(0,p.uE)('

比如:

export default function ({ cgiMock, mockjs, utils }) {\n    cgiMock('/random', mockjs.mock({\n        'string|1-10': '★'\n    }));\n}\n
1
2
3
4
5

utils 参数

工具函数:

  • utils.file(path),从项目根目录根据path寻找文件,返回文件流。

配置 Mock

',6),c=(0,p.uE)('

关闭 Mock

可以通过配置关闭。

export default {\n    mock: false,\n};\n
1
2
3
',3),l={},r=(0,a(3744).Z)(l,[["render",function(n,s){const a=(0,p.up)("OutboundLink"),l=(0,p.up)("RouterLink");return(0,p.wg)(),(0,p.iD)(p.HY,null,[t,(0,p._)("p",null,[(0,p._)("a",e,[(0,p.Uk)("Mock.js"),(0,p.Wm)(a)]),(0,p.Uk)(" 是常用的辅助生成模拟数据的三方库,借助他可以提升我们的 mock 数据能力。")]),o,(0,p._)("p",null,[(0,p.Uk)("详见配置 "),(0,p.Wm)(l,{to:"/reference/config/#mock"},{default:(0,p.w5)((()=>[(0,p.Uk)("mock")])),_:1}),(0,p.Uk)("。")]),c],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-040800dc.1f1fb9d5.js b/assets/js/v-040800dc.1f1fb9d5.js new file mode 100644 index 00000000..b58dcdef --- /dev/null +++ b/assets/js/v-040800dc.1f1fb9d5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[256],{8145:(s,n,a)=>{a.r(n),a.d(n,{data:()=>e});const e={key:"v-040800dc",path:"/guide/directory-structure.html",title:"目录结构",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:3,title:"package.json",slug:"package-json",children:[]},{level:3,title:"tsconfig.json",slug:"tsconfig-json",children:[]},{level:3,title:".fes.js",slug:"fes-js",children:[]},{level:3,title:"mock.js",slug:"mock-js",children:[]},{level:3,title:".env",slug:"env",children:[]},{level:3,title:"dist 目录",slug:"dist-目录",children:[]},{level:2,title:"public 目录",slug:"public-目录",children:[{level:3,title:"index.html",slug:"index-html",children:[]}]},{level:2,title:"src 目录",slug:"src-目录",children:[{level:3,title:".fes 目录",slug:"fes-目录",children:[]},{level:3,title:"pages 目录",slug:"pages-目录",children:[]},{level:3,title:"app.js",slug:"app-js",children:[]}]}],filePathRelative:"guide/directory-structure.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},1842:(s,n,a)=>{a.r(n),a.d(n,{default:()=>l});var e=a(6252);const p=(0,e._)("h1",{id:"目录结构",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#目录结构","aria-hidden":"true"},"#"),(0,e.Uk)(" 目录结构")],-1),t=(0,e._)("code",null,"约定优于配置",-1),o=(0,e.uE)('
fes-template\n├── package.json\n├── tsconfig.json\n├── mock.js\n├── .fes.js\n├── .env\n├── dist\n├── public\n│   └── index.html\n└── src\n    ├── .fes\n    └── pages\n    │    └── index.vue\n    └── app.js\n
1
2
3
4
5
6
7
8
9
10
11
12
13
14

package.json

{\n    "name": "@fesjs/template",\n    "version": "2.0.0",\n    "description": "fes项目模版",\n    "scripts": {\n        "build": "fes build",\n        "prod": "FES_ENV=prod fes build",\n        "analyze": "ANALYZE=1 fes build",\n        "dev": "fes dev",\n        "test": "fes test"\n    },\n    "keywords": ["管理端", "fes", "fast", "easy", "strong"],\n    "files": [\n        ".eslintrc.js",\n        ".gitignore",\n        ".fes.js",\n        ".fes.prod.js",\n        "mock.js",\n        "package.json",\n        "README.md",\n        "tsconfig.json",\n        "/src",\n        "/config"\n    ],\n    "repository": {\n        "type": "git",\n        "url": "git+https://github.com/WeBankFinTech/fes.js.git",\n        "directory": "packages/fes-template"\n    },\n    "author": "harrywan",\n    "license": "MIT",\n    "bugs": {\n        "url": "https://github.com/WeBankFinTech/fes.js/issues"\n    },\n    "homepage": "https://github.com/WeBankFinTech/fes.js#readme",\n    "publishConfig": {\n        "access": "public"\n    },\n    "devDependencies": {\n        "@webank/eslint-config-webank": "0.3.1"\n    },\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-access": "^2.0.0",\n        "@fesjs/plugin-layout": "^3.0.0",\n        "@fesjs/plugin-locale": "^3.0.0",\n        "@fesjs/plugin-model": "^2.0.0",\n        "@fesjs/plugin-enums": "^2.0.0",\n        "@fesjs/plugin-jest": "^2.0.0",\n        "@fesjs/plugin-vuex": "^2.0.0",\n        "@fesjs/plugin-request": "^2.0.0",\n        "@fesjs/plugin-qiankun": "^2.0.0",\n        "@fesjs/plugin-sass": "^2.0.0",\n        "@fesjs/plugin-monaco-editor": "^2.0.0-beta.0",\n        "@fesjs/plugin-windicss": "^2.0.0",\n        "@fesjs/fes-design": "^0.5.0",\n        "vue": "^3.0.5",\n        "vuex": "^4.0.0"\n    },\n    "private": true\n}\n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

其中@fesjs/fes是 Fes.js 核心依赖,另外以 @fesjs/preset-@fesjs/plugin-@webank/fes-preset-@webank/fes-plugin-fes-preset-fes-plugin- 开头的依赖会被自动注册为插件或插件集。

tsconfig.json

解决 @fesjs/fes 和使用 @ 的 API 提示

.fes.js

配置文件,包含 Fes.js 内置功能和安装的其他插件配置。

mock.js

mock 数据的配置文件。

.env

定义环境变量。

比如 .env 文件内容如下:

PORT=8888\nFES_ENV=prod\n
1
2

等同于 node 端运行时,设置如下:

process.env.PORT = '8888';\nprocess.env.FES_ENV = 'prod';\n
1
2

dist 目录

执行 fes build 后,产物默认会存放在这里。

public 目录

此目录下所有文件为静态资源,会被复制到输出路径。

index.html

默认的 html 模板文件,如果删除此 html 则会使用内置的 html 模板文件。

src 目录

.fes 目录

临时文件目录,比如入口文件、路由等,都会被临时生成到这里。

注意

不要提交 .fes 目录到 git 仓库,他们会在 fes devfes build 时被删除并重新生成。

pages 目录

所有路由组件文件存放在这里。

app.js

运行时配置文件,可以在这里扩展运行时的能力,比如修改路由等。

',30),r={},l=(0,a(3744).Z)(r,[["render",function(s,n){const a=(0,e.up)("RouterLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,(0,e._)("p",null,[(0,e.Uk)("在"),(0,e.Wm)(a,{to:"/guide/getting-started.html"},{default:(0,e.w5)((()=>[(0,e.Uk)("快速上手")])),_:1}),(0,e.Uk)("中,大家对框架应该有初步的印象,接下来我们了解下目录结构。Fes.js 遵循 "),t,(0,e.Uk)(" 的原则,一个基础的 Fes.js 项目大致是这样的:")]),o],64)}]])},3744:(s,n)=>{n.Z=(s,n)=>{const a=s.__vccOpts||s;for(const[s,e]of n)a[s]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-040800dc.323836dd.js b/assets/js/v-040800dc.323836dd.js deleted file mode 100644 index 9719a03d..00000000 --- a/assets/js/v-040800dc.323836dd.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[256],{8145:(s,n,a)=>{a.r(n),a.d(n,{data:()=>e});const e={key:"v-040800dc",path:"/guide/directory-structure.html",title:"目录结构",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:3,title:"package.json",slug:"package-json",children:[]},{level:3,title:"tsconfig.json",slug:"tsconfig-json",children:[]},{level:3,title:".fes.js",slug:"fes-js",children:[]},{level:3,title:"mock.js",slug:"mock-js",children:[]},{level:3,title:".env",slug:"env",children:[]},{level:3,title:"dist 目录",slug:"dist-目录",children:[]},{level:2,title:"public 目录",slug:"public-目录",children:[{level:3,title:"index.html",slug:"index-html",children:[]}]},{level:2,title:"src 目录",slug:"src-目录",children:[{level:3,title:".fes 目录",slug:"fes-目录",children:[]},{level:3,title:"pages 目录",slug:"pages-目录",children:[]},{level:3,title:"app.js",slug:"app-js",children:[]}]}],filePathRelative:"guide/directory-structure.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},1842:(s,n,a)=>{a.r(n),a.d(n,{default:()=>k});var e=a(6252);const p=(0,e._)("h1",{id:"目录结构",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#目录结构","aria-hidden":"true"},"#"),(0,e.Uk)(" 目录结构")],-1),t=(0,e.Uk)("在"),o=(0,e.Uk)("快速上手"),r=(0,e.Uk)("中,大家对框架应该有初步的印象,接下来我们了解下目录结构。Fes.js 遵循 "),l=(0,e._)("code",null,"约定优于配置",-1),c=(0,e.Uk)(" 的原则,一个基础的 Fes.js 项目大致是这样的:"),u=(0,e.uE)('
fes-template\n├── package.json\n├── tsconfig.json\n├── mock.js\n├── .fes.js\n├── .env\n├── dist\n├── public\n│   └── index.html\n└── src\n    ├── .fes\n    └── pages\n    │    └── index.vue\n    └── app.js\n
1
2
3
4
5
6
7
8
9
10
11
12
13
14

package.json

{\n    "name": "@fesjs/template",\n    "version": "2.0.0",\n    "description": "fes项目模版",\n    "scripts": {\n        "build": "fes build",\n        "prod": "FES_ENV=prod fes build",\n        "analyze": "ANALYZE=1 fes build",\n        "dev": "fes dev",\n        "test": "fes test"\n    },\n    "keywords": ["管理端", "fes", "fast", "easy", "strong"],\n    "files": [\n        ".eslintrc.js",\n        ".gitignore",\n        ".fes.js",\n        ".fes.prod.js",\n        "mock.js",\n        "package.json",\n        "README.md",\n        "tsconfig.json",\n        "/src",\n        "/config"\n    ],\n    "repository": {\n        "type": "git",\n        "url": "git+https://github.com/WeBankFinTech/fes.js.git",\n        "directory": "packages/fes-template"\n    },\n    "author": "harrywan",\n    "license": "MIT",\n    "bugs": {\n        "url": "https://github.com/WeBankFinTech/fes.js/issues"\n    },\n    "homepage": "https://github.com/WeBankFinTech/fes.js#readme",\n    "publishConfig": {\n        "access": "public"\n    },\n    "devDependencies": {\n        "@webank/eslint-config-webank": "0.3.1"\n    },\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-access": "^2.0.0",\n        "@fesjs/plugin-layout": "^3.0.0",\n        "@fesjs/plugin-locale": "^3.0.0",\n        "@fesjs/plugin-model": "^2.0.0",\n        "@fesjs/plugin-enums": "^2.0.0",\n        "@fesjs/plugin-jest": "^2.0.0",\n        "@fesjs/plugin-vuex": "^2.0.0",\n        "@fesjs/plugin-request": "^2.0.0",\n        "@fesjs/plugin-qiankun": "^2.0.0",\n        "@fesjs/plugin-sass": "^2.0.0",\n        "@fesjs/plugin-monaco-editor": "^2.0.0-beta.0",\n        "@fesjs/plugin-windicss": "^2.0.0",\n        "@fesjs/fes-design": "^0.5.0",\n        "vue": "^3.0.5",\n        "vuex": "^4.0.0"\n    },\n    "private": true\n}\n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

其中@fesjs/fes是 Fes.js 核心依赖,另外以 @fesjs/preset-@fesjs/plugin-@webank/fes-preset-@webank/fes-plugin-fes-preset-fes-plugin- 开头的依赖会被自动注册为插件或插件集。

tsconfig.json

解决 @fesjs/fes 和使用 @ 的 API 提示

.fes.js

配置文件,包含 Fes.js 内置功能和安装的其他插件配置。

mock.js

mock 数据的配置文件。

.env

定义环境变量。

比如 .env 文件内容如下:

PORT=8888\nFES_ENV=prod\n
1
2

等同于 node 端运行时,设置如下:

process.env.PORT = '8888';\nprocess.env.FES_ENV = 'prod';\n
1
2

dist 目录

执行 fes build 后,产物默认会存放在这里。

public 目录

此目录下所有文件为静态资源,会被复制到输出路径。

index.html

默认的 html 模板文件,如果删除此 html 则会使用内置的 html 模板文件。

src 目录

.fes 目录

临时文件目录,比如入口文件、路由等,都会被临时生成到这里。

注意

不要提交 .fes 目录到 git 仓库,他们会在 fes devfes build 时被删除并重新生成。

pages 目录

所有路由组件文件存放在这里。

app.js

运行时配置文件,可以在这里扩展运行时的能力,比如修改路由等。

',30),i={},k=(0,a(3744).Z)(i,[["render",function(s,n){const a=(0,e.up)("RouterLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,(0,e._)("p",null,[t,(0,e.Wm)(a,{to:"/guide/getting-started.html"},{default:(0,e.w5)((()=>[o])),_:1}),r,l,c]),u],64)}]])},3744:(s,n)=>{n.Z=(s,n)=>{const a=s.__vccOpts||s;for(const[s,e]of n)a[s]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-0a0e491c.556a9e41.js b/assets/js/v-0a0e491c.37f99a72.js similarity index 98% rename from assets/js/v-0a0e491c.556a9e41.js rename to assets/js/v-0a0e491c.37f99a72.js index 59ae2c0a..76b1cfb8 100644 --- a/assets/js/v-0a0e491c.556a9e41.js +++ b/assets/js/v-0a0e491c.37f99a72.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[312],{3442:(e,n,t)=>{t.r(n),t.d(n,{data:()=>s});const s={key:"v-0a0e491c",path:"/reference/plugin/plugins/icon.html",title:"@fesjs/plugin-icon",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"使用",slug:"使用",children:[{level:3,title:"属性",slug:"属性",children:[]}]}],filePathRelative:"reference/plugin/plugins/icon.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},8645:(e,n,t)=>{t.r(n),t.d(n,{default:()=>l});const s=(0,t(6252).uE)('

@fesjs/plugin-icon

介绍

提供以 component 的方式,直接使用 svg icon 的能力。

启用方式

package.json 中引入依赖:

{\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-icon": "^2.0.0"\n    },\n}\n
1
2
3
4
5
6

使用

新建 src/icons 目录,将 svg 文件放入其中,在 component 中引用:

<fes-icon type="iconName" />\n
1

属性

属性说明类型
typesvg 文件名string
spin是否无限旋转boolean
rotate旋转角度number
',11),a={},l=(0,t(3744).Z)(a,[["render",function(e,n){return s}]])},3744:(e,n)=>{n.Z=(e,n)=>{const t=e.__vccOpts||e;for(const[e,s]of n)t[e]=s;return t}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[312],{3442:(e,n,t)=>{t.r(n),t.d(n,{data:()=>s});const s={key:"v-0a0e491c",path:"/reference/plugin/plugins/icon.html",title:"@fesjs/plugin-icon",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"使用",slug:"使用",children:[{level:3,title:"属性",slug:"属性",children:[]}]}],filePathRelative:"reference/plugin/plugins/icon.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},8645:(e,n,t)=>{t.r(n),t.d(n,{default:()=>l});const s=(0,t(6252).uE)('

@fesjs/plugin-icon

介绍

提供以 component 的方式,直接使用 svg icon 的能力。

启用方式

package.json 中引入依赖:

{\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-icon": "^2.0.0"\n    },\n}\n
1
2
3
4
5
6

使用

新建 src/icons 目录,将 svg 文件放入其中,在 component 中引用:

<fes-icon type="iconName" />\n
1

属性

属性说明类型
typesvg 文件名string
spin是否无限旋转boolean
rotate旋转角度number
',11),a={},l=(0,t(3744).Z)(a,[["render",function(e,n){return s}]])},3744:(e,n)=>{n.Z=(e,n)=>{const t=e.__vccOpts||e;for(const[e,s]of n)t[e]=s;return t}}}]); \ No newline at end of file diff --git a/assets/js/v-1c0edac3.54f56448.js b/assets/js/v-1c0edac3.fe469da8.js similarity index 98% rename from assets/js/v-1c0edac3.54f56448.js rename to assets/js/v-1c0edac3.fe469da8.js index 6370b83b..d69fe808 100644 --- a/assets/js/v-1c0edac3.54f56448.js +++ b/assets/js/v-1c0edac3.fe469da8.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[835],{4710:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-1c0edac3",path:"/reference/plugin/plugins/watermark.html",title:"@fesjs/plugin-watermark",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"编译时配置",slug:"编译时配置",children:[{level:3,title:"disabled",slug:"disabled",children:[]}]},{level:2,title:"API",slug:"api",children:[{level:3,title:"createWatermark",slug:"createwatermark",children:[]}]}],filePathRelative:"reference/plugin/plugins/watermark.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5243:(n,s,a)=>{a.r(s),a.d(s,{default:()=>t});const e=(0,a(6252).uE)('

@fesjs/plugin-watermark

介绍

给页面添加水印效果

启用方式

package.json 中引入依赖:

{\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-watermark": "^2.0.0"\n    }\n}\n
1
2
3
4
5
6

编译时配置

export default {\n    watermark: {\n        disabled: false\n    },\n}\n
1
2
3
4
5

disabled

是否禁用水印,默认是false

可以在开发环境关闭水印:

export default {\n    watermark: {\n        disabled: true\n    },\n}\n
1
2
3
4
5

API

createWatermark

创建水印功能,通过 @fesjs/fes 导入 API:

import { createWatermark, destroyWatermark } from '@fesjs/fes';\n\ncreateWatermark({ content: '我是水印' }); // 生成水印\ndestroyWatermark(); // 销毁水印\n
1
2
3
4

默认参数是:

{\n    content = '请勿外传',\n    container = document.body,\n    width = 300,\n    height = 300,\n    textAlign = 'center',\n    textBaseline = 'middle',\n    fontSize = '14px',\n    fontFamily = 'Microsoft Yahei',\n    fillStyle = 'rgba(184, 184, 184, 0.3)',\n    rotate = 25,\n    zIndex = 99999,\n    timestamp = 'YYYY-MM-DD HH:mm'\n}\n
1
2
3
4
5
6
7
8
9
10
11
12
13
14

如果不需要时间戳,则可以设置timestampfalse

',19),p={},t=(0,a(3744).Z)(p,[["render",function(n,s){return e}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[835],{4710:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-1c0edac3",path:"/reference/plugin/plugins/watermark.html",title:"@fesjs/plugin-watermark",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"编译时配置",slug:"编译时配置",children:[{level:3,title:"disabled",slug:"disabled",children:[]}]},{level:2,title:"API",slug:"api",children:[{level:3,title:"createWatermark",slug:"createwatermark",children:[]}]}],filePathRelative:"reference/plugin/plugins/watermark.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5243:(n,s,a)=>{a.r(s),a.d(s,{default:()=>t});const e=(0,a(6252).uE)('

@fesjs/plugin-watermark

介绍

给页面添加水印效果

启用方式

package.json 中引入依赖:

{\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-watermark": "^2.0.0"\n    }\n}\n
1
2
3
4
5
6

编译时配置

export default {\n    watermark: {\n        disabled: false\n    },\n}\n
1
2
3
4
5

disabled

是否禁用水印,默认是false

可以在开发环境关闭水印:

export default {\n    watermark: {\n        disabled: true\n    },\n}\n
1
2
3
4
5

API

createWatermark

创建水印功能,通过 @fesjs/fes 导入 API:

import { createWatermark, destroyWatermark } from '@fesjs/fes';\n\ncreateWatermark({ content: '我是水印' }); // 生成水印\ndestroyWatermark(); // 销毁水印\n
1
2
3
4

默认参数是:

{\n    content = '请勿外传',\n    container = document.body,\n    width = 300,\n    height = 300,\n    textAlign = 'center',\n    textBaseline = 'middle',\n    fontSize = '14px',\n    fontFamily = 'Microsoft Yahei',\n    fillStyle = 'rgba(184, 184, 184, 0.3)',\n    rotate = 25,\n    zIndex = 99999,\n    timestamp = 'YYYY-MM-DD HH:mm'\n}\n
1
2
3
4
5
6
7
8
9
10
11
12
13
14

如果不需要时间戳,则可以设置timestampfalse

',19),p={},t=(0,a(3744).Z)(p,[["render",function(n,s){return e}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-1d14d5cc.b570a951.js b/assets/js/v-1d14d5cc.f6b678f3.js similarity index 99% rename from assets/js/v-1d14d5cc.b570a951.js rename to assets/js/v-1d14d5cc.f6b678f3.js index a2e0762a..b49b963f 100644 --- a/assets/js/v-1d14d5cc.b570a951.js +++ b/assets/js/v-1d14d5cc.f6b678f3.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[507],{494:(s,e,n)=>{n.r(e),n.d(e,{data:()=>a});const a={key:"v-1d14d5cc",path:"/guide/plugin.html",title:"插件",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"插件的 id 和 key",slug:"插件的-id-和-key",children:[]},{level:2,title:"启动插件",slug:"启动插件",children:[{level:3,title:"package.json 依赖",slug:"package-json-依赖",children:[]},{level:3,title:"配置",slug:"配置",children:[]},{level:3,title:"环境变量",slug:"环境变量",children:[]}]},{level:2,title:"禁用插件",slug:"禁用插件",children:[]},{level:2,title:"配置插件",slug:"配置插件",children:[]}],filePathRelative:"guide/plugin.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},9959:(s,e,n)=>{n.r(e),n.d(e,{default:()=>o});const a=(0,n(6252).uE)('

插件

插件的 id 和 key

每个插件都会对应一个 id 和一个 keyid 是路径的简写,key 是进一步简化后用于配置的唯一值

比如插件 /node_modules/@fesjs/plugin-foo/index.js,通常来说,其 id@fesjs/plugin-fookeyfoo

提示

id 一般用不上,对于普通开发者 key 用来配置插件,而插件开发者可以使用 key 判断是否安装某个插件。

启动插件

有多种方式引入插件

package.json 依赖

Fes.js 会自动检测 dependenciesdevDependencies 里的 fes 插件,比如:

{\n  "dependencies": {\n    "@fesjs/plugin-request": "^2.0.0"\n  }\n}\n
1
2
3
4
5

那么 @fesjs/plugin-request 会自动被注册,无需在配置里重复声明。

配置

在配置里可通过 presetsplugins 配置插件,比如:

export default {\n    presets: ['./preset', 'foo/presets'],\n    plugins: ['./plugin'],\n}\n
1
2
3
4

通常用于几种情况:

  1. 项目相对路径的插件
  2. 非 npm 包入口文件的插件

注意

请不要配置 npm 包的插件,否则会报重复注册的错误

环境变量

还可通过环境变量 FES_PRESETSFES_PLUGINS 注册额外插件。

比如:

FES_PRESETS=/a/b/preset.js fes dev\n
1

禁用插件

通过配置插件的 keyfalse,比如:

export default {\n    mock: false,\n}\n
1
2
3

Mock 插件的 keymock,我们在配置文件中配置 mockfalse,则会禁用 Mock 插件及其功能。

配置插件

通过插件的 key 来配置插件,比如:

export default {\n    mock: { \n        prefix: '/v2'\n    }\n}\n
1
2
3
4
5

这里的 mock 是 Mock插件 的 key。

',29),p={},o=(0,n(3744).Z)(p,[["render",function(s,e){return a}]])},3744:(s,e)=>{e.Z=(s,e)=>{const n=s.__vccOpts||s;for(const[s,a]of e)n[s]=a;return n}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[507],{494:(s,e,n)=>{n.r(e),n.d(e,{data:()=>a});const a={key:"v-1d14d5cc",path:"/guide/plugin.html",title:"插件",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"插件的 id 和 key",slug:"插件的-id-和-key",children:[]},{level:2,title:"启动插件",slug:"启动插件",children:[{level:3,title:"package.json 依赖",slug:"package-json-依赖",children:[]},{level:3,title:"配置",slug:"配置",children:[]},{level:3,title:"环境变量",slug:"环境变量",children:[]}]},{level:2,title:"禁用插件",slug:"禁用插件",children:[]},{level:2,title:"配置插件",slug:"配置插件",children:[]}],filePathRelative:"guide/plugin.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},9959:(s,e,n)=>{n.r(e),n.d(e,{default:()=>o});const a=(0,n(6252).uE)('

插件

插件的 id 和 key

每个插件都会对应一个 id 和一个 keyid 是路径的简写,key 是进一步简化后用于配置的唯一值

比如插件 /node_modules/@fesjs/plugin-foo/index.js,通常来说,其 id@fesjs/plugin-fookeyfoo

提示

id 一般用不上,对于普通开发者 key 用来配置插件,而插件开发者可以使用 key 判断是否安装某个插件。

启动插件

有多种方式引入插件

package.json 依赖

Fes.js 会自动检测 dependenciesdevDependencies 里的 fes 插件,比如:

{\n  "dependencies": {\n    "@fesjs/plugin-request": "^2.0.0"\n  }\n}\n
1
2
3
4
5

那么 @fesjs/plugin-request 会自动被注册,无需在配置里重复声明。

配置

在配置里可通过 presetsplugins 配置插件,比如:

export default {\n    presets: ['./preset', 'foo/presets'],\n    plugins: ['./plugin'],\n}\n
1
2
3
4

通常用于几种情况:

  1. 项目相对路径的插件
  2. 非 npm 包入口文件的插件

注意

请不要配置 npm 包的插件,否则会报重复注册的错误

环境变量

还可通过环境变量 FES_PRESETSFES_PLUGINS 注册额外插件。

比如:

FES_PRESETS=/a/b/preset.js fes dev\n
1

禁用插件

通过配置插件的 keyfalse,比如:

export default {\n    mock: false,\n}\n
1
2
3

Mock 插件的 keymock,我们在配置文件中配置 mockfalse,则会禁用 Mock 插件及其功能。

配置插件

通过插件的 key 来配置插件,比如:

export default {\n    mock: { \n        prefix: '/v2'\n    }\n}\n
1
2
3
4
5

这里的 mock 是 Mock插件 的 key。

',29),p={},o=(0,n(3744).Z)(p,[["render",function(s,e){return a}]])},3744:(s,e)=>{e.Z=(s,e)=>{const n=s.__vccOpts||s;for(const[s,a]of e)n[s]=a;return n}}}]); \ No newline at end of file diff --git a/assets/js/v-2c05b6e0.7edc12ad.js b/assets/js/v-2c05b6e0.7edc12ad.js new file mode 100644 index 00000000..0362ace8 --- /dev/null +++ b/assets/js/v-2c05b6e0.7edc12ad.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[960],{5822:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-2c05b6e0",path:"/reference/config/",title:"配置",lang:"zh-CN",frontmatter:{sidebar:"auto"},excerpt:"",headers:[{level:2,title:"alias",slug:"alias",children:[]},{level:2,title:"analyze",slug:"analyze",children:[]},{level:2,title:"autoprefixer",slug:"autoprefixer",children:[]},{level:2,title:"base",slug:"base",children:[]},{level:2,title:"chainWebpack",slug:"chainwebpack",children:[]},{level:2,title:"cssLoader",slug:"cssloader",children:[]},{level:2,title:"copy",slug:"copy",children:[]},{level:2,title:"define",slug:"define",children:[]},{level:2,title:"devServer",slug:"devserver",children:[]},{level:2,title:"devtool",slug:"devtool",children:[]},{level:2,title:"dynamicImport",slug:"dynamicimport",children:[]},{level:2,title:"exportStatic",slug:"exportstatic",children:[]},{level:2,title:"externals",slug:"externals",children:[]},{level:2,title:"extraBabelPlugins",slug:"extrababelplugins",children:[]},{level:2,title:"extraBabelPresets",slug:"extrababelpresets",children:[]},{level:2,title:"extraPostCSSPlugins",slug:"extrapostcssplugins",children:[]},{level:2,title:"html",slug:"html",children:[]},{level:2,title:"inlineLimit",slug:"inlinelimit",children:[]},{level:2,title:"lessLoader",slug:"lessloader",children:[]},{level:2,title:"mock",slug:"mock",children:[]},{level:2,title:"mountElementId",slug:"mountelementid",children:[]},{level:2,title:"nodeModulesTransform",slug:"nodemodulestransform",children:[]},{level:2,title:"outputPath",slug:"outputpath",children:[]},{level:2,title:"plugins",slug:"plugins",children:[]},{level:2,title:"postcssLoader",slug:"postcssloader",children:[]},{level:2,title:"proxy",slug:"proxy",children:[]},{level:2,title:"publicPath",slug:"publicpath",children:[]},{level:2,title:"router",slug:"router",children:[]},{level:2,title:"singular",slug:"singular",children:[]},{level:2,title:"targets",slug:"targets",children:[]},{level:2,title:"terserOptions",slug:"terseroptions",children:[]},{level:2,title:"vueLoader",slug:"vueloader",children:[]},{level:2,title:"更多配置项",slug:"更多配置项",children:[]}],filePathRelative:"reference/config/README.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},502:(n,s,a)=>{a.r(s),a.d(s,{default:()=>an});var e=a(6252);const p=(0,e.uE)('

配置

以下配置项通过字母排序。

alias

  • 类型: object

  • 默认值: {}

  • 详情:

    配置别名,对引用路径进行映射。

  • 示例:

export default {\n    alias: {\n       main: 'src/assets/styles/main'\n    }\n}\n
1
2
3
4
5

然后 import('main'),实际上是 import('src/assets/styles/main')

analyze

  • 类型: object
  • 默认值:
{\n    analyzerMode: process.env.ANALYZE_MODE || 'server',\n    analyzerPort: process.env.ANALYZE_PORT || 8888,\n    openAnalyzer: process.env.ANALYZE_OPEN !== 'none',\n    // generate stats file while ANALYZE_DUMP exist\n    generateStatsFile: !!process.env.ANALYZE_DUMP,\n    statsFilename: process.env.ANALYZE_DUMP || 'stats.json',\n    logLevel: process.env.ANALYZE_LOG_LEVEL || 'info',\n    defaultSizes: 'parsed' // stat  // gzip\n}\n
1
2
3
4
5
6
7
8
9
10
  • 详情:

    构建结果分析,当配置 process.env.ANALYZE 时开启,例如执行ANALYZE=1 fes build

autoprefixer

  • 类型: object
  • 默认值:
{\n    flexbox: 'no-2009'\n}\n
1
2
3
',13),l=(0,e._)("p",null,"详情:",-1),t={href:"https://github.com/postcss/autoprefixer#options",target:"_blank",rel:"noopener noreferrer"},o=(0,e.uE)('

base

  • 类型: string

  • 默认值: ''

  • 详情:

    设置路由前缀,通常用于部署到非根目录。比如你有路由 /pageA/pageB,然后设置了 base/manage/,那么就可以通过 /manage/pageA/manage/pageB 访问到它们。

chainWebpack

',3),r=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型:"),(0,e._)("code",null,"function")])],-1),c=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值:"),(0,e._)("code",null,"null")])],-1),i=(0,e._)("p",null,"详情:",-1),u={href:"https://github.com/neutrinojs/webpack-chain",target:"_blank",rel:"noopener noreferrer"},d=(0,e.uE)('

示例:

export default {\n    chainWebpack(memo, { env, webpack }) {\n        // 删除 fes 内置插件\n        memo.plugins.delete('copy');\n    },\n}\n
1
2
3
4
5
6

cssLoader

',3),k=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"object")])],-1),b=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值: "),(0,e._)("code",null,"''")])],-1),h=(0,e._)("p",null,"详情:",-1),m={href:"https://github.com/webpack-contrib/css-loader#options",target:"_blank",rel:"noopener noreferrer"},g=(0,e.uE)('

copy

  • 类型: Array(string) || Array(object)

  • 默认值: []

  • 详情:

    设置要复制到输出目录的文件、文件夹。

    配置约定 from-to 规则, 其中 from 是相对于 cwd 的路径,to 是相对于输出路径的路径。

  • 示例:

export default {\n    copy: {\n        from: '/src/assets/images',\n        to: 'assets/images'\n    }\n}\n
1
2
3
4
5
6

上面示例中,实现了将 cwd 路径中的 /src/assets/images 文件夹,在编译完成后,copy 到输出路径下的 assets/images 文件夹。

define

  • 类型: object

  • 默认值: {}

  • 详情:

    用于提供给代码中可用的变量。

  • 示例:

export default {\n    define: {\n        __DEV__: 'development'\n    }\n}\n
1
2
3
4
5

然后你代码里写 console.log(__DEV__),会被编译成 console.log('development')

devServer

  • 类型: object

  • 默认值: {}

  • 详情:

    配置开发服务器。支持以下子配置项:

    • port,端口号,默认 8000
    • host,默认 localhost
    • https,是否启用 https server,同时也会开启 HTTP/2

    启用 port 和 host 也可以通过环境变量 PORTHOST 临时指定。

devtool

',11),v=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"string")])],-1),y=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值: "),(0,e._)("code",null,"cheap-module-source-map"),(0,e.Uk)(" in dev, "),(0,e._)("code",null,"undefined"),(0,e.Uk)(" in build")])],-1),_=(0,e._)("p",null,"详情:",-1),f={href:"https://webpack.js.org/configuration/devtool/#devtool",target:"_blank",rel:"noopener noreferrer"},x=(0,e.uE)('

dynamicImport

  • 类型: boolean

  • 默认值: false

  • 详情:

    路由是否按需加载

exportStatic

  • 类型: object
  • 默认值: {}
  • 详情:

配置 html 的输出形式,默认只输出 index.html

如果开启 exportStatic,则会针对每个路由输出 html 文件。

比如以下路由,

/\n/users\n/list\n
1
2
3

不开启 exportStatic 时,输出,

- index.html\n
1

设置 exportStatic: {} 后,输出,

- index.html\n- users.html\n- list.html\n
1
2
3

externals

  • 类型:object

  • 默认值:{}

  • 详情:

    设置哪些模块可以不被打包,通过 <script> 或其他方式引入。

示例:

export default {\n    externals: {\n      vue: 'window.Vue',\n    },\n}\n
1
2
3
4
5

extraBabelPlugins

  • 类型: array
  • 默认值: []
  • 详情:

配置额外的 babel 插件。

  • 示例:
export default {\n    extraBabelPlugins: [\n        ['import', { libraryName: 'ant-design-vue', libraryDirectory: 'es', style: 'css' }],\n    ],\n}\n
1
2
3
4
5

extraBabelPresets

  • 类型: array
  • 默认值: []
  • 详情:

配置额外的 babel 插件集。

extraPostCSSPlugins

',25),j=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"array")])],-1),U=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值: "),(0,e._)("code",null,"[]")])],-1),w=(0,e._)("p",null,"详情:",-1),E={href:"https://github.com/postcss/postcss/blob/master/docs/plugins.md",target:"_blank",rel:"noopener noreferrer"},A=(0,e._)("h2",{id:"html",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#html","aria-hidden":"true"},"#"),(0,e.Uk)(" html")],-1),L=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"object")])],-1),P=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值: "),(0,e._)("code",null,"{}")])],-1),N=(0,e._)("p",null,"详情:",-1),S={href:"https://github.com/jantimon/html-webpack-plugin#options",target:"_blank",rel:"noopener noreferrer"},W=(0,e.uE)('

inlineLimit

  • 类型: number

  • 默认值: 8192(8k)

  • 详情:

    配置图片文件是否走 base64 编译的阈值。默认是 8192 字节,小于它会被编译为 base64 编码,否则会生成单独的文件。

lessLoader

',3),z=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"object")])],-1),O=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值: "),(0,e._)("code",null,"{}")])],-1),D=(0,e._)("p",null,"详情:",-1),Z={href:"https://github.com/webpack-contrib/less-loader",target:"_blank",rel:"noopener noreferrer"},T=(0,e.uE)('

mock

  • 类型: object || boolean

  • 默认值: {}

  • 详情:

    配置 mock 属性。

    • 当 mock 为 boolean 类型时,true 表示打开 mock,false 表示关闭 mock。
    • 当 mock 为 object 类型时,默认打开 mock。也可以通过子属性 prefix 添加过滤条件,满足条件的走 mock 文件。
  • 示例:

export default {\n    mock: {\n        prefix: '/api/auth'\n    }\n}\n
1
2
3
4
5

然后所有以 /api/users 开始的请求,就能进入 mock.js 文件处理。

mountElementId

  • 类型: string

  • 默认值: app

  • 详情:

    指定渲染到的 HTML 元素 id。

nodeModulesTransform

  • 类型: object

  • 默认值: { exclude: [] }

  • 详情:

    默认编译所有 node_modules 下的包,可以通过配置 exclude 来跳过某些包,以提高编译速度。

outputPath

  • 类型: string

  • 默认值: dist

  • 详情:

    指定输出路径。

提示

不允许设定为 srcpublicpages 等约定目录。

plugins

  • 类型: Array(string)

  • 默认值: []

  • 详情:

    配置额外的 fes 插件。 数组项为指向插件的路径,可以是 npm 依赖、相对路径或绝对路径。如果是相对路径,则会从项目根目录开始找。

  • 示例:

export default {\n  plugins: [\n    // npm 依赖\n    'fes-plugin-hello',\n    // 相对路径\n    './plugin',\n    // 绝对路径\n    `${__dirname}/plugin.js`,\n  ],\n};\n
1
2
3
4
5
6
7
8
9
10

postcssLoader

',15),Y=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"object")])],-1),M=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值: "),(0,e._)("code",null,"{}")])],-1),B=(0,e._)("p",null,"详情:",-1),C={href:"https://github.com/postcss/postcss-loader#options",target:"_blank",rel:"noopener noreferrer"},I=(0,e.uE)('

proxy

  • 类型: object

  • 默认值: {}

  • 详情:

    配置代理能力。

  • 示例:

export default {\n    proxy: {\n        '/v2': {\n            'target': 'https://api.douban.com/',\n            'changeOrigin': true, \n        }\n    }\n}\n
1
2
3
4
5
6
7
8
',3),V=(0,e._)("code",null,"/v2/movie/in_theaters_proxy",-1),q={href:"http://api.douban.com/v2/movie/in_theaters_proxy",target:"_blank",rel:"noopener noreferrer"},H=(0,e.uE)('

publicPath

  • 类型: string

  • 默认值: /

  • 详情:

    配置 webpack 的 publicPath。当打包的时候,webpack 会在静态文件路径前面添加 publicPath 的值,当你需要修改静态文件地址时,比如使用 CDN 部署,把 publicPath 的值设为 CDN 的值就可以。

router

  • 类型: object

  • 默认值: { mode: 'hash' }

  • 详情:

    配置路由,具体请查看指南中关于路由的介绍

singular

  • 类型: boolean

  • 默认值: false

  • 详情:

    配置是否启用单数模式的目录。 比如 src/pages 的约定在开启后为 src/page 目录,@fesjs/fes-plugins 插件也遵照此配置的约定。

targets

  • 类型: object

  • 默认值: {}

  • 详情:

    配置需要兼容的浏览器最低版本,会自动引入 polyfill 和做语法转换。

terserOptions

  • 类型: object
  • 默认值:
const defaultTerserOptions = {\n    compress: {\n        // turn off flags with small gains to speed up minification\n        arrows: false,\n        collapse_vars: false, // 0.3kb\n        comparisons: false,\n        computed_props: false,\n        hoist_funs: false,\n        hoist_props: false,\n        hoist_vars: false,\n        inline: false,\n        loops: false,\n        negate_iife: false,\n        properties: false,\n        reduce_funcs: false,\n        reduce_vars: false,\n        switches: false,\n        toplevel: false,\n        typeofs: false,\n\n        // a few flags with noticeable gains/speed ratio\n        // numbers based on out of the box vendor bundle\n        booleans: true, // 0.7kb\n        if_return: true, // 0.4kb\n        sequences: true, // 0.7kb\n        unused: true, // 2.3kb\n\n        // required features to drop conditional branches\n        conditionals: true,\n        dead_code: true,\n        evaluate: true\n    },\n    mangle: {\n        safari10: true\n    }\n}\n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
',11),R=(0,e._)("p",null,"详情:",-1),F={href:"https://github.com/terser/terser#minify-options",target:"_blank",rel:"noopener noreferrer"},G=(0,e._)("h2",{id:"vueloader",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#vueloader","aria-hidden":"true"},"#"),(0,e.Uk)(" vueLoader")],-1),$=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"object")])],-1),J=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值:"),(0,e._)("code",null,"{}")])],-1),K=(0,e._)("p",null,"详情:",-1),Q={href:"https://vue-loader.vuejs.org/zh/options.html",target:"_blank",rel:"noopener noreferrer"},X=(0,e._)("h2",{id:"更多配置项",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#更多配置项","aria-hidden":"true"},"#"),(0,e.Uk)(" 更多配置项")],-1),nn=(0,e._)("p",null,"Fes.js 允许插件注册配置,如果你使用插件,肯定会在插件里找到更多配置项。",-1),sn={},an=(0,a(3744).Z)(sn,[["render",function(n,s){const a=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,(0,e._)("ul",null,[(0,e._)("li",null,[l,(0,e._)("p",null,[(0,e._)("a",t,[(0,e.Uk)("postcss autoprefixer 插件"),(0,e.Wm)(a)]),(0,e.Uk)(" 配置。")])])]),o,(0,e._)("ul",null,[r,c,(0,e._)("li",null,[i,(0,e._)("p",null,[(0,e.Uk)("通过 "),(0,e._)("a",u,[(0,e.Uk)("webpack-chain"),(0,e.Wm)(a)]),(0,e.Uk)(" 的 API 修改 webpack 配置。")])])]),d,(0,e._)("ul",null,[k,b,(0,e._)("li",null,[h,(0,e._)("p",null,[(0,e.Uk)("设置 "),(0,e._)("a",m,[(0,e.Uk)("css-loader 配置项"),(0,e.Wm)(a)]),(0,e.Uk)("。")])])]),g,(0,e._)("ul",null,[v,y,(0,e._)("li",null,[_,(0,e._)("p",null,[(0,e.Uk)("用户配置 sourcemap 类型。详见 "),(0,e._)("a",f,[(0,e.Uk)(" webpack#devtool 配置"),(0,e.Wm)(a)]),(0,e.Uk)("。")])])]),x,(0,e._)("ul",null,[j,U,(0,e._)("li",null,[w,(0,e._)("p",null,[(0,e.Uk)("设置额外的 "),(0,e._)("a",E,[(0,e.Uk)("postcss 插件"),(0,e.Wm)(a)]),(0,e.Uk)("。")])])]),A,(0,e._)("ul",null,[L,P,(0,e._)("li",null,[N,(0,e._)("p",null,[(0,e.Uk)("设置"),(0,e._)("a",S,[(0,e.Uk)("html-webpack-plugin"),(0,e.Wm)(a)]),(0,e.Uk)("。")])])]),W,(0,e._)("ul",null,[z,O,(0,e._)("li",null,[D,(0,e._)("p",null,[(0,e.Uk)("设置 "),(0,e._)("a",Z,[(0,e.Uk)("less-loader 配置项"),(0,e.Wm)(a)]),(0,e.Uk)("。")])])]),T,(0,e._)("ul",null,[Y,M,(0,e._)("li",null,[B,(0,e._)("p",null,[(0,e.Uk)("设置 "),(0,e._)("a",C,[(0,e.Uk)("postcss-loader 配置项"),(0,e.Wm)(a)]),(0,e.Uk)("。")])])]),I,(0,e._)("p",null,[(0,e.Uk)("然后访问 "),V,(0,e.Uk)(" 就能访问到 "),(0,e._)("a",q,[(0,e.Uk)("http://api.douban.com/v2/movie/in_theaters_proxy"),(0,e.Wm)(a)]),(0,e.Uk)(" 的数据。")]),H,(0,e._)("ul",null,[(0,e._)("li",null,[R,(0,e._)("p",null,[(0,e.Uk)("配置 "),(0,e._)("a",F,[(0,e.Uk)("压缩器 terser 的配置项"),(0,e.Wm)(a)])])])]),G,(0,e._)("ul",null,[$,J,(0,e._)("li",null,[K,(0,e._)("p",null,[(0,e.Uk)("配置 "),(0,e._)("a",Q,[(0,e.Uk)("Vue Loader"),(0,e.Wm)(a)])])])]),X,nn],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-2c05b6e0.89139121.js b/assets/js/v-2c05b6e0.89139121.js deleted file mode 100644 index bade6de2..00000000 --- a/assets/js/v-2c05b6e0.89139121.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[960],{5822:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-2c05b6e0",path:"/reference/config/",title:"配置",lang:"zh-CN",frontmatter:{sidebar:"auto"},excerpt:"",headers:[{level:2,title:"alias",slug:"alias",children:[]},{level:2,title:"analyze",slug:"analyze",children:[]},{level:2,title:"autoprefixer",slug:"autoprefixer",children:[]},{level:2,title:"base",slug:"base",children:[]},{level:2,title:"chainWebpack",slug:"chainwebpack",children:[]},{level:2,title:"cssLoader",slug:"cssloader",children:[]},{level:2,title:"copy",slug:"copy",children:[]},{level:2,title:"define",slug:"define",children:[]},{level:2,title:"devServer",slug:"devserver",children:[]},{level:2,title:"devtool",slug:"devtool",children:[]},{level:2,title:"dynamicImport",slug:"dynamicimport",children:[]},{level:2,title:"exportStatic",slug:"exportstatic",children:[]},{level:2,title:"externals",slug:"externals",children:[]},{level:2,title:"extraBabelPlugins",slug:"extrababelplugins",children:[]},{level:2,title:"extraBabelPresets",slug:"extrababelpresets",children:[]},{level:2,title:"extraPostCSSPlugins",slug:"extrapostcssplugins",children:[]},{level:2,title:"html",slug:"html",children:[]},{level:2,title:"inlineLimit",slug:"inlinelimit",children:[]},{level:2,title:"lessLoader",slug:"lessloader",children:[]},{level:2,title:"mock",slug:"mock",children:[]},{level:2,title:"mountElementId",slug:"mountelementid",children:[]},{level:2,title:"nodeModulesTransform",slug:"nodemodulestransform",children:[]},{level:2,title:"outputPath",slug:"outputpath",children:[]},{level:2,title:"plugins",slug:"plugins",children:[]},{level:2,title:"postcssLoader",slug:"postcssloader",children:[]},{level:2,title:"proxy",slug:"proxy",children:[]},{level:2,title:"publicPath",slug:"publicpath",children:[]},{level:2,title:"router",slug:"router",children:[]},{level:2,title:"singular",slug:"singular",children:[]},{level:2,title:"targets",slug:"targets",children:[]},{level:2,title:"terserOptions",slug:"terseroptions",children:[]},{level:2,title:"vueLoader",slug:"vueloader",children:[]},{level:2,title:"更多配置项",slug:"更多配置项",children:[]}],filePathRelative:"reference/config/README.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},502:(n,s,a)=>{a.r(s),a.d(s,{default:()=>On});var e=a(6252);const p=(0,e.uE)('

配置

以下配置项通过字母排序。

alias

  • 类型: object

  • 默认值: {}

  • 详情:

    配置别名,对引用路径进行映射。

  • 示例:

export default {\n    alias: {\n       main: 'src/assets/styles/main'\n    }\n}\n
1
2
3
4
5

然后 import('main'),实际上是 import('src/assets/styles/main')

analyze

  • 类型: object
  • 默认值:
{\n    analyzerMode: process.env.ANALYZE_MODE || 'server',\n    analyzerPort: process.env.ANALYZE_PORT || 8888,\n    openAnalyzer: process.env.ANALYZE_OPEN !== 'none',\n    // generate stats file while ANALYZE_DUMP exist\n    generateStatsFile: !!process.env.ANALYZE_DUMP,\n    statsFilename: process.env.ANALYZE_DUMP || 'stats.json',\n    logLevel: process.env.ANALYZE_LOG_LEVEL || 'info',\n    defaultSizes: 'parsed' // stat  // gzip\n}\n
1
2
3
4
5
6
7
8
9
10
  • 详情:

    构建结果分析,当配置 process.env.ANALYZE 时开启,例如执行ANALYZE=1 fes build

autoprefixer

  • 类型: object
  • 默认值:
{\n    flexbox: 'no-2009'\n}\n
1
2
3
',13),l=(0,e._)("p",null,"详情:",-1),t={href:"https://github.com/postcss/autoprefixer#options",target:"_blank",rel:"noopener noreferrer"},o=(0,e.Uk)("postcss autoprefixer 插件"),r=(0,e.Uk)(" 配置。"),c=(0,e.uE)('

base

  • 类型: string

  • 默认值: ''

  • 详情:

    设置路由前缀,通常用于部署到非根目录。比如你有路由 /pageA/pageB,然后设置了 base/manage/,那么就可以通过 /manage/pageA/manage/pageB 访问到它们。

chainWebpack

',3),i=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型:"),(0,e._)("code",null,"function")])],-1),u=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值:"),(0,e._)("code",null,"null")])],-1),d=(0,e._)("p",null,"详情:",-1),k=(0,e.Uk)("通过 "),b={href:"https://github.com/neutrinojs/webpack-chain",target:"_blank",rel:"noopener noreferrer"},h=(0,e.Uk)("webpack-chain"),m=(0,e.Uk)(" 的 API 修改 webpack 配置。"),g=(0,e.uE)('

示例:

export default {\n    chainWebpack(memo, { env, webpack }) {\n        // 删除 fes 内置插件\n        memo.plugins.delete('copy');\n    },\n}\n
1
2
3
4
5
6

cssLoader

',3),v=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"object")])],-1),y=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值: "),(0,e._)("code",null,"''")])],-1),_=(0,e._)("p",null,"详情:",-1),f=(0,e.Uk)("设置 "),x={href:"https://github.com/webpack-contrib/css-loader#options",target:"_blank",rel:"noopener noreferrer"},j=(0,e.Uk)("css-loader 配置项"),U=(0,e.Uk)("。"),w=(0,e.uE)('

copy

  • 类型: Array(string) || Array(object)

  • 默认值: []

  • 详情:

    设置要复制到输出目录的文件、文件夹。

    配置约定 from-to 规则, 其中 from 是相对于 cwd 的路径,to 是相对于输出路径的路径。

  • 示例:

export default {\n    copy: {\n        from: '/src/assets/images',\n        to: 'assets/images'\n    }\n}\n
1
2
3
4
5
6

上面示例中,实现了将 cwd 路径中的 /src/assets/images 文件夹,在编译完成后,copy 到输出路径下的 assets/images 文件夹。

define

  • 类型: object

  • 默认值: {}

  • 详情:

    用于提供给代码中可用的变量。

  • 示例:

export default {\n    define: {\n        __DEV__: 'development'\n    }\n}\n
1
2
3
4
5

然后你代码里写 console.log(__DEV__),会被编译成 console.log('development')

devServer

  • 类型: object

  • 默认值: {}

  • 详情:

    配置开发服务器。支持以下子配置项:

    • port,端口号,默认 8000
    • host,默认 localhost
    • https,是否启用 https server,同时也会开启 HTTP/2

    启用 port 和 host 也可以通过环境变量 PORTHOST 临时指定。

devtool

',11),E=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"string")])],-1),A=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值: "),(0,e._)("code",null,"cheap-module-source-map"),(0,e.Uk)(" in dev, "),(0,e._)("code",null,"undefined"),(0,e.Uk)(" in build")])],-1),L=(0,e._)("p",null,"详情:",-1),P=(0,e.Uk)("用户配置 sourcemap 类型。详见 "),N={href:"https://webpack.js.org/configuration/devtool/#devtool",target:"_blank",rel:"noopener noreferrer"},S=(0,e.Uk)(" webpack#devtool 配置"),W=(0,e.Uk)("。"),z=(0,e.uE)('

dynamicImport

  • 类型: boolean

  • 默认值: false

  • 详情:

    路由是否按需加载

exportStatic

  • 类型: object
  • 默认值: {}
  • 详情:

配置 html 的输出形式,默认只输出 index.html

如果开启 exportStatic,则会针对每个路由输出 html 文件。

比如以下路由,

/\n/users\n/list\n
1
2
3

不开启 exportStatic 时,输出,

- index.html\n
1

设置 exportStatic: {} 后,输出,

- index.html\n- users.html\n- list.html\n
1
2
3

externals

  • 类型:object

  • 默认值:{}

  • 详情:

    设置哪些模块可以不被打包,通过 <script> 或其他方式引入。

示例:

export default {\n    externals: {\n      vue: 'window.Vue',\n    },\n}\n
1
2
3
4
5

extraBabelPlugins

  • 类型: array
  • 默认值: []
  • 详情:

配置额外的 babel 插件。

  • 示例:
export default {\n    extraBabelPlugins: [\n        ['import', { libraryName: 'ant-design-vue', libraryDirectory: 'es', style: 'css' }],\n    ],\n}\n
1
2
3
4
5

extraBabelPresets

  • 类型: array
  • 默认值: []
  • 详情:

配置额外的 babel 插件集。

extraPostCSSPlugins

',25),O=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"array")])],-1),D=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值: "),(0,e._)("code",null,"[]")])],-1),Z=(0,e._)("p",null,"详情:",-1),T=(0,e.Uk)("设置额外的 "),Y={href:"https://github.com/postcss/postcss/blob/master/docs/plugins.md",target:"_blank",rel:"noopener noreferrer"},M=(0,e.Uk)("postcss 插件"),B=(0,e.Uk)("。"),C=(0,e._)("h2",{id:"html",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#html","aria-hidden":"true"},"#"),(0,e.Uk)(" html")],-1),I=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"object")])],-1),V=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值: "),(0,e._)("code",null,"{}")])],-1),q=(0,e._)("p",null,"详情:",-1),H=(0,e.Uk)("设置"),R={href:"https://github.com/jantimon/html-webpack-plugin#options",target:"_blank",rel:"noopener noreferrer"},F=(0,e.Uk)("html-webpack-plugin"),G=(0,e.Uk)("。"),$=(0,e.uE)('

inlineLimit

  • 类型: number

  • 默认值: 8192(8k)

  • 详情:

    配置图片文件是否走 base64 编译的阈值。默认是 8192 字节,小于它会被编译为 base64 编码,否则会生成单独的文件。

lessLoader

',3),J=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"object")])],-1),K=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值: "),(0,e._)("code",null,"{}")])],-1),Q=(0,e._)("p",null,"详情:",-1),X=(0,e.Uk)("设置 "),nn={href:"https://github.com/webpack-contrib/less-loader",target:"_blank",rel:"noopener noreferrer"},sn=(0,e.Uk)("less-loader 配置项"),an=(0,e.Uk)("。"),en=(0,e.uE)('

mock

  • 类型: object || boolean

  • 默认值: {}

  • 详情:

    配置 mock 属性。

    • 当 mock 为 boolean 类型时,true 表示打开 mock,false 表示关闭 mock。
    • 当 mock 为 object 类型时,默认打开 mock。也可以通过子属性 prefix 添加过滤条件,满足条件的走 mock 文件。
  • 示例:

export default {\n    mock: {\n        prefix: '/api/auth'\n    }\n}\n
1
2
3
4
5

然后所有以 /api/users 开始的请求,就能进入 mock.js 文件处理。

mountElementId

  • 类型: string

  • 默认值: app

  • 详情:

    指定渲染到的 HTML 元素 id。

nodeModulesTransform

  • 类型: object

  • 默认值: { exclude: [] }

  • 详情:

    默认编译所有 node_modules 下的包,可以通过配置 exclude 来跳过某些包,以提高编译速度。

outputPath

  • 类型: string

  • 默认值: dist

  • 详情:

    指定输出路径。

提示

不允许设定为 srcpublicpages 等约定目录。

plugins

  • 类型: Array(string)

  • 默认值: []

  • 详情:

    配置额外的 fes 插件。 数组项为指向插件的路径,可以是 npm 依赖、相对路径或绝对路径。如果是相对路径,则会从项目根目录开始找。

  • 示例:

export default {\n  plugins: [\n    // npm 依赖\n    'fes-plugin-hello',\n    // 相对路径\n    './plugin',\n    // 绝对路径\n    `${__dirname}/plugin.js`,\n  ],\n};\n
1
2
3
4
5
6
7
8
9
10

postcssLoader

',15),pn=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"object")])],-1),ln=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值: "),(0,e._)("code",null,"{}")])],-1),tn=(0,e._)("p",null,"详情:",-1),on=(0,e.Uk)("设置 "),rn={href:"https://github.com/postcss/postcss-loader#options",target:"_blank",rel:"noopener noreferrer"},cn=(0,e.Uk)("postcss-loader 配置项"),un=(0,e.Uk)("。"),dn=(0,e.uE)('

proxy

  • 类型: object

  • 默认值: {}

  • 详情:

    配置代理能力。

  • 示例:

export default {\n    proxy: {\n        '/v2': {\n            'target': 'https://api.douban.com/',\n            'changeOrigin': true, \n        }\n    }\n}\n
1
2
3
4
5
6
7
8
',3),kn=(0,e.Uk)("然后访问 "),bn=(0,e._)("code",null,"/v2/movie/in_theaters_proxy",-1),hn=(0,e.Uk)(" 就能访问到 "),mn={href:"http://api.douban.com/v2/movie/in_theaters_proxy",target:"_blank",rel:"noopener noreferrer"},gn=(0,e.Uk)("http://api.douban.com/v2/movie/in_theaters_proxy"),vn=(0,e.Uk)(" 的数据。"),yn=(0,e.uE)('

publicPath

  • 类型: string

  • 默认值: /

  • 详情:

    配置 webpack 的 publicPath。当打包的时候,webpack 会在静态文件路径前面添加 publicPath 的值,当你需要修改静态文件地址时,比如使用 CDN 部署,把 publicPath 的值设为 CDN 的值就可以。

router

  • 类型: object

  • 默认值: { mode: 'hash' }

  • 详情:

    配置路由,具体请查看指南中关于路由的介绍

singular

  • 类型: boolean

  • 默认值: false

  • 详情:

    配置是否启用单数模式的目录。 比如 src/pages 的约定在开启后为 src/page 目录,@fesjs/fes-plugins 插件也遵照此配置的约定。

targets

  • 类型: object

  • 默认值: {}

  • 详情:

    配置需要兼容的浏览器最低版本,会自动引入 polyfill 和做语法转换。

terserOptions

  • 类型: object
  • 默认值:
const defaultTerserOptions = {\n    compress: {\n        // turn off flags with small gains to speed up minification\n        arrows: false,\n        collapse_vars: false, // 0.3kb\n        comparisons: false,\n        computed_props: false,\n        hoist_funs: false,\n        hoist_props: false,\n        hoist_vars: false,\n        inline: false,\n        loops: false,\n        negate_iife: false,\n        properties: false,\n        reduce_funcs: false,\n        reduce_vars: false,\n        switches: false,\n        toplevel: false,\n        typeofs: false,\n\n        // a few flags with noticeable gains/speed ratio\n        // numbers based on out of the box vendor bundle\n        booleans: true, // 0.7kb\n        if_return: true, // 0.4kb\n        sequences: true, // 0.7kb\n        unused: true, // 2.3kb\n\n        // required features to drop conditional branches\n        conditionals: true,\n        dead_code: true,\n        evaluate: true\n    },\n    mangle: {\n        safari10: true\n    }\n}\n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
',11),_n=(0,e._)("p",null,"详情:",-1),fn=(0,e.Uk)("配置 "),xn={href:"https://github.com/terser/terser#minify-options",target:"_blank",rel:"noopener noreferrer"},jn=(0,e.Uk)("压缩器 terser 的配置项"),Un=(0,e._)("h2",{id:"vueloader",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#vueloader","aria-hidden":"true"},"#"),(0,e.Uk)(" vueLoader")],-1),wn=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("类型: "),(0,e._)("code",null,"object")])],-1),En=(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("默认值:"),(0,e._)("code",null,"{}")])],-1),An=(0,e._)("p",null,"详情:",-1),Ln=(0,e.Uk)("配置 "),Pn={href:"https://vue-loader.vuejs.org/zh/options.html",target:"_blank",rel:"noopener noreferrer"},Nn=(0,e.Uk)("Vue Loader"),Sn=(0,e._)("h2",{id:"更多配置项",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#更多配置项","aria-hidden":"true"},"#"),(0,e.Uk)(" 更多配置项")],-1),Wn=(0,e._)("p",null,"Fes.js 允许插件注册配置,如果你使用插件,肯定会在插件里找到更多配置项。",-1),zn={},On=(0,a(3744).Z)(zn,[["render",function(n,s){const a=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,(0,e._)("ul",null,[(0,e._)("li",null,[l,(0,e._)("p",null,[(0,e._)("a",t,[o,(0,e.Wm)(a)]),r])])]),c,(0,e._)("ul",null,[i,u,(0,e._)("li",null,[d,(0,e._)("p",null,[k,(0,e._)("a",b,[h,(0,e.Wm)(a)]),m])])]),g,(0,e._)("ul",null,[v,y,(0,e._)("li",null,[_,(0,e._)("p",null,[f,(0,e._)("a",x,[j,(0,e.Wm)(a)]),U])])]),w,(0,e._)("ul",null,[E,A,(0,e._)("li",null,[L,(0,e._)("p",null,[P,(0,e._)("a",N,[S,(0,e.Wm)(a)]),W])])]),z,(0,e._)("ul",null,[O,D,(0,e._)("li",null,[Z,(0,e._)("p",null,[T,(0,e._)("a",Y,[M,(0,e.Wm)(a)]),B])])]),C,(0,e._)("ul",null,[I,V,(0,e._)("li",null,[q,(0,e._)("p",null,[H,(0,e._)("a",R,[F,(0,e.Wm)(a)]),G])])]),$,(0,e._)("ul",null,[J,K,(0,e._)("li",null,[Q,(0,e._)("p",null,[X,(0,e._)("a",nn,[sn,(0,e.Wm)(a)]),an])])]),en,(0,e._)("ul",null,[pn,ln,(0,e._)("li",null,[tn,(0,e._)("p",null,[on,(0,e._)("a",rn,[cn,(0,e.Wm)(a)]),un])])]),dn,(0,e._)("p",null,[kn,bn,hn,(0,e._)("a",mn,[gn,(0,e.Wm)(a)]),vn]),yn,(0,e._)("ul",null,[(0,e._)("li",null,[_n,(0,e._)("p",null,[fn,(0,e._)("a",xn,[jn,(0,e.Wm)(a)])])])]),Un,(0,e._)("ul",null,[wn,En,(0,e._)("li",null,[An,(0,e._)("p",null,[Ln,(0,e._)("a",Pn,[Nn,(0,e.Wm)(a)])])])]),Sn,Wn],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-2fe128e7.8773c281.js b/assets/js/v-2fe128e7.8773c281.js deleted file mode 100644 index e65b7285..00000000 --- a/assets/js/v-2fe128e7.8773c281.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[484],{2639:(s,n,a)=>{a.r(n),a.d(n,{data:()=>p});const p={key:"v-2fe128e7",path:"/reference/plugin/plugins/access.html",title:"@fesjs/plugin-access",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[{level:3,title:"资源",slug:"资源",children:[]},{level:3,title:"匹配规则",slug:"匹配规则",children:[]},{level:3,title:"角色",slug:"角色",children:[]}]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"编译时配置",slug:"编译时配置",children:[{level:3,title:"roles",slug:"roles",children:[]}]},{level:2,title:"运行时配置",slug:"运行时配置",children:[{level:3,title:"unAccessHandler",slug:"unaccesshandler",children:[]},{level:3,title:"noFoundHandler",slug:"nofoundhandler",children:[]}]},{level:2,title:"API",slug:"api",children:[{level:3,title:"access",slug:"access",children:[]},{level:3,title:"useAccess",slug:"useaccess",children:[]},{level:3,title:"v-access",slug:"v-access",children:[]},{level:3,title:"组件 Access",slug:"组件-access",children:[]}]}],filePathRelative:"reference/plugin/plugins/access.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5364:(s,n,a)=>{a.r(n),a.d(n,{default:()=>w});var p=a(6252);const e=(0,p.uE)('

@fesjs/plugin-access

介绍

对于前端应用来说,权限就是页面、页面元素是否可见。

资源

Fes.js 把页面、页面元素统一叫做资源,用资源 ID 来识别区分他们:

  • 页面的资源 ID 默认是页面的路由 path 。比如页面 pages/a.vue 的路由 path/a。当页面访问 /a 时会渲染当前页面,/a 也就是页面的 accessId

  • 页面元素的资源 ID 没有默认值,需要自定义。

<template>\n    <access :id="accessId"> accessOnepicess1 <input /> </access>\n    <div v-access="accessId"> accessOnepicess2 </div>\n</template>\n<script>\nexport default {\n    setup(){\n        return {\n            accessId: 'accessOnepicess'\n        }\n    }\n}\n</script>\n
1
2
3
4
5
6
7
8
9
10
11
12
13

匹配规则

全等匹配

资源的匹配规则默认是使用全等匹配,比如页面 pages/a.vue 对应路由 path/a,则 /a 就是页面的资源ID。如果我们设置:

access.setAccess(['/a'])\n
1

由于权限列表中包含/a,则表示拥有此页面权限。

模糊匹配

页面@id.vue会映射为动态路由/:id,想匹配此页面有两种办法:

  • access.setAccess(['/:id'])
  • access.setAccess(['/*'])

第二种是模糊匹配,*表示任意路径。比如角色admin需要全部权限,则可以:

export default {\n    access: {\n        roles: {\n            admin: ["*"]\n        }\n    }\n}\n
1
2
3
4
5
6
7

角色

通常我们会用角色来控制权限,相应的Fes.js 用角色定义一组资源。当访问 Fes.js 应用时,使用插件提供的 API 设置用户的角色,角色对应的资源才可见,非角色对应的资源不可见。

当然有时候业务比较复杂,角色对应的权限是动态的。不要怕!插件提供粒度更细的 API 来设置当前用户能访问的资源。

启用方式

package.json 中引入依赖:

{\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-access": "^2.0.0"\n    },\n}\n
1
2
3
4
5
6

编译时配置

在执行 fes dev 或者 fes build 时,通过此配置生成运行时的代码,在配置文件.fes.js 中配置:

export default {\n    access: {\n        roles: {\n            admin: ["/", "/onepiece", '/store']\n        }\n    }\n}\n
1
2
3
4
5
6
7

roles

  • 类型:对象

  • 默认值{}

  • 详情

    角色预定义列表。key 是角色 Id ,value是角色 Id 对应的资源列表。

运行时配置

app.js 中配置

unAccessHandler

',31),t=(0,p.uE)("
  • 类型Function

  • 默认值null

  • 详情

    当进入某个路由时,如果路由对应的页面不属于可见资源列表,则会暂停进入,调用 unAccessHandler 函数。

  • ",3),c=(0,p._)("p",null,[(0,p._)("strong",null,"参数")],-1),o=(0,p._)("li",null,"router:createRouter 创建的路由实例",-1),l=(0,p._)("li",null,"to: 准备进入的路由",-1),u=(0,p._)("li",null,"from:离开的路由",-1),i=(0,p.Uk)("next: "),r={href:"https://next.router.vuejs.org/zh/guide/advanced/navigation-guards.html#%E5%8F%AF%E9%80%89%E7%9A%84%E7%AC%AC%E4%B8%89%E4%B8%AA%E5%8F%82%E6%95%B0-next",target:"_blank",rel:"noopener noreferrer"},k=(0,p.Uk)("next函数"),d=(0,p.uE)('

    比如:

    export const access = {\n    unAccessHandler({ to, next }) {\n        const accesssIds = accessApi.getAccess();\n        if (to.path === '/404') {\n            accessApi.setAccess(accesssIds.concat(['/404']));\n            return next('/404');\n        }\n        if (!accesssIds.includes('/403')) {\n            accessApi.setAccess(accesssIds.concat(['/403']));\n        }\n        next('/403');\n    }\n};\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    noFoundHandler

    ',3),g=(0,p.uE)("
  • 类型Function

  • 默认值null

  • 详情

    当进入某个路由时,如果路由对应的页面不存在,则会调用 noFoundHandler 函数。

  • ",3),b=(0,p._)("p",null,[(0,p._)("strong",null,"参数")],-1),m=(0,p._)("li",null,"router:createRouter 创建的路由实例",-1),h=(0,p._)("li",null,"to: 准备进入的路由",-1),v=(0,p._)("li",null,"from:离开的路由",-1),f=(0,p.Uk)("next: "),y={href:"https://next.router.vuejs.org/zh/guide/advanced/navigation-guards.html#%E5%8F%AF%E9%80%89%E7%9A%84%E7%AC%AC%E4%B8%89%E4%B8%AA%E5%8F%82%E6%95%B0-next",target:"_blank",rel:"noopener noreferrer"},j=(0,p.Uk)("next函数"),x=(0,p.uE)('

    比如:

    export const access = {\n    noFoundHandler({ next }) {\n        const accesssIds = accessApi.getAccess();\n        if (!accesssIds.includes('/404')) {\n            accessApi.setAccess(accesssIds.concat(['/404']));\n        }\n        next('/404');\n    }\n};\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    API

    access

    插件 API 通过 @fesjs/fes 导出:

    import { access } from '@fesjs/fes'\n
    1

    access.hasAccess

    • 类型:( accessId: string | number ) => Promise<boolean>

    • 详情: 判断某个资源是否可见。

    • 参数

      • accessId,资源Id
    • 返回值:是否有权限

    access.isDataReady

    • 类型:() => boolean

    • 详情:可以用异步数据来设置权限,isDataReady 用来判断异步数据是否已经加载完毕。

    • 参数:null

    • 返回值:Boolean

    import { access } from '@fesjs/fes';\nconsole.log(access.isDataReady())\n
    1
    2

    access.setRole

    • 类型:函数

    • 详情:设置当前的角色。

    • 参数

      • roleId,角色Id,有两种类型:
        • String,对应着 roles 配置对象中的 key
        • Promise,Promise resolve 的结果应对应着 roles 配置对象中的 key
    import { access } from '@fesjs/fes';\naccess.setRole('admin')\n
    1
    2

    access.setAccess

    • 类型:函数

    • 详情:设置当前的角色。

    • 参数

      • accessIds,资源Id数组,有两种类型:
        • Array,数组项对应着 roles 配置对象中的 key
        • Promise,Promise resolve 的结果应该是Array<accessId>
    import { access } from '@fesjs/fes';\naccess.setAccess(['/a', '/b', '/c'])\n
    1
    2

    access.getAccess

    • 类型:函数

    • 详情:返回当前可见的资源列表。

    • 参数:null

    import { access } from '@fesjs/fes';\naccess.getAccess();\n
    1
    2

    useAccess

    • 类型composition 函数

    • 详情:判断某个资源是否可见。

    • 参数

      • accessId,资源Id
    • 返回值ref

    <template>\n    <div v-if="accessOnepicess">accessOnepicess</div>\n</template>\n<script>\nimport { useAccess } from '@fesjs/fes';\nexport default {\n    setup(){\n        const accessOnepicess = useAccess('/onepiece1');\n        return {\n            accessOnepicess\n        }\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    v-access

    在指令 v-access 中传入 accessId,则当 accessId 拥有权限时显示DOM,当没有权限时隐藏此DOM。

    <template>\n    <div v-access="accessId"> accessOnepicess </div>\n</template>\n<script>\nexport default {\n    setup(){\n        return {\n            accessId: 'accessOnepicess'\n        }\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    组件 Access

    组件 Access 中传入 accessId,则当 accessId 拥有权限时渲染此组件,当没有权限时隐藏此组件。

    <template>\n    <access :id="accessId"> accessOnepicess </access>\n</template>\n<script>\nexport default {\n    setup(){\n        return {\n            accessId: 'accessOnepicess'\n        }\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ',29),A={},w=(0,a(3744).Z)(A,[["render",function(s,n){const a=(0,p.up)("OutboundLink");return(0,p.wg)(),(0,p.iD)(p.HY,null,[e,(0,p._)("ul",null,[t,(0,p._)("li",null,[c,(0,p._)("ul",null,[o,l,u,(0,p._)("li",null,[i,(0,p._)("a",r,[k,(0,p.Wm)(a)])])])])]),d,(0,p._)("ul",null,[g,(0,p._)("li",null,[b,(0,p._)("ul",null,[m,h,v,(0,p._)("li",null,[f,(0,p._)("a",y,[j,(0,p.Wm)(a)])])])])]),x],64)}]])},3744:(s,n)=>{n.Z=(s,n)=>{const a=s.__vccOpts||s;for(const[s,p]of n)a[s]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-2fe128e7.a15f3d55.js b/assets/js/v-2fe128e7.a15f3d55.js new file mode 100644 index 00000000..d4e7d976 --- /dev/null +++ b/assets/js/v-2fe128e7.a15f3d55.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[484],{2639:(s,n,a)=>{a.r(n),a.d(n,{data:()=>p});const p={key:"v-2fe128e7",path:"/reference/plugin/plugins/access.html",title:"@fesjs/plugin-access",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[{level:3,title:"资源",slug:"资源",children:[]},{level:3,title:"匹配规则",slug:"匹配规则",children:[]},{level:3,title:"角色",slug:"角色",children:[]}]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"编译时配置",slug:"编译时配置",children:[{level:3,title:"roles",slug:"roles",children:[]}]},{level:2,title:"运行时配置",slug:"运行时配置",children:[{level:3,title:"unAccessHandler",slug:"unaccesshandler",children:[]},{level:3,title:"noFoundHandler",slug:"nofoundhandler",children:[]}]},{level:2,title:"API",slug:"api",children:[{level:3,title:"access",slug:"access",children:[]},{level:3,title:"useAccess",slug:"useaccess",children:[]},{level:3,title:"v-access",slug:"v-access",children:[]},{level:3,title:"组件 Access",slug:"组件-access",children:[]}]}],filePathRelative:"reference/plugin/plugins/access.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5364:(s,n,a)=>{a.r(n),a.d(n,{default:()=>y});var p=a(6252);const e=(0,p.uE)('

    @fesjs/plugin-access

    介绍

    对于前端应用来说,权限就是页面、页面元素是否可见。

    资源

    Fes.js 把页面、页面元素统一叫做资源,用资源 ID 来识别区分他们:

    • 页面的资源 ID 默认是页面的路由 path 。比如页面 pages/a.vue 的路由 path/a。当页面访问 /a 时会渲染当前页面,/a 也就是页面的 accessId

    • 页面元素的资源 ID 没有默认值,需要自定义。

    <template>\n    <access :id="accessId"> accessOnepicess1 <input /> </access>\n    <div v-access="accessId"> accessOnepicess2 </div>\n</template>\n<script>\nexport default {\n    setup(){\n        return {\n            accessId: 'accessOnepicess'\n        }\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    匹配规则

    全等匹配

    资源的匹配规则默认是使用全等匹配,比如页面 pages/a.vue 对应路由 path/a,则 /a 就是页面的资源ID。如果我们设置:

    access.setAccess(['/a'])\n
    1

    由于权限列表中包含/a,则表示拥有此页面权限。

    模糊匹配

    页面@id.vue会映射为动态路由/:id,想匹配此页面有两种办法:

    • access.setAccess(['/:id'])
    • access.setAccess(['/*'])

    第二种是模糊匹配,*表示任意路径。比如角色admin需要全部权限,则可以:

    export default {\n    access: {\n        roles: {\n            admin: ["*"]\n        }\n    }\n}\n
    1
    2
    3
    4
    5
    6
    7

    角色

    通常我们会用角色来控制权限,相应的Fes.js 用角色定义一组资源。当访问 Fes.js 应用时,使用插件提供的 API 设置用户的角色,角色对应的资源才可见,非角色对应的资源不可见。

    当然有时候业务比较复杂,角色对应的权限是动态的。不要怕!插件提供粒度更细的 API 来设置当前用户能访问的资源。

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-access": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    编译时配置

    在执行 fes dev 或者 fes build 时,通过此配置生成运行时的代码,在配置文件.fes.js 中配置:

    export default {\n    access: {\n        roles: {\n            admin: ["/", "/onepiece", '/store']\n        }\n    }\n}\n
    1
    2
    3
    4
    5
    6
    7

    roles

    • 类型:对象

    • 默认值{}

    • 详情

      角色预定义列表。key 是角色 Id ,value是角色 Id 对应的资源列表。

    运行时配置

    app.js 中配置

    unAccessHandler

    ',31),t=(0,p.uE)("
  • 类型Function

  • 默认值null

  • 详情

    当进入某个路由时,如果路由对应的页面不属于可见资源列表,则会暂停进入,调用 unAccessHandler 函数。

  • ",3),c=(0,p._)("p",null,[(0,p._)("strong",null,"参数")],-1),o=(0,p._)("li",null,"router:createRouter 创建的路由实例",-1),l=(0,p._)("li",null,"to: 准备进入的路由",-1),u=(0,p._)("li",null,"from:离开的路由",-1),i={href:"https://next.router.vuejs.org/zh/guide/advanced/navigation-guards.html#%E5%8F%AF%E9%80%89%E7%9A%84%E7%AC%AC%E4%B8%89%E4%B8%AA%E5%8F%82%E6%95%B0-next",target:"_blank",rel:"noopener noreferrer"},r=(0,p.uE)('

    比如:

    export const access = {\n    unAccessHandler({ to, next }) {\n        const accesssIds = accessApi.getAccess();\n        if (to.path === '/404') {\n            accessApi.setAccess(accesssIds.concat(['/404']));\n            return next('/404');\n        }\n        if (!accesssIds.includes('/403')) {\n            accessApi.setAccess(accesssIds.concat(['/403']));\n        }\n        next('/403');\n    }\n};\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    noFoundHandler

    ',3),k=(0,p.uE)("
  • 类型Function

  • 默认值null

  • 详情

    当进入某个路由时,如果路由对应的页面不存在,则会调用 noFoundHandler 函数。

  • ",3),d=(0,p._)("p",null,[(0,p._)("strong",null,"参数")],-1),g=(0,p._)("li",null,"router:createRouter 创建的路由实例",-1),b=(0,p._)("li",null,"to: 准备进入的路由",-1),m=(0,p._)("li",null,"from:离开的路由",-1),h={href:"https://next.router.vuejs.org/zh/guide/advanced/navigation-guards.html#%E5%8F%AF%E9%80%89%E7%9A%84%E7%AC%AC%E4%B8%89%E4%B8%AA%E5%8F%82%E6%95%B0-next",target:"_blank",rel:"noopener noreferrer"},v=(0,p.uE)('

    比如:

    export const access = {\n    noFoundHandler({ next }) {\n        const accesssIds = accessApi.getAccess();\n        if (!accesssIds.includes('/404')) {\n            accessApi.setAccess(accesssIds.concat(['/404']));\n        }\n        next('/404');\n    }\n};\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    API

    access

    插件 API 通过 @fesjs/fes 导出:

    import { access } from '@fesjs/fes'\n
    1

    access.hasAccess

    • 类型:( accessId: string | number ) => Promise<boolean>

    • 详情: 判断某个资源是否可见。

    • 参数

      • accessId,资源Id
    • 返回值:是否有权限

    access.isDataReady

    • 类型:() => boolean

    • 详情:可以用异步数据来设置权限,isDataReady 用来判断异步数据是否已经加载完毕。

    • 参数:null

    • 返回值:Boolean

    import { access } from '@fesjs/fes';\nconsole.log(access.isDataReady())\n
    1
    2

    access.setRole

    • 类型:函数

    • 详情:设置当前的角色。

    • 参数

      • roleId,角色Id,有两种类型:
        • String,对应着 roles 配置对象中的 key
        • Promise,Promise resolve 的结果应对应着 roles 配置对象中的 key
    import { access } from '@fesjs/fes';\naccess.setRole('admin')\n
    1
    2

    access.setAccess

    • 类型:函数

    • 详情:设置当前的角色。

    • 参数

      • accessIds,资源Id数组,有两种类型:
        • Array,数组项对应着 roles 配置对象中的 key
        • Promise,Promise resolve 的结果应该是Array<accessId>
    import { access } from '@fesjs/fes';\naccess.setAccess(['/a', '/b', '/c'])\n
    1
    2

    access.getAccess

    • 类型:函数

    • 详情:返回当前可见的资源列表。

    • 参数:null

    import { access } from '@fesjs/fes';\naccess.getAccess();\n
    1
    2

    useAccess

    • 类型composition 函数

    • 详情:判断某个资源是否可见。

    • 参数

      • accessId,资源Id
    • 返回值ref

    <template>\n    <div v-if="accessOnepicess">accessOnepicess</div>\n</template>\n<script>\nimport { useAccess } from '@fesjs/fes';\nexport default {\n    setup(){\n        const accessOnepicess = useAccess('/onepiece1');\n        return {\n            accessOnepicess\n        }\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    v-access

    在指令 v-access 中传入 accessId,则当 accessId 拥有权限时显示DOM,当没有权限时隐藏此DOM。

    <template>\n    <div v-access="accessId"> accessOnepicess </div>\n</template>\n<script>\nexport default {\n    setup(){\n        return {\n            accessId: 'accessOnepicess'\n        }\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    组件 Access

    组件 Access 中传入 accessId,则当 accessId 拥有权限时渲染此组件,当没有权限时隐藏此组件。

    <template>\n    <access :id="accessId"> accessOnepicess </access>\n</template>\n<script>\nexport default {\n    setup(){\n        return {\n            accessId: 'accessOnepicess'\n        }\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ',29),f={},y=(0,a(3744).Z)(f,[["render",function(s,n){const a=(0,p.up)("OutboundLink");return(0,p.wg)(),(0,p.iD)(p.HY,null,[e,(0,p._)("ul",null,[t,(0,p._)("li",null,[c,(0,p._)("ul",null,[o,l,u,(0,p._)("li",null,[(0,p.Uk)("next: "),(0,p._)("a",i,[(0,p.Uk)("next函数"),(0,p.Wm)(a)])])])])]),r,(0,p._)("ul",null,[k,(0,p._)("li",null,[d,(0,p._)("ul",null,[g,b,m,(0,p._)("li",null,[(0,p.Uk)("next: "),(0,p._)("a",h,[(0,p.Uk)("next函数"),(0,p.Wm)(a)])])])])]),v],64)}]])},3744:(s,n)=>{n.Z=(s,n)=>{const a=s.__vccOpts||s;for(const[s,p]of n)a[s]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-323bda7e.778122f9.js b/assets/js/v-323bda7e.778122f9.js new file mode 100644 index 00000000..5c2fdea3 --- /dev/null +++ b/assets/js/v-323bda7e.778122f9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[230],{6062:(n,s,a)=>{a.r(s),a.d(s,{data:()=>t});const t={key:"v-323bda7e",path:"/reference/plugin/plugins/editor.html",title:"@fesjs/plugin-monaco-editor",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"编译时配置",slug:"编译时配置",children:[{level:3,title:"filename",slug:"filename",children:[]},{level:3,title:"publicPath",slug:"publicpath",children:[]},{level:3,title:"languages",slug:"languages",children:[]}]},{level:2,title:"API",slug:"api",children:[{level:3,title:"monaco",slug:"monaco",children:[]},{level:3,title:"组件 MonacoEditor",slug:"组件-monacoeditor",children:[]}]}],filePathRelative:"reference/plugin/plugins/editor.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5846:(n,s,a)=>{a.r(s),a.d(s,{default:()=>w});var t=a(6252);const e=(0,t._)("h1",{id:"fesjs-plugin-monaco-editor",tabindex:"-1"},[(0,t._)("a",{class:"header-anchor",href:"#fesjs-plugin-monaco-editor","aria-hidden":"true"},"#"),(0,t.Uk)(" @fesjs/plugin-monaco-editor")],-1),p=(0,t._)("h2",{id:"介绍",tabindex:"-1"},[(0,t._)("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),(0,t.Uk)(" 介绍")],-1),o=(0,t._)("code",null,"json",-1),l=(0,t._)("code",null,"javascript",-1),r=(0,t._)("code",null,"python",-1),c={href:"https://github.com/Microsoft/monaco-editor",target:"_blank",rel:"noopener noreferrer"},i=(0,t._)("code",null,"Monaco Editor",-1),u=(0,t._)("code",null,"Monaco Editor",-1),d=(0,t._)("code",null,"1.9.1",-1),k=(0,t.uE)('

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-monaco-editor": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    编译时配置

    在执行 fes dev 或者 fes build 时,通过此配置生成运行时的代码,在配置文件.fes.js 中配置:

    export default {\n    monacoEditor: {\n        languages: ['javascript', 'typescript', 'html', 'json']\n    }\n}\n
    1
    2
    3
    4
    5
    ',6),b=(0,t._)("code",null,"monaco-editor-webpack-plugin",-1),h=(0,t._)("code",null,"Monaco Editor",-1),m=(0,t._)("code",null,"ESM",-1),g=(0,t._)("code",null,"monaco-editor-webpack-plugin",-1),f={href:"https://github.com/Microsoft/monaco-editor-webpack-plugin",target:"_blank",rel:"noopener noreferrer"},y=(0,t.uE)('

    filename

    • 类型:自定义worker脚本名称

    • 默认值'[name].worker.js'

    publicPath

    • 类型:自定义worker脚本的路径

    • 默认值''

    languages

    • 类型:需要支持的语言类型

    • 默认值['abap', 'apex', 'azcli', 'bat', 'bicep', 'cameligo', 'clojure', 'coffee', 'cpp', 'csharp', 'csp', 'css', 'dart', 'dockerfile', 'ecl', 'elixir', 'fsharp', 'go', 'graphql', 'handlebars', 'hcl', 'html', 'ini', 'java', 'javascript', 'json', 'julia', 'kotlin', 'less', 'lexon', 'liquid', 'lua', 'm3', 'markdown', 'mips', 'msdax', 'mysql', 'objective-c', 'pascal', 'pascaligo', 'perl', 'pgsql', 'php', 'postiats', 'powerquery', 'powershell', 'pug', 'python', 'qsharp', 'r', 'razor', 'redis', 'redshift', 'restructuredtext', 'ruby', 'rust', 'sb', 'scala', 'scheme', 'scss', 'shell', 'solidity', 'sophia', 'sparql', 'sql', 'st', 'swift', 'systemverilog', 'tcl', 'twig', 'typescript', 'vb', 'xml', 'yaml']

    • 详情:默认是全部,但是编译后包体积会非常大,建议用到什么语言则配置什么语言。特别某些语言依赖其他语言,例如javascript依赖typescript,需要使用javascript时需要配置为:

    export default {\n    monacoEditor: {\n        languages: ['javascript', 'typescript']\n    }\n}\n
    1
    2
    3
    4
    5

    API

    monaco

    ',9),v={href:"https://microsoft.github.io/monaco-editor/",target:"_blank",rel:"noopener noreferrer"},j=(0,t.uE)('
    import { monaco } from '@fesjs/fes';\n\nmonaco.editor.defineTheme('myCoolTheme', {\n\tbase: 'vs',\n\tinherit: false,\n\trules: [\n\t\t{ token: 'custom-info', foreground: '808080' },\n\t\t{ token: 'custom-error', foreground: 'ff0000', fontStyle: 'bold' },\n\t\t{ token: 'custom-notice', foreground: 'FFA500' },\n\t\t{ token: 'custom-date', foreground: '008800' },\n\t]\n});\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    组件 MonacoEditor

    <template>\n    <MonacoEditor \n        v-model="json"\n        language="json"\n        height="400px"\n        check>\n    </MonacoEditor>\n</template>\n<script>\nimport { MonacoEditor } from '@fesjs/fes';\nexport default {\n    components: {\n        MonacoEditor\n    },\n    setup(){\n        const json = ref('');\n        return {\n            json\n        };\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    props

    属性说明类型默认值
    theme编辑器的主题,使用其他主题需要先使用monaco.editor.defineTheme定义主题stringdefaultTheme
    language编辑器的语言string-
    height编辑器的高度string100%
    width编辑器的宽度string100%
    modelValue(v-model)编辑器的代码string-
    readOnly是否只读booleanfalse
    options编辑器的配置对象object{}
    check是否检查代码,如果检查不通过则不更新数据,目前只支持jsonbooleanfalse

    events

    事件名称说明回调参数
    onload编辑器初始化后触发({monaco, editor, editorModel}) => void
    scrollChange滚动时触发(e) => void
    ',7),q={},w=(0,a(3744).Z)(q,[["render",function(n,s){const a=(0,t.up)("OutboundLink");return(0,t.wg)(),(0,t.iD)(t.HY,null,[e,p,(0,t._)("p",null,[(0,t.Uk)("我们会遇到需要编辑代码的场景,比如编辑"),o,(0,t.Uk)("、"),l,(0,t.Uk)("、"),r,(0,t.Uk)("等等,"),(0,t._)("a",c,[(0,t.Uk)("Monaco Editor"),(0,t.Wm)(a)]),(0,t.Uk)(" 是\b一个好用而且强大的的代码编辑器库,引入"),i,(0,t.Uk)("有一定的成本,插件实现了胶水代码,提供轻松引入的能力。目前内置的 "),u,(0,t.Uk)(" 版本是 "),d,(0,t.Uk)("。")]),k,(0,t._)("p",null,[(0,t.Uk)("我们通过 "),b,(0,t.Uk)(" 集成 "),h,(0,t.Uk)(" 的 "),m,(0,t.Uk)("版本,所以编辑时其实就是 "),g,(0,t.Uk)(" 的配置,具体配置项参考"),(0,t._)("a",f,[(0,t.Uk)("文档"),(0,t.Wm)(a)]),(0,t.Uk)("。")]),y,(0,t._)("p",null,[(0,t.Uk)("编辑器的全局对象,提供扩展语言,自定义主题等等API,具体用法请查看"),(0,t._)("a",v,[(0,t.Uk)("monaco"),(0,t.Wm)(a)]),(0,t.Uk)("官方文档。")]),j],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,t]of s)a[n]=t;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-323bda7e.a6270275.js b/assets/js/v-323bda7e.a6270275.js deleted file mode 100644 index 63c6ff96..00000000 --- a/assets/js/v-323bda7e.a6270275.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[230],{6062:(n,s,a)=>{a.r(s),a.d(s,{data:()=>t});const t={key:"v-323bda7e",path:"/reference/plugin/plugins/editor.html",title:"@fesjs/plugin-monaco-editor",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"编译时配置",slug:"编译时配置",children:[{level:3,title:"filename",slug:"filename",children:[]},{level:3,title:"publicPath",slug:"publicpath",children:[]},{level:3,title:"languages",slug:"languages",children:[]}]},{level:2,title:"API",slug:"api",children:[{level:3,title:"monaco",slug:"monaco",children:[]},{level:3,title:"组件 MonacoEditor",slug:"组件-monacoeditor",children:[]}]}],filePathRelative:"reference/plugin/plugins/editor.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5846:(n,s,a)=>{a.r(s),a.d(s,{default:()=>L});var t=a(6252);const e=(0,t._)("h1",{id:"fesjs-plugin-monaco-editor",tabindex:"-1"},[(0,t._)("a",{class:"header-anchor",href:"#fesjs-plugin-monaco-editor","aria-hidden":"true"},"#"),(0,t.Uk)(" @fesjs/plugin-monaco-editor")],-1),p=(0,t._)("h2",{id:"介绍",tabindex:"-1"},[(0,t._)("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),(0,t.Uk)(" 介绍")],-1),o=(0,t.Uk)("我们会遇到需要编辑代码的场景,比如编辑"),l=(0,t._)("code",null,"json",-1),r=(0,t.Uk)("、"),c=(0,t._)("code",null,"javascript",-1),i=(0,t.Uk)("、"),u=(0,t._)("code",null,"python",-1),d=(0,t.Uk)("等等,"),k={href:"https://github.com/Microsoft/monaco-editor",target:"_blank",rel:"noopener noreferrer"},b=(0,t.Uk)("Monaco Editor"),h=(0,t.Uk)(" 是\b一个好用而且强大的的代码编辑器库,引入"),m=(0,t._)("code",null,"Monaco Editor",-1),g=(0,t.Uk)("有一定的成本,插件实现了胶水代码,提供轻松引入的能力。目前内置的 "),f=(0,t._)("code",null,"Monaco Editor",-1),y=(0,t.Uk)(" 版本是 "),v=(0,t._)("code",null,"1.9.1",-1),j=(0,t.Uk)("。"),q=(0,t.uE)('

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-monaco-editor": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    编译时配置

    在执行 fes dev 或者 fes build 时,通过此配置生成运行时的代码,在配置文件.fes.js 中配置:

    export default {\n    monacoEditor: {\n        languages: ['javascript', 'typescript', 'html', 'json']\n    }\n}\n
    1
    2
    3
    4
    5
    ',6),w=(0,t.Uk)("我们通过 "),x=(0,t._)("code",null,"monaco-editor-webpack-plugin",-1),_=(0,t.Uk)(" 集成 "),U=(0,t._)("code",null,"Monaco Editor",-1),E=(0,t.Uk)(" 的 "),M=(0,t._)("code",null,"ESM",-1),P=(0,t.Uk)("版本,所以编辑时其实就是 "),C=(0,t._)("code",null,"monaco-editor-webpack-plugin",-1),T=(0,t.Uk)(" 的配置,具体配置项参考"),A={href:"https://github.com/Microsoft/monaco-editor-webpack-plugin",target:"_blank",rel:"noopener noreferrer"},z=(0,t.Uk)("文档"),I=(0,t.Uk)("。"),O=(0,t.uE)('

    filename

    • 类型:自定义worker脚本名称

    • 默认值'[name].worker.js'

    publicPath

    • 类型:自定义worker脚本的路径

    • 默认值''

    languages

    • 类型:需要支持的语言类型

    • 默认值['abap', 'apex', 'azcli', 'bat', 'bicep', 'cameligo', 'clojure', 'coffee', 'cpp', 'csharp', 'csp', 'css', 'dart', 'dockerfile', 'ecl', 'elixir', 'fsharp', 'go', 'graphql', 'handlebars', 'hcl', 'html', 'ini', 'java', 'javascript', 'json', 'julia', 'kotlin', 'less', 'lexon', 'liquid', 'lua', 'm3', 'markdown', 'mips', 'msdax', 'mysql', 'objective-c', 'pascal', 'pascaligo', 'perl', 'pgsql', 'php', 'postiats', 'powerquery', 'powershell', 'pug', 'python', 'qsharp', 'r', 'razor', 'redis', 'redshift', 'restructuredtext', 'ruby', 'rust', 'sb', 'scala', 'scheme', 'scss', 'shell', 'solidity', 'sophia', 'sparql', 'sql', 'st', 'swift', 'systemverilog', 'tcl', 'twig', 'typescript', 'vb', 'xml', 'yaml']

    • 详情:默认是全部,但是编译后包体积会非常大,建议用到什么语言则配置什么语言。特别某些语言依赖其他语言,例如javascript依赖typescript,需要使用javascript时需要配置为:

    export default {\n    monacoEditor: {\n        languages: ['javascript', 'typescript']\n    }\n}\n
    1
    2
    3
    4
    5

    API

    monaco

    ',9),W=(0,t.Uk)("编辑器的全局对象,提供扩展语言,自定义主题等等API,具体用法请查看"),F={href:"https://microsoft.github.io/monaco-editor/",target:"_blank",rel:"noopener noreferrer"},S=(0,t.Uk)("monaco"),Z=(0,t.Uk)("官方文档。"),D=(0,t.uE)('
    import { monaco } from '@fesjs/fes';\n\nmonaco.editor.defineTheme('myCoolTheme', {\n\tbase: 'vs',\n\tinherit: false,\n\trules: [\n\t\t{ token: 'custom-info', foreground: '808080' },\n\t\t{ token: 'custom-error', foreground: 'ff0000', fontStyle: 'bold' },\n\t\t{ token: 'custom-notice', foreground: 'FFA500' },\n\t\t{ token: 'custom-date', foreground: '008800' },\n\t]\n});\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    组件 MonacoEditor

    <template>\n    <MonacoEditor \n        v-model="json"\n        language="json"\n        height="400px"\n        check>\n    </MonacoEditor>\n</template>\n<script>\nimport { MonacoEditor } from '@fesjs/fes';\nexport default {\n    components: {\n        MonacoEditor\n    },\n    setup(){\n        const json = ref('');\n        return {\n            json\n        };\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    props

    属性说明类型默认值
    theme编辑器的主题,使用其他主题需要先使用monaco.editor.defineTheme定义主题stringdefaultTheme
    language编辑器的语言string-
    height编辑器的高度string100%
    width编辑器的宽度string100%
    modelValue(v-model)编辑器的代码string-
    readOnly是否只读booleanfalse
    options编辑器的配置对象object{}
    check是否检查代码,如果检查不通过则不更新数据,目前只支持jsonbooleanfalse

    events

    事件名称说明回调参数
    onload编辑器初始化后触发({monaco, editor, editorModel}) => void
    scrollChange滚动时触发(e) => void
    ',7),H={},L=(0,a(3744).Z)(H,[["render",function(n,s){const a=(0,t.up)("OutboundLink");return(0,t.wg)(),(0,t.iD)(t.HY,null,[e,p,(0,t._)("p",null,[o,l,r,c,i,u,d,(0,t._)("a",k,[b,(0,t.Wm)(a)]),h,m,g,f,y,v,j]),q,(0,t._)("p",null,[w,x,_,U,E,M,P,C,T,(0,t._)("a",A,[z,(0,t.Wm)(a)]),I]),O,(0,t._)("p",null,[W,(0,t._)("a",F,[S,(0,t.Wm)(a)]),Z]),D],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,t]of s)a[n]=t;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-355ee23e.a37e2b48.js b/assets/js/v-355ee23e.a37e2b48.js deleted file mode 100644 index 150a40a7..00000000 --- a/assets/js/v-355ee23e.a37e2b48.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[475],{1783:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-355ee23e",path:"/reference/plugin/plugins/layout.html",title:"@fesjs/plugin-layout",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"布局类型",slug:"布局类型",children:[{level:3,title:"side",slug:"side",children:[]},{level:3,title:"top",slug:"top",children:[]},{level:3,title:"mixin",slug:"mixin",children:[]},{level:3,title:"页面禁用布局",slug:"页面禁用布局",children:[]}]},{level:2,title:"keep-alive",slug:"keep-alive",children:[]},{level:2,title:"编译时配置",slug:"编译时配置",children:[{level:3,title:"footer",slug:"footer",children:[]},{level:3,title:"theme",slug:"theme",children:[]},{level:3,title:"navigation",slug:"navigation",children:[]},{level:3,title:"fixedHeader",slug:"fixedheader",children:[]},{level:3,title:"fixedSideBar",slug:"fixedsidebar",children:[]},{level:3,title:"title",slug:"title",children:[]},{level:3,title:"logo",slug:"logo",children:[]},{level:3,title:"multiTabs",slug:"multitabs",children:[]},{level:3,title:"menus",slug:"menus",children:[]},{level:3,title:"menusConfig",slug:"menusconfig",children:[]}]},{level:2,title:"运行时配置",slug:"运行时配置",children:[{level:3,title:"menus",slug:"menus-1",children:[]},{level:3,title:"header",slug:"header",children:[]},{level:3,title:"sidebar",slug:"sidebar",children:[]},{level:3,title:"logo",slug:"logo-1",children:[]},{level:3,title:"customHeader",slug:"customheader",children:[]},{level:3,title:"unAccessHandler",slug:"unaccesshandler",children:[]},{level:3,title:"noFoundHandler",slug:"nofoundhandler",children:[]},{level:3,title:"logoUrl",slug:"logourl",children:[]},{level:3,title:"其他运行时配置 (> 4.1.0)",slug:"其他运行时配置-4-1-0",children:[]}]}],filePathRelative:"reference/plugin/plugins/layout.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},2891:(n,s,a)=>{a.r(s),a.d(s,{default:()=>wn});var e=a(6252);const p=(0,e._)("h1",{id:"fesjs-plugin-layout",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#fesjs-plugin-layout","aria-hidden":"true"},"#"),(0,e.Uk)(" @fesjs/plugin-layout")],-1),t=(0,e._)("h2",{id:"介绍",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),(0,e.Uk)(" 介绍")],-1),l=(0,e._)("p",null,"为了进一步降低研发成本,我们尝试将布局通过 fes 插件的方式内置,只需通过简单的配置即可拥有布局,包括导航以及侧边栏。从而做到用户无需关心布局。",-1),o=(0,e.uE)("
  • 侧边栏菜单数据根据路由中的配置自动生成。

  • 布局,提供 sidetopmixin 三种布局。

  • 主题,提供 lightdark 两种主题。

  • 默认实现对路由的 404、403 处理。

  • ",4),c=(0,e.Uk)("搭配 "),r=(0,e.Uk)("@fesjs/plugin-access"),i=(0,e.Uk)(" 插件使用,可以完成对路由的权限控制。"),u=(0,e.Uk)("搭配 "),d=(0,e.Uk)("@fesjs/plugin-locale"),k=(0,e.Uk)(" 插件使用,提供切换语言的能力。"),g=(0,e._)("li",null,[(0,e._)("p",null,"支持自定义头部区域。")],-1),b=(0,e._)("li",null,[(0,e._)("p",null,"菜单支持配置icon")],-1),m=(0,e._)("li",null,[(0,e._)("p",null,"菜单标题支持国际化")],-1),h=(0,e._)("li",null,[(0,e._)("p",null,"可配置页面是否需要 layout。")],-1),f=(0,e.uE)('

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-layout": "^4.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    布局类型

    配置参数是 navigation, 布局有三种类型 sidemixintop, 默认是 side

    export default {\n    layout: {\n        navigation: 'side'\n    }\n}\n
    1
    2
    3
    4
    5

    side

    ',7),v=["src"],y=(0,e._)("h3",{id:"top",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#top","aria-hidden":"true"},"#"),(0,e.Uk)(" top")],-1),x=["src"],_=(0,e._)("h3",{id:"mixin",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#mixin","aria-hidden":"true"},"#"),(0,e.Uk)(" mixin")],-1),j=["src"],U=(0,e.uE)('

    页面禁用布局

    布局是默认开启的,但是可能某些页面不需要展示布局样式,比如登录页面。我们只需要在页面的.vue中添加如下配置:

    <config lang="json">\n{\n    "layout": false\n}\n</config>\n
    1
    2
    3
    4
    5

    如果只是不想展示sidebar,则:

    <config lang="json">\n{\n    "layout": {\n        "sidebar": false\n    }\n}\n</config>\n
    1
    2
    3
    4
    5
    6
    7

    layout的可选配置有:

    • sidebar: 左侧区域,从v4.0.0开始,之前名称叫side

    • header: 头部区域,从v4.0.0开始,之前名称叫top

    • logo:logo和标题区域。

    keep-alive

    从 4.0.7 开始支持配置路由页面缓存:

    <config lang="json">\n{\n    "keep-alive": true\n}\n</config>\n
    1
    2
    3
    4
    5

    编译时配置

    .fes.js 中配置:

    export default {\n    layout: {\n        // 标题\n        title: "Fes.js",\n        // 底部文字\n        footer: 'Created by MumbleFE',\n        // 主题light\n        theme: 'dark'\n        // 是否开启 tabs\n        multiTabs: false,\n        // 布局类型\n        navigation: 'side',\n        // 是否固定头部\n        fixedHeader: false,\n        // 是否固定sidebar\n        fixedSideBar: true,\n        // sidebar的宽度\n        sideWidth: 200,\n        menus: [{\n            name: 'index'\n        }, {\n            name: 'onepiece'\n        }, {\n            name: 'store'\n        }, {\n            name: 'simpleList'\n        }],\n        menuConfig: {\n            defaultExpandAll: false,\n            expandedKeys: [],\n            accordion: false\n        }\n    },\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    • 类型String

    • 默认值null

    • 详情:页面底部的文字。

    theme

    • 类型String

    • 默认值dark

    • 详情:主题,可选有 darklight

    • 类型String

    • 默认值side

    • 详情:页面布局类型,可选有 sidetopmixin

    fixedHeader

    • 类型Boolean

    • 默认值false

    • 详情:是否固定头部,不跟随页面滚动。

    fixedSideBar

    • 类型Boolean

    • 默认值true

    • 详情:是否固定sidebar,不跟随页面滚动。

    title

    • 类型String

    • 默认值name in package.json

    • 详情:产品名,会显示在 Logo 旁边。

    • 类型String

    • 默认值:默认提供 fes.js 的 Logo

    • 详情:Logo的链接

    multiTabs

    • 类型boolean

    • 默认值false

    • 详情:是否开启多页。

    ',30),w=(0,e._)("li",null,[(0,e._)("p",null,[(0,e._)("strong",null,"类型"),(0,e.Uk)(":"),(0,e._)("code",null,"Array")])],-1),E=(0,e._)("li",null,[(0,e._)("p",null,[(0,e._)("strong",null,"默认值"),(0,e.Uk)(":"),(0,e._)("code",null,"[]")])],-1),A=(0,e._)("p",null,[(0,e._)("strong",null,"详情"),(0,e.Uk)(":菜单配置,子项具体配置如下:")],-1),q=(0,e._)("strong",null,"name",-1),C=(0,e.Uk)(":菜单的名称。通过匹配 "),B=(0,e._)("code",null,"name",-1),F=(0,e.Uk)(" 和路由元信息 "),H=(0,e.Uk)("meta"),S=(0,e.Uk)(" 中的 "),R=(0,e._)("code",null,"name",-1),L=(0,e.Uk)(",把菜单和路由关联起来,\b然后使用路由元信息补充菜单配置,比如 "),W=(0,e._)("code",null,"title",-1),I=(0,e.Uk)("、"),O=(0,e._)("code",null,"path",-1),$=(0,e.Uk)(" \b等。"),z=(0,e._)("li",null,[(0,e._)("p",null,[(0,e._)("strong",null,"path"),(0,e.Uk)(":菜单的路径,可配置第三方地址。")])],-1),M=(0,e._)("li",null,[(0,e._)("p",null,[(0,e._)("strong",null,"match"),(0,e.Uk)(":额外匹配的路径,当前路由命中匹配规则时,此菜单高亮。 (v4.0.0+)")])],-1),T=(0,e.uE)('
    {\n    path: '/product',\n    match: ['/product/*', '/product/create']\n}\n
    1
    2
    3
    4
    ',1),D=(0,e._)("strong",null,"title",-1),K=(0,e.Uk)(":菜单的标题,如果同时使用"),N=(0,e.Uk)("国际化插件"),Z=(0,e.Uk)(",而且"),P=(0,e._)("code",null,"title",-1),V=(0,e.Uk)("的值以"),Y=(0,e._)("code",null,"$",-1),G=(0,e.Uk)("开头,则使用"),J=(0,e._)("code",null,"$",-1),Q=(0,e.Uk)("后面的内容去匹配语言设置。"),X=(0,e._)("p",null,[(0,e._)("strong",null,"icon"),(0,e.Uk)(": 菜单的图标,只有一级标题展示图标。")],-1),nn=(0,e.Uk)("图标使用"),sn={href:"https://fes-design-4gvn317r3b6bfe17-1254145788.ap-shanghai.app.tcloudbase.com/zh/components/icon.html",target:"_blank",rel:"noopener noreferrer"},an=(0,e.Uk)("fes-design icon"),en=(0,e.Uk)(",在这里使用组件名称。"),pn=(0,e.uE)('
    {\n    icon: "AppstoreOutlined"\n}\n
    1
    2
    3
    - 图标使用本地或者远程svg图片。\n
    {\n    icon: "/wine-outline.svg"\n}\n
    1
    2
    3
    • children:子菜单配置。
    • 类型Object

    • 默认值{}

    • 详情:菜单的配置:

      • defaultExpandAll:是否默认展开全部菜单。

      • expandedKeys:配置默认展开的菜单,需要传子项是菜单路径的数组。

      • accordion:是否只保持一个子菜单的展开。

    运行时配置

    app.js 中配置:

    import UserCenter from '@/components/UserCenter';\nexport const layout = {\n    customHeader: <UserCenter />\n};\n\n
    1
    2
    3
    4
    5
    • 类型(defaultMenus: [] )=> Ref | []

    • 详情:运行时修改菜单,入参是默认菜单配置(.fes.js中的menu配置),需要返回一个Ref或者数组。

    import { ClusterOutlined } from '@fesjs/fes-design/icon'\nexport const layout = layoutConfig => ({\n    ...layoutConfig,\n    customHeader: <UserCenter />,\n    menus: (defaultMenuData) => {\n        const menusRef = ref(defaultMenuData);\n        watch(() => layoutConfig.initialState.userName, () => {\n            menusRef.value = [{\n                name: 'store',\n                icon: <ClusterOutlined />\n            }];\n        });\n        return menusRef;\n    }\n});\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    layoutConfig.initialStatebeforeRender.action执行后创建的应用初始状态数据。

    如果菜单需要根据某些状态动态改变,则返回Ref,否则只需要返回数组。

    提示

    在运行时配置菜单中的icon,需要传组件本身,而不是组件的名称。

    • 类型String

    • 默认值true

    • 详情:是否显示 header 区域。

    • 类型String

    • 默认值true

    • 详情:是否显示 sidebar 区域。

    logo

    • 类型String

    • 默认值true

    • 详情:是否显示 logo 区域。

    customHeader

    • 类型:Vue Component

    • 默认值null

    • 详情:top的区域部分位置提供组件自定义功能。

    unAccessHandler

    ',24),tn=(0,e.uE)("
  • 类型Function

  • 默认值null

  • 详情

    当进入某个路由时,如果路由对应的页面不属于可见资源列表,则会暂停进入,调用 unAccessHandler 函数。

  • ",3),ln=(0,e._)("p",null,[(0,e._)("strong",null,"参数")],-1),on=(0,e._)("li",null,"router:createRouter 创建的路由实例",-1),cn=(0,e._)("li",null,"to: 准备进入的路由",-1),rn=(0,e._)("li",null,"from:离开的路由",-1),un=(0,e.Uk)("next: "),dn={href:"https://next.router.vuejs.org/zh/guide/advanced/navigation-guards.html#%E5%8F%AF%E9%80%89%E7%9A%84%E7%AC%AC%E4%B8%89%E4%B8%AA%E5%8F%82%E6%95%B0-next",target:"_blank",rel:"noopener noreferrer"},kn=(0,e.Uk)("next函数"),gn=(0,e.uE)('

    比如:

    export const access = {\n    unAccessHandler({ to, next }) {\n        const accesssIds = accessApi.getAccess();\n        if (to.path === '/404') {\n            accessApi.setAccess(accesssIds.concat(['/404']));\n            return next('/404');\n        }\n        if (!accesssIds.includes('/403')) {\n            accessApi.setAccess(accesssIds.concat(['/403']));\n        }\n        next('/403');\n    }\n};\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    noFoundHandler

    ',3),bn=(0,e.uE)("
  • 类型:函数

  • 默认值:null

  • 详情

    当进入某个路由时,如果路由对应的页面不存在,则会调用 noFoundHandler 函数。

  • ",3),mn=(0,e._)("p",null,[(0,e._)("strong",null,"参数")],-1),hn=(0,e._)("li",null,"router:createRouter 创建的路由实例",-1),fn=(0,e._)("li",null,"to: 准备进入的路由",-1),vn=(0,e._)("li",null,"from:离开的路由",-1),yn=(0,e.Uk)("next: "),xn={href:"https://next.router.vuejs.org/zh/guide/advanced/navigation-guards.html#%E5%8F%AF%E9%80%89%E7%9A%84%E7%AC%AC%E4%B8%89%E4%B8%AA%E5%8F%82%E6%95%B0-next",target:"_blank",rel:"noopener noreferrer"},_n=(0,e.Uk)("next函数"),jn=(0,e.uE)('

    比如:

    export const access = {\n    noFoundHandler({ next }) {\n        const accesssIds = accessApi.getAccess();\n        if (!accesssIds.includes('/404')) {\n            accessApi.setAccess(accesssIds.concat(['/404']));\n        }\n        next('/404');\n    }\n};\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    logoUrl

    • 类型String

    • 默认值:默认提供 fes.js 的 Logo

    • 详情:Logo的链接。

    其他运行时配置 (> 4.1.0)

    编译时配置的内容同样支持在运行时配置,但是logo除外,用logoUrl替代。

    ',6),Un={},wn=(0,a(3744).Z)(Un,[["render",function(n,s){const a=(0,e.up)("RouterLink"),Un=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,t,l,(0,e._)("ul",null,[o,(0,e._)("li",null,[(0,e._)("p",null,[c,(0,e.Wm)(a,{to:"/reference/plugin/plugins/access.html"},{default:(0,e.w5)((()=>[r])),_:1}),i])]),(0,e._)("li",null,[(0,e._)("p",null,[u,(0,e.Wm)(a,{to:"/reference/plugin/plugins/locale.html"},{default:(0,e.w5)((()=>[d])),_:1}),k])]),g,b,m,h]),f,(0,e._)("img",{src:n.$withBase("side.png"),alt:"side"},null,8,v),y,(0,e._)("img",{src:n.$withBase("top.png"),alt:"top"},null,8,x),_,(0,e._)("img",{src:n.$withBase("mixin.png"),alt:"mixin"},null,8,j),U,(0,e._)("ul",null,[w,E,(0,e._)("li",null,[A,(0,e._)("ul",null,[(0,e._)("li",null,[(0,e._)("p",null,[q,C,B,F,(0,e.Wm)(a,{to:"/guide/route.html#%E6%89%A9%E5%B1%95%E8%B7%AF%E7%94%B1%E5%85%83%E4%BF%A1%E6%81%AF"},{default:(0,e.w5)((()=>[H])),_:1}),S,R,L,W,I,O,$])]),z,M])])]),T,(0,e._)("ul",null,[(0,e._)("li",null,[(0,e._)("p",null,[D,K,(0,e.Wm)(a,{to:"/reference/plugin/plugins/locale.html"},{default:(0,e.w5)((()=>[N])),_:1}),Z,P,V,Y,G,J,Q])]),(0,e._)("li",null,[X,(0,e._)("ul",null,[(0,e._)("li",null,[nn,(0,e._)("a",sn,[an,(0,e.Wm)(Un)]),en])])])]),pn,(0,e._)("ul",null,[tn,(0,e._)("li",null,[ln,(0,e._)("ul",null,[on,cn,rn,(0,e._)("li",null,[un,(0,e._)("a",dn,[kn,(0,e.Wm)(Un)])])])])]),gn,(0,e._)("ul",null,[bn,(0,e._)("li",null,[mn,(0,e._)("ul",null,[hn,fn,vn,(0,e._)("li",null,[yn,(0,e._)("a",xn,[_n,(0,e.Wm)(Un)])])])])]),jn],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-355ee23e.f2dde2a4.js b/assets/js/v-355ee23e.f2dde2a4.js new file mode 100644 index 00000000..3429f9b8 --- /dev/null +++ b/assets/js/v-355ee23e.f2dde2a4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[475],{1783:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-355ee23e",path:"/reference/plugin/plugins/layout.html",title:"@fesjs/plugin-layout",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"布局类型",slug:"布局类型",children:[{level:3,title:"side",slug:"side",children:[]},{level:3,title:"top",slug:"top",children:[]},{level:3,title:"mixin",slug:"mixin",children:[]},{level:3,title:"页面禁用布局",slug:"页面禁用布局",children:[]}]},{level:2,title:"keep-alive",slug:"keep-alive",children:[]},{level:2,title:"编译时配置",slug:"编译时配置",children:[{level:3,title:"footer",slug:"footer",children:[]},{level:3,title:"theme",slug:"theme",children:[]},{level:3,title:"navigation",slug:"navigation",children:[]},{level:3,title:"fixedHeader",slug:"fixedheader",children:[]},{level:3,title:"fixedSideBar",slug:"fixedsidebar",children:[]},{level:3,title:"title",slug:"title",children:[]},{level:3,title:"logo",slug:"logo",children:[]},{level:3,title:"multiTabs",slug:"multitabs",children:[]},{level:3,title:"menus",slug:"menus",children:[]},{level:3,title:"menusConfig",slug:"menusconfig",children:[]}]},{level:2,title:"运行时配置",slug:"运行时配置",children:[{level:3,title:"menus",slug:"menus-1",children:[]},{level:3,title:"header",slug:"header",children:[]},{level:3,title:"sidebar",slug:"sidebar",children:[]},{level:3,title:"logo",slug:"logo-1",children:[]},{level:3,title:"customHeader",slug:"customheader",children:[]},{level:3,title:"unAccessHandler",slug:"unaccesshandler",children:[]},{level:3,title:"noFoundHandler",slug:"nofoundhandler",children:[]},{level:3,title:"logoUrl",slug:"logourl",children:[]},{level:3,title:"其他运行时配置 (> 4.1.0)",slug:"其他运行时配置-4-1-0",children:[]}]}],filePathRelative:"reference/plugin/plugins/layout.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},2891:(n,s,a)=>{a.r(s),a.d(s,{default:()=>Q});var e=a(6252);const p=(0,e._)("h1",{id:"fesjs-plugin-layout",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#fesjs-plugin-layout","aria-hidden":"true"},"#"),(0,e.Uk)(" @fesjs/plugin-layout")],-1),t=(0,e._)("h2",{id:"介绍",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),(0,e.Uk)(" 介绍")],-1),l=(0,e._)("p",null,"为了进一步降低研发成本,我们尝试将布局通过 fes 插件的方式内置,只需通过简单的配置即可拥有布局,包括导航以及侧边栏。从而做到用户无需关心布局。",-1),o=(0,e.uE)("
  • 侧边栏菜单数据根据路由中的配置自动生成。

  • 布局,提供 sidetopmixin 三种布局。

  • 主题,提供 lightdark 两种主题。

  • 默认实现对路由的 404、403 处理。

  • ",4),c=(0,e._)("li",null,[(0,e._)("p",null,"支持自定义头部区域。")],-1),r=(0,e._)("li",null,[(0,e._)("p",null,"菜单支持配置icon")],-1),i=(0,e._)("li",null,[(0,e._)("p",null,"菜单标题支持国际化")],-1),u=(0,e._)("li",null,[(0,e._)("p",null,"可配置页面是否需要 layout。")],-1),d=(0,e.uE)('

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-layout": "^4.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    布局类型

    配置参数是 navigation, 布局有三种类型 sidemixintop, 默认是 side

    export default {\n    layout: {\n        navigation: 'side'\n    }\n}\n
    1
    2
    3
    4
    5

    side

    ',7),k=["src"],g=(0,e._)("h3",{id:"top",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#top","aria-hidden":"true"},"#"),(0,e.Uk)(" top")],-1),b=["src"],m=(0,e._)("h3",{id:"mixin",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#mixin","aria-hidden":"true"},"#"),(0,e.Uk)(" mixin")],-1),h=["src"],f=(0,e.uE)('

    页面禁用布局

    布局是默认开启的,但是可能某些页面不需要展示布局样式,比如登录页面。我们只需要在页面的.vue中添加如下配置:

    <config lang="json">\n{\n    "layout": false\n}\n</config>\n
    1
    2
    3
    4
    5

    如果只是不想展示sidebar,则:

    <config lang="json">\n{\n    "layout": {\n        "sidebar": false\n    }\n}\n</config>\n
    1
    2
    3
    4
    5
    6
    7

    layout的可选配置有:

    • sidebar: 左侧区域,从v4.0.0开始,之前名称叫side

    • header: 头部区域,从v4.0.0开始,之前名称叫top

    • logo:logo和标题区域。

    keep-alive

    从 4.0.7 开始支持配置路由页面缓存:

    <config lang="json">\n{\n    "keep-alive": true\n}\n</config>\n
    1
    2
    3
    4
    5

    编译时配置

    .fes.js 中配置:

    export default {\n    layout: {\n        // 标题\n        title: "Fes.js",\n        // 底部文字\n        footer: 'Created by MumbleFE',\n        // 主题light\n        theme: 'dark'\n        // 是否开启 tabs\n        multiTabs: false,\n        // 布局类型\n        navigation: 'side',\n        // 是否固定头部\n        fixedHeader: false,\n        // 是否固定sidebar\n        fixedSideBar: true,\n        // sidebar的宽度\n        sideWidth: 200,\n        menus: [{\n            name: 'index'\n        }, {\n            name: 'onepiece'\n        }, {\n            name: 'store'\n        }, {\n            name: 'simpleList'\n        }],\n        menuConfig: {\n            defaultExpandAll: false,\n            expandedKeys: [],\n            accordion: false\n        }\n    },\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    • 类型String

    • 默认值null

    • 详情:页面底部的文字。

    theme

    • 类型String

    • 默认值dark

    • 详情:主题,可选有 darklight

    • 类型String

    • 默认值side

    • 详情:页面布局类型,可选有 sidetopmixin

    fixedHeader

    • 类型Boolean

    • 默认值false

    • 详情:是否固定头部,不跟随页面滚动。

    fixedSideBar

    • 类型Boolean

    • 默认值true

    • 详情:是否固定sidebar,不跟随页面滚动。

    title

    • 类型String

    • 默认值name in package.json

    • 详情:产品名,会显示在 Logo 旁边。

    • 类型String

    • 默认值:默认提供 fes.js 的 Logo

    • 详情:Logo的链接

    multiTabs

    • 类型boolean

    • 默认值false

    • 详情:是否开启多页。

    ',30),v=(0,e._)("li",null,[(0,e._)("p",null,[(0,e._)("strong",null,"类型"),(0,e.Uk)(":"),(0,e._)("code",null,"Array")])],-1),y=(0,e._)("li",null,[(0,e._)("p",null,[(0,e._)("strong",null,"默认值"),(0,e.Uk)(":"),(0,e._)("code",null,"[]")])],-1),x=(0,e._)("p",null,[(0,e._)("strong",null,"详情"),(0,e.Uk)(":菜单配置,子项具体配置如下:")],-1),_=(0,e._)("strong",null,"name",-1),j=(0,e._)("code",null,"name",-1),U=(0,e._)("code",null,"name",-1),w=(0,e._)("code",null,"title",-1),E=(0,e._)("code",null,"path",-1),A=(0,e._)("li",null,[(0,e._)("p",null,[(0,e._)("strong",null,"path"),(0,e.Uk)(":菜单的路径,可配置第三方地址。")])],-1),q=(0,e._)("li",null,[(0,e._)("p",null,[(0,e._)("strong",null,"match"),(0,e.Uk)(":额外匹配的路径,当前路由命中匹配规则时,此菜单高亮。 (v4.0.0+)")])],-1),C=(0,e.uE)('
    {\n    path: '/product',\n    match: ['/product/*', '/product/create']\n}\n
    1
    2
    3
    4
    ',1),B=(0,e._)("strong",null,"title",-1),F=(0,e._)("code",null,"title",-1),H=(0,e._)("code",null,"$",-1),S=(0,e._)("code",null,"$",-1),R=(0,e._)("p",null,[(0,e._)("strong",null,"icon"),(0,e.Uk)(": 菜单的图标,只有一级标题展示图标。")],-1),L={href:"https://fes-design-4gvn317r3b6bfe17-1254145788.ap-shanghai.app.tcloudbase.com/zh/components/icon.html",target:"_blank",rel:"noopener noreferrer"},W=(0,e.uE)('
    {\n    icon: "AppstoreOutlined"\n}\n
    1
    2
    3
    - 图标使用本地或者远程svg图片。\n
    {\n    icon: "/wine-outline.svg"\n}\n
    1
    2
    3
    • children:子菜单配置。
    • 类型Object

    • 默认值{}

    • 详情:菜单的配置:

      • defaultExpandAll:是否默认展开全部菜单。

      • expandedKeys:配置默认展开的菜单,需要传子项是菜单路径的数组。

      • accordion:是否只保持一个子菜单的展开。

    运行时配置

    app.js 中配置:

    import UserCenter from '@/components/UserCenter';\nexport const layout = {\n    customHeader: <UserCenter />\n};\n\n
    1
    2
    3
    4
    5
    • 类型(defaultMenus: [] )=> Ref | []

    • 详情:运行时修改菜单,入参是默认菜单配置(.fes.js中的menu配置),需要返回一个Ref或者数组。

    import { ClusterOutlined } from '@fesjs/fes-design/icon'\nexport const layout = layoutConfig => ({\n    ...layoutConfig,\n    customHeader: <UserCenter />,\n    menus: (defaultMenuData) => {\n        const menusRef = ref(defaultMenuData);\n        watch(() => layoutConfig.initialState.userName, () => {\n            menusRef.value = [{\n                name: 'store',\n                icon: <ClusterOutlined />\n            }];\n        });\n        return menusRef;\n    }\n});\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    layoutConfig.initialStatebeforeRender.action执行后创建的应用初始状态数据。

    如果菜单需要根据某些状态动态改变,则返回Ref,否则只需要返回数组。

    提示

    在运行时配置菜单中的icon,需要传组件本身,而不是组件的名称。

    • 类型String

    • 默认值true

    • 详情:是否显示 header 区域。

    • 类型String

    • 默认值true

    • 详情:是否显示 sidebar 区域。

    logo

    • 类型String

    • 默认值true

    • 详情:是否显示 logo 区域。

    customHeader

    • 类型:Vue Component

    • 默认值null

    • 详情:top的区域部分位置提供组件自定义功能。

    unAccessHandler

    ',24),I=(0,e.uE)("
  • 类型Function

  • 默认值null

  • 详情

    当进入某个路由时,如果路由对应的页面不属于可见资源列表,则会暂停进入,调用 unAccessHandler 函数。

  • ",3),O=(0,e._)("p",null,[(0,e._)("strong",null,"参数")],-1),$=(0,e._)("li",null,"router:createRouter 创建的路由实例",-1),z=(0,e._)("li",null,"to: 准备进入的路由",-1),M=(0,e._)("li",null,"from:离开的路由",-1),T={href:"https://next.router.vuejs.org/zh/guide/advanced/navigation-guards.html#%E5%8F%AF%E9%80%89%E7%9A%84%E7%AC%AC%E4%B8%89%E4%B8%AA%E5%8F%82%E6%95%B0-next",target:"_blank",rel:"noopener noreferrer"},D=(0,e.uE)('

    比如:

    export const access = {\n    unAccessHandler({ to, next }) {\n        const accesssIds = accessApi.getAccess();\n        if (to.path === '/404') {\n            accessApi.setAccess(accesssIds.concat(['/404']));\n            return next('/404');\n        }\n        if (!accesssIds.includes('/403')) {\n            accessApi.setAccess(accesssIds.concat(['/403']));\n        }\n        next('/403');\n    }\n};\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    noFoundHandler

    ',3),K=(0,e.uE)("
  • 类型:函数

  • 默认值:null

  • 详情

    当进入某个路由时,如果路由对应的页面不存在,则会调用 noFoundHandler 函数。

  • ",3),N=(0,e._)("p",null,[(0,e._)("strong",null,"参数")],-1),Z=(0,e._)("li",null,"router:createRouter 创建的路由实例",-1),P=(0,e._)("li",null,"to: 准备进入的路由",-1),V=(0,e._)("li",null,"from:离开的路由",-1),Y={href:"https://next.router.vuejs.org/zh/guide/advanced/navigation-guards.html#%E5%8F%AF%E9%80%89%E7%9A%84%E7%AC%AC%E4%B8%89%E4%B8%AA%E5%8F%82%E6%95%B0-next",target:"_blank",rel:"noopener noreferrer"},G=(0,e.uE)('

    比如:

    export const access = {\n    noFoundHandler({ next }) {\n        const accesssIds = accessApi.getAccess();\n        if (!accesssIds.includes('/404')) {\n            accessApi.setAccess(accesssIds.concat(['/404']));\n        }\n        next('/404');\n    }\n};\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    logoUrl

    • 类型String

    • 默认值:默认提供 fes.js 的 Logo

    • 详情:Logo的链接。

    其他运行时配置 (> 4.1.0)

    编译时配置的内容同样支持在运行时配置,但是logo除外,用logoUrl替代。

    ',6),J={},Q=(0,a(3744).Z)(J,[["render",function(n,s){const a=(0,e.up)("RouterLink"),J=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,t,l,(0,e._)("ul",null,[o,(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("搭配 "),(0,e.Wm)(a,{to:"/reference/plugin/plugins/access.html"},{default:(0,e.w5)((()=>[(0,e.Uk)("@fesjs/plugin-access")])),_:1}),(0,e.Uk)(" 插件使用,可以完成对路由的权限控制。")])]),(0,e._)("li",null,[(0,e._)("p",null,[(0,e.Uk)("搭配 "),(0,e.Wm)(a,{to:"/reference/plugin/plugins/locale.html"},{default:(0,e.w5)((()=>[(0,e.Uk)("@fesjs/plugin-locale")])),_:1}),(0,e.Uk)(" 插件使用,提供切换语言的能力。")])]),c,r,i,u]),d,(0,e._)("img",{src:n.$withBase("side.png"),alt:"side"},null,8,k),g,(0,e._)("img",{src:n.$withBase("top.png"),alt:"top"},null,8,b),m,(0,e._)("img",{src:n.$withBase("mixin.png"),alt:"mixin"},null,8,h),f,(0,e._)("ul",null,[v,y,(0,e._)("li",null,[x,(0,e._)("ul",null,[(0,e._)("li",null,[(0,e._)("p",null,[_,(0,e.Uk)(":菜单的名称。通过匹配 "),j,(0,e.Uk)(" 和路由元信息 "),(0,e.Wm)(a,{to:"/guide/route.html#%E6%89%A9%E5%B1%95%E8%B7%AF%E7%94%B1%E5%85%83%E4%BF%A1%E6%81%AF"},{default:(0,e.w5)((()=>[(0,e.Uk)("meta")])),_:1}),(0,e.Uk)(" 中的 "),U,(0,e.Uk)(",把菜单和路由关联起来,\b然后使用路由元信息补充菜单配置,比如 "),w,(0,e.Uk)("、"),E,(0,e.Uk)(" \b等。")])]),A,q])])]),C,(0,e._)("ul",null,[(0,e._)("li",null,[(0,e._)("p",null,[B,(0,e.Uk)(":菜单的标题,如果同时使用"),(0,e.Wm)(a,{to:"/reference/plugin/plugins/locale.html"},{default:(0,e.w5)((()=>[(0,e.Uk)("国际化插件")])),_:1}),(0,e.Uk)(",而且"),F,(0,e.Uk)("的值以"),H,(0,e.Uk)("开头,则使用"),S,(0,e.Uk)("后面的内容去匹配语言设置。")])]),(0,e._)("li",null,[R,(0,e._)("ul",null,[(0,e._)("li",null,[(0,e.Uk)("图标使用"),(0,e._)("a",L,[(0,e.Uk)("fes-design icon"),(0,e.Wm)(J)]),(0,e.Uk)(",在这里使用组件名称。")])])])]),W,(0,e._)("ul",null,[I,(0,e._)("li",null,[O,(0,e._)("ul",null,[$,z,M,(0,e._)("li",null,[(0,e.Uk)("next: "),(0,e._)("a",T,[(0,e.Uk)("next函数"),(0,e.Wm)(J)])])])])]),D,(0,e._)("ul",null,[K,(0,e._)("li",null,[N,(0,e._)("ul",null,[Z,P,V,(0,e._)("li",null,[(0,e.Uk)("next: "),(0,e._)("a",Y,[(0,e.Uk)("next函数"),(0,e.Wm)(J)])])])])]),G],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-3706649a.87ee1900.js b/assets/js/v-3706649a.6d045efa.js similarity index 100% rename from assets/js/v-3706649a.87ee1900.js rename to assets/js/v-3706649a.6d045efa.js diff --git a/assets/js/v-37e1c06f.9522953a.js b/assets/js/v-37e1c06f.49408d07.js similarity index 58% rename from assets/js/v-37e1c06f.9522953a.js rename to assets/js/v-37e1c06f.49408d07.js index 2626d241..d93acf6e 100644 --- a/assets/js/v-37e1c06f.9522953a.js +++ b/assets/js/v-37e1c06f.49408d07.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[600],{4384:(e,t,a)=>{a.r(t),a.d(t,{data:()=>r});const r={key:"v-37e1c06f",path:"/guide/faq.html",title:"常见问题",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[],filePathRelative:"guide/faq.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},4708:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var r=a(6252);const n={id:"常见问题",tabindex:"-1"},s=[(0,r._)("a",{class:"header-anchor",href:"#常见问题","aria-hidden":"true"},"#",-1),(0,r.Uk)(" 常见问题")],c={},i=(0,a(3744).Z)(c,[["render",function(e,t){return(0,r.wg)(),(0,r.iD)("h1",n,s)}]])},3744:(e,t)=>{t.Z=(e,t)=>{const a=e.__vccOpts||e;for(const[e,r]of t)a[e]=r;return a}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[600],{4384:(e,t,a)=>{a.r(t),a.d(t,{data:()=>r});const r={key:"v-37e1c06f",path:"/guide/faq.html",title:"常见问题",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[],filePathRelative:"guide/faq.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},4708:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var r=a(6252);const n={id:"常见问题",tabindex:"-1"},s=(0,r._)("a",{class:"header-anchor",href:"#常见问题","aria-hidden":"true"},"#",-1),c={},i=(0,a(3744).Z)(c,[["render",function(e,t){return(0,r.wg)(),(0,r.iD)("h1",n,[s,(0,r.Uk)(" 常见问题")])}]])},3744:(e,t)=>{t.Z=(e,t)=>{const a=e.__vccOpts||e;for(const[e,r]of t)a[e]=r;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-392e58ee.c944921e.js b/assets/js/v-392e58ee.67937c7d.js similarity index 54% rename from assets/js/v-392e58ee.c944921e.js rename to assets/js/v-392e58ee.67937c7d.js index 2d19607c..27a1fb62 100644 --- a/assets/js/v-392e58ee.c944921e.js +++ b/assets/js/v-392e58ee.67937c7d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[802],{6865:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-392e58ee",path:"/reference/plugin/plugins/windicss.html",title:"@fesjs/plugin-windicss",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"配置",slug:"配置",children:[]}],filePathRelative:"reference/plugin/plugins/windicss.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},9673:(n,s,a)=>{a.r(s),a.d(s,{default:()=>h});var e=a(6252);const p=(0,e.uE)('

    @fesjs/plugin-windicss

    介绍

    windicss 支持

    启用方式

    package.json 中引入依赖:

    {\n    "devDependencies": {\n        "@fesjs/plugin-windicss": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5

    配置

    ',7),t=(0,e.Uk)("在 "),r=(0,e._)("code",null,".fes.js",-1),l=(0,e.Uk)(" 配置文件中添加自定义配置,详细配置"),i={href:"https://windicss.org/integrations/webpack.html",target:"_blank",rel:"noopener noreferrer"},c=(0,e.Uk)("请看"),o=(0,e.Uk)(":"),u=(0,e.uE)('
    export default {\n    windicss: {\n        root: './',\n    }\n}\n
    1
    2
    3
    4
    5
    ',1),d={},h=(0,a(3744).Z)(d,[["render",function(n,s){const a=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,(0,e._)("p",null,[t,r,l,(0,e._)("a",i,[c,(0,e.Wm)(a)]),o]),u],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[802],{6865:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-392e58ee",path:"/reference/plugin/plugins/windicss.html",title:"@fesjs/plugin-windicss",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"配置",slug:"配置",children:[]}],filePathRelative:"reference/plugin/plugins/windicss.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},9673:(n,s,a)=>{a.r(s),a.d(s,{default:()=>c});var e=a(6252);const p=(0,e.uE)('

    @fesjs/plugin-windicss

    介绍

    windicss 支持

    启用方式

    package.json 中引入依赖:

    {\n    "devDependencies": {\n        "@fesjs/plugin-windicss": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5

    配置

    ',7),t=(0,e._)("code",null,".fes.js",-1),r={href:"https://windicss.org/integrations/webpack.html",target:"_blank",rel:"noopener noreferrer"},l=(0,e.uE)('
    export default {\n    windicss: {\n        root: './',\n    }\n}\n
    1
    2
    3
    4
    5
    ',1),i={},c=(0,a(3744).Z)(i,[["render",function(n,s){const a=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,(0,e._)("p",null,[(0,e.Uk)("在 "),t,(0,e.Uk)(" 配置文件中添加自定义配置,详细配置"),(0,e._)("a",r,[(0,e.Uk)("请看"),(0,e.Wm)(a)]),(0,e.Uk)(":")]),l],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-3c4e521e.2dd96637.js b/assets/js/v-3c4e521e.b813ace2.js similarity index 99% rename from assets/js/v-3c4e521e.2dd96637.js rename to assets/js/v-3c4e521e.b813ace2.js index 0184f188..a06e4487 100644 --- a/assets/js/v-3c4e521e.2dd96637.js +++ b/assets/js/v-3c4e521e.b813ace2.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[925],{1371:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-3c4e521e",path:"/reference/plugin/plugins/model.html",title:"@fesjs/plugin-model",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"介绍",slug:"介绍",children:[{level:3,title:"Model 文件",slug:"model-文件",children:[]},{level:3,title:"在组件中使用 Model",slug:"在组件中使用-model",children:[]},{level:3,title:"@@initialState",slug:"initialstate",children:[]}]},{level:2,title:"API",slug:"api",children:[{level:3,title:"useModel",slug:"usemodel",children:[]}]}],filePathRelative:"reference/plugin/plugins/model.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},7746:(n,s,a)=>{a.r(s),a.d(s,{default:()=>t});const p=(0,a(6252).uE)('

    @fesjs/plugin-model

    启用方式

    在 package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-model": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    介绍

    一种简易的数据管理方案。我们知道 Vue 的理念是用响应式数据驱动UI更新,提供 reactiveref 等API把数据变成响应式的。我们使用Provide / Inject特性,在应用实例中共享响应式数据。

    我们约定src/models 目录下的文件为项目定义的 model 文件。每个文件需要默认导出一个 function

    文件名则对应最终 modelname,你可以通过插件提供的 API 来消费 model 中的数据。

    Model 文件

    src/models/useAuthModel.js

    import { reactive } from 'vue'\n\nexport default function useAuthModel() {\n  const user = reactive({});\n\n  const signin = ()=>{\n      // todo\n  }\n\n  const signout = ()=>{\n      // todo\n  }\n\n  return {\n    user,\n    signin,\n    signout\n  }\n}\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19

    在组件中使用 Model

    <script>\nimport { useModel } from "@fesjs/fes"\nexport default {\n    setup(){\n        const { user, signin, signout } = useModel("useAuthModel")\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8

    @@initialState

    beforeRender的返回的内容会写入@@initialState

    export const beforeRender = {\n    loading: <PageLoading />,\n    action() {\n        const { setRole } = access;\n        return new Promise((resolve) => {\n            setTimeout(() => {\n                setRole('admin');\n                // 初始化应用的全局状态,可以通过 useModel('@@initialState') 获取,具体用法看@/components/UserCenter 文件\n                resolve({\n                    userName: 'harrywan'\n                });\n            }, 1000);\n        });\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    然后我们可以在其他组件中使用:

    <template>\n    <div class="right">{{initialState.userName}}</div>\n</template>\n<script>\nimport { useModel } from '@fesjs/fes';\n\nexport default {\n    setup() {\n        const initialState = useModel('@@initialState');\n        return {\n            initialState\n        };\n    }\n};\n</script>\n<style scope>\n</style>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

    API

    useModel

    useModel(name)

    • 类型:函数

    • 详情: 获取 Model 数据,\b也就是 Model 文件默认导出函数执行的结果。

    • 参数

      • name,传入 Model 文件名
    ',22),e={},t=(0,a(3744).Z)(e,[["render",function(n,s){return p}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[925],{1371:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-3c4e521e",path:"/reference/plugin/plugins/model.html",title:"@fesjs/plugin-model",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"介绍",slug:"介绍",children:[{level:3,title:"Model 文件",slug:"model-文件",children:[]},{level:3,title:"在组件中使用 Model",slug:"在组件中使用-model",children:[]},{level:3,title:"@@initialState",slug:"initialstate",children:[]}]},{level:2,title:"API",slug:"api",children:[{level:3,title:"useModel",slug:"usemodel",children:[]}]}],filePathRelative:"reference/plugin/plugins/model.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},7746:(n,s,a)=>{a.r(s),a.d(s,{default:()=>t});const p=(0,a(6252).uE)('

    @fesjs/plugin-model

    启用方式

    在 package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-model": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    介绍

    一种简易的数据管理方案。我们知道 Vue 的理念是用响应式数据驱动UI更新,提供 reactiveref 等API把数据变成响应式的。我们使用Provide / Inject特性,在应用实例中共享响应式数据。

    我们约定src/models 目录下的文件为项目定义的 model 文件。每个文件需要默认导出一个 function

    文件名则对应最终 modelname,你可以通过插件提供的 API 来消费 model 中的数据。

    Model 文件

    src/models/useAuthModel.js

    import { reactive } from 'vue'\n\nexport default function useAuthModel() {\n  const user = reactive({});\n\n  const signin = ()=>{\n      // todo\n  }\n\n  const signout = ()=>{\n      // todo\n  }\n\n  return {\n    user,\n    signin,\n    signout\n  }\n}\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19

    在组件中使用 Model

    <script>\nimport { useModel } from "@fesjs/fes"\nexport default {\n    setup(){\n        const { user, signin, signout } = useModel("useAuthModel")\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8

    @@initialState

    beforeRender的返回的内容会写入@@initialState

    export const beforeRender = {\n    loading: <PageLoading />,\n    action() {\n        const { setRole } = access;\n        return new Promise((resolve) => {\n            setTimeout(() => {\n                setRole('admin');\n                // 初始化应用的全局状态,可以通过 useModel('@@initialState') 获取,具体用法看@/components/UserCenter 文件\n                resolve({\n                    userName: 'harrywan'\n                });\n            }, 1000);\n        });\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    然后我们可以在其他组件中使用:

    <template>\n    <div class="right">{{initialState.userName}}</div>\n</template>\n<script>\nimport { useModel } from '@fesjs/fes';\n\nexport default {\n    setup() {\n        const initialState = useModel('@@initialState');\n        return {\n            initialState\n        };\n    }\n};\n</script>\n<style scope>\n</style>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

    API

    useModel

    useModel(name)

    • 类型:函数

    • 详情: 获取 Model 数据,\b也就是 Model 文件默认导出函数执行的结果。

    • 参数

      • name,传入 Model 文件名
    ',22),e={},t=(0,a(3744).Z)(e,[["render",function(n,s){return p}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-3cd5a4ef.7a6ef2c7.js b/assets/js/v-3cd5a4ef.7a6ef2c7.js new file mode 100644 index 00000000..247a1aa7 --- /dev/null +++ b/assets/js/v-3cd5a4ef.7a6ef2c7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[977],{5393:(n,s,e)=>{e.r(s),e.d(s,{data:()=>a});const a={key:"v-3cd5a4ef",path:"/reference/plugin/plugins/jest.html",title:"@fesjs/plugin-jest",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"约定",slug:"约定",children:[]},{level:2,title:"命令",slug:"命令",children:[]},{level:2,title:"配置",slug:"配置",children:[{level:3,title:"args 变量",slug:"args-变量",children:[]},{level:3,title:"配置文件",slug:"配置文件",children:[]},{level:3,title:"优先级",slug:"优先级",children:[]}]}],filePathRelative:"reference/plugin/plugins/jest.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},914:(n,s,e)=>{e.r(s),e.d(s,{default:()=>u});var a=e(6252);const r=(0,a._)("h1",{id:"fesjs-plugin-jest",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#fesjs-plugin-jest","aria-hidden":"true"},"#"),(0,a.Uk)(" @fesjs/plugin-jest")],-1),t={href:"https://www.jestjs.cn/",target:"_blank",rel:"noopener noreferrer"},l=(0,a.uE)('

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-jest": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    约定

    • 项目根目录下 tests__tests__ 文件夹中的 js 或者 jsx 文件为测试文件。
    • 需要覆盖测试的文件范围是src/index.{js,jsx,ts,tsx,vue}

    例如测试文件 add.js

    fes-template\n├── __tests__\n│   └── add.js\n└── src\n    ├── .fes\n    └── utils\n        └── sum.js\n
    1
    2
    3
    4
    5
    6
    7

    内容如下:

    import sum from '@/utils/sum';\ntest('adds 1 + 2 to equal 3', () => {\n    expect(sum(1, 2)).toBe(3);\n});\n\n
    1
    2
    3
    4
    5

    命令

    fes 上注册 test 命令:

    $ fes test\n
    1

    配置

    ',13),i={href:"https://www.jestjs.cn/docs/configuration#reference",target:"_blank",rel:"noopener noreferrer"},p=(0,a._)("code",null,"-h",-1),o=(0,a.uE)('

    args 变量

    $ fes test -h\n
    1

    打印配置帮助信息:

    $ fes test -h\nUsage: fes test [options]\n\nrun unit tests with jest\n\nOptions:\n  --all                         The opposite of `onlyChanged`. If `onlyChanged`\n                                is set by default, running jest with `--all`\n                                will force Jest to run all tests instead of\n                                running only tests related to changed files.\n  --automock                    Automock all files by default.\n  -b --bail                     Exit the test suite immediately after `n`\n                                number of failing tests.\n  --browser                     Respect the "browser" field in package.json\n                                when resolving modules. Some packages export\n                                different versions based on whether they are\n                                operating in node.js or a browser.\n  --cache                       Whether to use the transform cache. Disable the\n                                cache using --no-cache.\n  --cacheDirectory              The directory where Jest should store its\n                                cached  dependency information.\n  --changedFilesWithAncestor    Runs tests related to the current changes and\n                                the changes made in the last commit. Behaves\n                                similarly to `--onlyChanged`.\n  --changedSince                Runs tests related to the changes since the\n                                provided branch. If the current branch has\n                                diverged from the given branch, then only\n                                changes made locally will be tested. Behaves\n                                similarly to `--onlyChanged`.\n  --ci                          Whether to run Jest in continuous integration\n                                (CI) mode. This option is on by default in most\n                                popular CI environments. It will prevent\n                                snapshots from being written unless explicitly\n                                requested.\n  --clearCache                  Clears the configured Jest cache directory and\n                                then exits. Default directory can be found by\n                                calling jest --showConfig\n  --clearMocks                  Automatically clear mock calls and instances\n                                between every test. Equivalent to calling\n                                jest.clearAllMocks() between each test.\n  --collectCoverage             Alias for --coverage.\n  --collectCoverageFrom         A glob pattern relative to <rootDir> matching\n                                the files that coverage info needs to be\n                                collected from.\n  --collectCoverageOnlyFrom     Explicit list of paths coverage will be\n                                restricted to.\n  --color                       Forces test results output color highlighting\n                                (even if stdout is not a TTY). Set to false if\n                                you would like to have no colors.\n  --colors                      Alias for `--color`.\n  -c --config                   The path to a jest config file specifying how\n                                to find and execute tests. If no rootDir is set\n                                in the config, the directory containing the\n                                config file is assumed to be the rootDir for\n                                the project.This can also be a JSON encoded\n                                value which Jest will use as configuration.\n  --coverage                    Indicates that test coverage information should\n                                be collected and reported in the output.\n  --coverageDirectory           The directory where Jest should output its\n                                coverage files.\n  --coveragePathIgnorePatterns  An array of regexp pattern strings that are\n                                matched against all file paths before executing\n                                the test. If the file pathmatches any of the\n                                patterns, coverage information will be skipped.\n  --coverageProvider            Select between Babel and V8 to collect coverage\n  --coverageReporters           A list of reporter names that Jest uses when\n                                writing coverage reports. Any istanbul reporter\n                                can be used.\n  --coverageThreshold           A JSON string with which will be used to\n                                configure minimum threshold enforcement for\n                                coverage results\n  --debug                       Print debugging info about your jest config.\n  --detectLeaks                 **EXPERIMENTAL**: Detect memory leaks in tests.\n                                After executing a test, it will try to garbage\n                                collect the global object used, and fail if it\n                                was leaked\n  --detectOpenHandles           Print out remaining open handles preventing\n                                Jest from exiting at the end of a test run.\n                                Implies `runInBand`.\n  --env                         The test environment used for all tests. This\n                                can point to any file or node module. Examples:\n                                `jsdom`, `node` or `path/to/my-environment.js`\n  --errorOnDeprecated           Make calling deprecated APIs throw helpful\n                                error messages.\n  -e --expand                   Use this flag to show full diffs instead of a\n                                patch.\n  --filter                      Path to a module exporting a filtering\n                                function. This method receives a list of tests\n                                which can be manipulated to exclude tests from\n                                running. Especially useful when used in\n                                conjunction with a testing infrastructure to\n                                filter known broken tests.\n  --findRelatedTests            Find related tests for a list of source files\n                                that were passed in as arguments. Useful for\n                                pre-commit hook integration to run the minimal\n                                amount of tests necessary.\n  --forceExit                   Force Jest to exit after all tests have\n                                completed running. This is useful when\n                                resources set up by test code cannot be\n                                adequately cleaned up.\n  --globalSetup                 The path to a module that runs before All\n                                Tests.\n  --globalTeardown              The path to a module that runs after All Tests.\n  --globals                     A JSON string with map of global variables that\n                                need to be available in all test environments.\n  --haste                       A JSON string with map of variables for the\n                                haste module system\n  --init                        Generate a basic configuration file\n  --injectGlobals               Should Jest inject global variables or not\n  --json                        Prints the test results in JSON. This mode will\n                                send all other test output and user messages to\n                                stderr.\n  --lastCommit                  Run all tests affected by file changes in the\n                                last commit made. Behaves similarly to\n                                `--onlyChanged`.\n  --listTests                   Lists all tests Jest will run given the\n                                arguments and exits. Most useful in a CI system\n                                together with `--findRelatedTests` to determine\n                                the tests Jest will run based on specific files\n  --logHeapUsage                Logs the heap usage after every test. Useful to\n                                debug memory leaks. Use together with\n                                `--runInBand` and `--expose-gc` in node.\n  --mapCoverage                 Maps code coverage reports against original source code when transformers supply source maps.\n\n  DEPRECATED\n  --maxConcurrency              Specifies the maximum number of tests that are\n                                allowed to runconcurrently. This only affects\n                                tests using `test.concurrent`.\n  -w --maxWorkers               Specifies the maximum number of workers the\n                                worker-pool will spawn for running tests. This\n                                defaults to the number of the cores available\n                                on your machine. (its usually best not to\n                                override this default)\n  --moduleDirectories           An array of directory names to be searched\n                                recursively up from the requiring module's\n                                location.\n  --moduleFileExtensions        An array of file extensions your modules use.\n                                If you require modules without specifying a\n                                file extension, these are the extensions Jest\n                                will look for.\n  --moduleNameMapper            A JSON string with a map from regular\n                                expressions to module names or to arrays of\n                                module names that allow to stub out resources,\n                                like images or styles with a single module\n  --modulePathIgnorePatterns    An array of regexp pattern strings that are\n                                matched against all module paths before those\n                                paths are to be considered "visible" to the\n                                module loader.\n  --modulePaths                 An alternative API to setting the NODE_PATH env\n                                variable, modulePaths is an array of absolute\n                                paths to additional locations to search when\n                                resolving modules.\n  --noStackTrace                Disables stack trace in test results output\n  --notify                      Activates notifications for test results.\n  --notifyMode                  Specifies when notifications will appear for\n                                test results.\n  -o --onlyChanged              Attempts to identify which tests to run based\n                                on which files have changed in the current\n                                repository. Only works if you're running tests\n                                in a git or hg repository at the moment.\n  -f --onlyFailures             Run tests that failed in the previous\n                                execution.\n  --outputFile                  Write test results to a file when the --json\n                                option is also specified.\n  --passWithNoTests             Will not fail if no tests are found (for\n                                example while using `--testPathPattern`.)\n  --preset                      A preset that is used as a base for Jest's\n                                configuration.\n  --prettierPath                The path to the "prettier" module used for\n                                inline snapshots.\n  --projects                    A list of projects that use Jest to run all\n                                tests of all projects in a single instance of\n                                Jest.\n  --reporters                   A list of custom reporters for the test suite.\n  --resetMocks                  Automatically reset mock state between every\n                                test. Equivalent to calling\n                                jest.resetAllMocks() between each test.\n  --resetModules                If enabled, the module registry for every test\n                                file will be reset before running each\n                                individual test.\n  --resolver                    A JSON string which allows the use of a custom\n                                resolver.\n  --restoreMocks                Automatically restore mock state and\n                                implementation between every test. Equivalent\n                                to calling jest.restoreAllMocks() between each\n                                test.\n  --rootDir                     The root directory that Jest should scan for\n                                tests and modules within.\n  --roots                       A list of paths to directories that Jest should\n                                use to search for files in.\n  -i --runInBand                Run all tests serially in the current process\n                                (rather than creating a worker pool of child\n                                processes that run tests). This is sometimes\n                                useful for debugging, but such use cases are\n                                pretty rare.\n  --runTestsByPath              Used when provided patterns are exact file\n                                paths. This avoids converting them into a\n                                regular expression and matching it against\n                                every single file.\n  --runner                      Allows to use a custom runner instead of Jest's\n                                default test runner.\n  --selectProjects              Run only the tests of the specified\n                                projects.Jest uses the attribute `displayName`\n                                in the configuration to identify each project.\n  --setupFiles                  A list of paths to modules that run some code\n                                to configure or set up the testing environment\n                                before each test.\n  --setupFilesAfterEnv          A list of paths to modules that run some code\n                                to configure or set up the testing framework\n                                before each test\n  --showConfig                  Print your jest config and then exits.\n  --silent                      Prevent tests from printing messages through\n                                the console.\n  --skipFilter                  Disables the filter provided by --filter.\n                                Useful for CI jobs, or local enforcement when\n                                fixing tests.\n  --snapshotSerializers         A list of paths to snapshot serializer modules\n                                Jest should use for snapshot testing.\n  --testEnvironment             Alias for --env\n  --testEnvironmentOptions      Test environment options that will be passed to\n                                the testEnvironment. The relevant options\n                                depend on the environment.\n  --testFailureExitCode         Exit code of `jest` command if the test run\n                                failed\n  --testLocationInResults       Add `location` information to the test results\n  --testMatch                   The glob patterns Jest uses to detect test\n                                files.\n  -t --testNamePattern          Run only tests with a name that matches the\n                                regex pattern.\n  --testPathIgnorePatterns      An array of regexp pattern strings that are\n                                matched against all test paths before executing\n                                the test. If the test path matches any of the\n                                patterns, it will be skipped.\n  --testPathPattern             A regexp pattern string that is matched against\n                                all tests paths before executing the test.\n  --testRegex                   A string or array of string regexp patterns\n                                that Jest uses to detect test files.\n  --testResultsProcessor        Allows the use of a custom results processor.\n                                This processor must be a node module that\n                                exports a function expecting as the first\n                                argument the result object.\n  --testRunner                  Allows to specify a custom test runner. The\n                                default is  `jasmine2`. A path to a custom test\n                                runner can be provided:\n                                `<rootDir>/path/to/testRunner.js`.\n  --testSequencer               Allows to specify a custom test sequencer. The\n                                default is `@jest/test-sequencer`. A path to a\n                                custom test sequencer can be provided:\n                                `<rootDir>/path/to/testSequencer.js`\n  --testTimeout                 This option sets the default timeouts of test\n                                cases.\n  --testURL                     This option sets the URL for the jsdom\n                                environment.\n  --timers                      Setting this value to fake allows the use of\n                                fake timers for functions such as setTimeout.\n  --transform                   A JSON string which maps from regular\n                                expressions to paths to transformers.\n  --transformIgnorePatterns     An array of regexp pattern strings that are\n                                matched against all source file paths before\n                                transformation.\n  --unmockedModulePathPatterns  An array of regexp pattern strings that are\n                                matched against all modules before the module\n                                loader will automatically return a mock for\n                                them.\n  -u --updateSnapshot           Use this flag to re-record snapshots. Can be\n                                used together with a test suite pattern or with\n                                `--testNamePattern` to re-record snapshot for\n                                test matching the pattern\n  --useStderr                   Divert all output to stderr.\n  --verbose                     Display individual test results with the test\n                                suite hierarchy.\n  --watch                       Watch files for changes and rerun tests related\n                                to changed files. If you want to re-run all\n                                tests when a file has changed, use the\n                                `--watchAll` option.\n  --watchAll                    Watch files for changes and rerun all tests. If\n                                you want to re-run only the tests related to\n                                the changed files, use the `--watch` option.\n  --watchPathIgnorePatterns     An array of regexp pattern strings that are\n                                matched against all paths before trigger test\n                                re-run in watch mode. If the test path matches\n                                any of the patterns, it will be skipped.\n  --watchman                    Whether to use watchman for file crawling.\n                                Disable using --no-watchman.\n  -h, --help                    display help for command\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286

    比如覆盖测试:

    fes test --coverage\n
    1

    配置文件

    除了插件内置的默认配置之外,插件遵循 Jest的配置文件规范,约定项目根目录下的 jest.config.js 为用户配置文件,约定 packages.jsonjest 属性内容也是配置。

    优先级

    args 配置 > package.json中的 jest > jest.config.js > 默认配置

    ',10),c={},u=(0,e(3744).Z)(c,[["render",function(n,s){const e=(0,a.up)("OutboundLink");return(0,a.wg)(),(0,a.iD)(a.HY,null,[r,(0,a._)("p",null,[(0,a.Uk)("集成 "),(0,a._)("a",t,[(0,a.Uk)("Jest"),(0,a.Wm)(e)]),(0,a.Uk)(" 测试框架,目前只支持单元测试和覆盖测试。")]),l,(0,a._)("p",null,[(0,a.Uk)("插件实现 Jest 的全部配置,具体请查看 "),(0,a._)("a",i,[(0,a.Uk)("文档-configuration"),(0,a.Wm)(e)]),(0,a.Uk)("。 也可以使用 "),p,(0,a.Uk)(" 打印配置帮助信息:")]),o],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const e=n.__vccOpts||n;for(const[n,a]of s)e[n]=a;return e}}}]); \ No newline at end of file diff --git a/assets/js/v-3cd5a4ef.b28b8d5c.js b/assets/js/v-3cd5a4ef.b28b8d5c.js deleted file mode 100644 index e82f5f1b..00000000 --- a/assets/js/v-3cd5a4ef.b28b8d5c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[977],{5393:(n,s,e)=>{e.r(s),e.d(s,{data:()=>a});const a={key:"v-3cd5a4ef",path:"/reference/plugin/plugins/jest.html",title:"@fesjs/plugin-jest",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"约定",slug:"约定",children:[]},{level:2,title:"命令",slug:"命令",children:[]},{level:2,title:"配置",slug:"配置",children:[{level:3,title:"args 变量",slug:"args-变量",children:[]},{level:3,title:"配置文件",slug:"配置文件",children:[]},{level:3,title:"优先级",slug:"优先级",children:[]}]}],filePathRelative:"reference/plugin/plugins/jest.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},914:(n,s,e)=>{e.r(s),e.d(s,{default:()=>v});var a=e(6252);const r=(0,a._)("h1",{id:"fesjs-plugin-jest",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#fesjs-plugin-jest","aria-hidden":"true"},"#"),(0,a.Uk)(" @fesjs/plugin-jest")],-1),t=(0,a.Uk)("集成 "),l={href:"https://www.jestjs.cn/",target:"_blank",rel:"noopener noreferrer"},i=(0,a.Uk)("Jest"),p=(0,a.Uk)(" 测试框架,目前只支持单元测试和覆盖测试。"),o=(0,a.uE)('

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-jest": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    约定

    • 项目根目录下 tests__tests__ 文件夹中的 js 或者 jsx 文件为测试文件。
    • 需要覆盖测试的文件范围是src/index.{js,jsx,ts,tsx,vue}

    例如测试文件 add.js

    fes-template\n├── __tests__\n│   └── add.js\n└── src\n    ├── .fes\n    └── utils\n        └── sum.js\n
    1
    2
    3
    4
    5
    6
    7

    内容如下:

    import sum from '@/utils/sum';\ntest('adds 1 + 2 to equal 3', () => {\n    expect(sum(1, 2)).toBe(3);\n});\n\n
    1
    2
    3
    4
    5

    命令

    fes 上注册 test 命令:

    $ fes test\n
    1

    配置

    ',13),c=(0,a.Uk)("插件实现 Jest 的全部配置,具体请查看 "),u={href:"https://www.jestjs.cn/docs/configuration#reference",target:"_blank",rel:"noopener noreferrer"},b=(0,a.Uk)("文档-configuration"),m=(0,a.Uk)("。 也可以使用 "),h=(0,a._)("code",null,"-h",-1),d=(0,a.Uk)(" 打印配置帮助信息:"),f=(0,a.uE)('

    args 变量

    $ fes test -h\n
    1

    打印配置帮助信息:

    $ fes test -h\nUsage: fes test [options]\n\nrun unit tests with jest\n\nOptions:\n  --all                         The opposite of `onlyChanged`. If `onlyChanged`\n                                is set by default, running jest with `--all`\n                                will force Jest to run all tests instead of\n                                running only tests related to changed files.\n  --automock                    Automock all files by default.\n  -b --bail                     Exit the test suite immediately after `n`\n                                number of failing tests.\n  --browser                     Respect the "browser" field in package.json\n                                when resolving modules. Some packages export\n                                different versions based on whether they are\n                                operating in node.js or a browser.\n  --cache                       Whether to use the transform cache. Disable the\n                                cache using --no-cache.\n  --cacheDirectory              The directory where Jest should store its\n                                cached  dependency information.\n  --changedFilesWithAncestor    Runs tests related to the current changes and\n                                the changes made in the last commit. Behaves\n                                similarly to `--onlyChanged`.\n  --changedSince                Runs tests related to the changes since the\n                                provided branch. If the current branch has\n                                diverged from the given branch, then only\n                                changes made locally will be tested. Behaves\n                                similarly to `--onlyChanged`.\n  --ci                          Whether to run Jest in continuous integration\n                                (CI) mode. This option is on by default in most\n                                popular CI environments. It will prevent\n                                snapshots from being written unless explicitly\n                                requested.\n  --clearCache                  Clears the configured Jest cache directory and\n                                then exits. Default directory can be found by\n                                calling jest --showConfig\n  --clearMocks                  Automatically clear mock calls and instances\n                                between every test. Equivalent to calling\n                                jest.clearAllMocks() between each test.\n  --collectCoverage             Alias for --coverage.\n  --collectCoverageFrom         A glob pattern relative to <rootDir> matching\n                                the files that coverage info needs to be\n                                collected from.\n  --collectCoverageOnlyFrom     Explicit list of paths coverage will be\n                                restricted to.\n  --color                       Forces test results output color highlighting\n                                (even if stdout is not a TTY). Set to false if\n                                you would like to have no colors.\n  --colors                      Alias for `--color`.\n  -c --config                   The path to a jest config file specifying how\n                                to find and execute tests. If no rootDir is set\n                                in the config, the directory containing the\n                                config file is assumed to be the rootDir for\n                                the project.This can also be a JSON encoded\n                                value which Jest will use as configuration.\n  --coverage                    Indicates that test coverage information should\n                                be collected and reported in the output.\n  --coverageDirectory           The directory where Jest should output its\n                                coverage files.\n  --coveragePathIgnorePatterns  An array of regexp pattern strings that are\n                                matched against all file paths before executing\n                                the test. If the file pathmatches any of the\n                                patterns, coverage information will be skipped.\n  --coverageProvider            Select between Babel and V8 to collect coverage\n  --coverageReporters           A list of reporter names that Jest uses when\n                                writing coverage reports. Any istanbul reporter\n                                can be used.\n  --coverageThreshold           A JSON string with which will be used to\n                                configure minimum threshold enforcement for\n                                coverage results\n  --debug                       Print debugging info about your jest config.\n  --detectLeaks                 **EXPERIMENTAL**: Detect memory leaks in tests.\n                                After executing a test, it will try to garbage\n                                collect the global object used, and fail if it\n                                was leaked\n  --detectOpenHandles           Print out remaining open handles preventing\n                                Jest from exiting at the end of a test run.\n                                Implies `runInBand`.\n  --env                         The test environment used for all tests. This\n                                can point to any file or node module. Examples:\n                                `jsdom`, `node` or `path/to/my-environment.js`\n  --errorOnDeprecated           Make calling deprecated APIs throw helpful\n                                error messages.\n  -e --expand                   Use this flag to show full diffs instead of a\n                                patch.\n  --filter                      Path to a module exporting a filtering\n                                function. This method receives a list of tests\n                                which can be manipulated to exclude tests from\n                                running. Especially useful when used in\n                                conjunction with a testing infrastructure to\n                                filter known broken tests.\n  --findRelatedTests            Find related tests for a list of source files\n                                that were passed in as arguments. Useful for\n                                pre-commit hook integration to run the minimal\n                                amount of tests necessary.\n  --forceExit                   Force Jest to exit after all tests have\n                                completed running. This is useful when\n                                resources set up by test code cannot be\n                                adequately cleaned up.\n  --globalSetup                 The path to a module that runs before All\n                                Tests.\n  --globalTeardown              The path to a module that runs after All Tests.\n  --globals                     A JSON string with map of global variables that\n                                need to be available in all test environments.\n  --haste                       A JSON string with map of variables for the\n                                haste module system\n  --init                        Generate a basic configuration file\n  --injectGlobals               Should Jest inject global variables or not\n  --json                        Prints the test results in JSON. This mode will\n                                send all other test output and user messages to\n                                stderr.\n  --lastCommit                  Run all tests affected by file changes in the\n                                last commit made. Behaves similarly to\n                                `--onlyChanged`.\n  --listTests                   Lists all tests Jest will run given the\n                                arguments and exits. Most useful in a CI system\n                                together with `--findRelatedTests` to determine\n                                the tests Jest will run based on specific files\n  --logHeapUsage                Logs the heap usage after every test. Useful to\n                                debug memory leaks. Use together with\n                                `--runInBand` and `--expose-gc` in node.\n  --mapCoverage                 Maps code coverage reports against original source code when transformers supply source maps.\n\n  DEPRECATED\n  --maxConcurrency              Specifies the maximum number of tests that are\n                                allowed to runconcurrently. This only affects\n                                tests using `test.concurrent`.\n  -w --maxWorkers               Specifies the maximum number of workers the\n                                worker-pool will spawn for running tests. This\n                                defaults to the number of the cores available\n                                on your machine. (its usually best not to\n                                override this default)\n  --moduleDirectories           An array of directory names to be searched\n                                recursively up from the requiring module's\n                                location.\n  --moduleFileExtensions        An array of file extensions your modules use.\n                                If you require modules without specifying a\n                                file extension, these are the extensions Jest\n                                will look for.\n  --moduleNameMapper            A JSON string with a map from regular\n                                expressions to module names or to arrays of\n                                module names that allow to stub out resources,\n                                like images or styles with a single module\n  --modulePathIgnorePatterns    An array of regexp pattern strings that are\n                                matched against all module paths before those\n                                paths are to be considered "visible" to the\n                                module loader.\n  --modulePaths                 An alternative API to setting the NODE_PATH env\n                                variable, modulePaths is an array of absolute\n                                paths to additional locations to search when\n                                resolving modules.\n  --noStackTrace                Disables stack trace in test results output\n  --notify                      Activates notifications for test results.\n  --notifyMode                  Specifies when notifications will appear for\n                                test results.\n  -o --onlyChanged              Attempts to identify which tests to run based\n                                on which files have changed in the current\n                                repository. Only works if you're running tests\n                                in a git or hg repository at the moment.\n  -f --onlyFailures             Run tests that failed in the previous\n                                execution.\n  --outputFile                  Write test results to a file when the --json\n                                option is also specified.\n  --passWithNoTests             Will not fail if no tests are found (for\n                                example while using `--testPathPattern`.)\n  --preset                      A preset that is used as a base for Jest's\n                                configuration.\n  --prettierPath                The path to the "prettier" module used for\n                                inline snapshots.\n  --projects                    A list of projects that use Jest to run all\n                                tests of all projects in a single instance of\n                                Jest.\n  --reporters                   A list of custom reporters for the test suite.\n  --resetMocks                  Automatically reset mock state between every\n                                test. Equivalent to calling\n                                jest.resetAllMocks() between each test.\n  --resetModules                If enabled, the module registry for every test\n                                file will be reset before running each\n                                individual test.\n  --resolver                    A JSON string which allows the use of a custom\n                                resolver.\n  --restoreMocks                Automatically restore mock state and\n                                implementation between every test. Equivalent\n                                to calling jest.restoreAllMocks() between each\n                                test.\n  --rootDir                     The root directory that Jest should scan for\n                                tests and modules within.\n  --roots                       A list of paths to directories that Jest should\n                                use to search for files in.\n  -i --runInBand                Run all tests serially in the current process\n                                (rather than creating a worker pool of child\n                                processes that run tests). This is sometimes\n                                useful for debugging, but such use cases are\n                                pretty rare.\n  --runTestsByPath              Used when provided patterns are exact file\n                                paths. This avoids converting them into a\n                                regular expression and matching it against\n                                every single file.\n  --runner                      Allows to use a custom runner instead of Jest's\n                                default test runner.\n  --selectProjects              Run only the tests of the specified\n                                projects.Jest uses the attribute `displayName`\n                                in the configuration to identify each project.\n  --setupFiles                  A list of paths to modules that run some code\n                                to configure or set up the testing environment\n                                before each test.\n  --setupFilesAfterEnv          A list of paths to modules that run some code\n                                to configure or set up the testing framework\n                                before each test\n  --showConfig                  Print your jest config and then exits.\n  --silent                      Prevent tests from printing messages through\n                                the console.\n  --skipFilter                  Disables the filter provided by --filter.\n                                Useful for CI jobs, or local enforcement when\n                                fixing tests.\n  --snapshotSerializers         A list of paths to snapshot serializer modules\n                                Jest should use for snapshot testing.\n  --testEnvironment             Alias for --env\n  --testEnvironmentOptions      Test environment options that will be passed to\n                                the testEnvironment. The relevant options\n                                depend on the environment.\n  --testFailureExitCode         Exit code of `jest` command if the test run\n                                failed\n  --testLocationInResults       Add `location` information to the test results\n  --testMatch                   The glob patterns Jest uses to detect test\n                                files.\n  -t --testNamePattern          Run only tests with a name that matches the\n                                regex pattern.\n  --testPathIgnorePatterns      An array of regexp pattern strings that are\n                                matched against all test paths before executing\n                                the test. If the test path matches any of the\n                                patterns, it will be skipped.\n  --testPathPattern             A regexp pattern string that is matched against\n                                all tests paths before executing the test.\n  --testRegex                   A string or array of string regexp patterns\n                                that Jest uses to detect test files.\n  --testResultsProcessor        Allows the use of a custom results processor.\n                                This processor must be a node module that\n                                exports a function expecting as the first\n                                argument the result object.\n  --testRunner                  Allows to specify a custom test runner. The\n                                default is  `jasmine2`. A path to a custom test\n                                runner can be provided:\n                                `<rootDir>/path/to/testRunner.js`.\n  --testSequencer               Allows to specify a custom test sequencer. The\n                                default is `@jest/test-sequencer`. A path to a\n                                custom test sequencer can be provided:\n                                `<rootDir>/path/to/testSequencer.js`\n  --testTimeout                 This option sets the default timeouts of test\n                                cases.\n  --testURL                     This option sets the URL for the jsdom\n                                environment.\n  --timers                      Setting this value to fake allows the use of\n                                fake timers for functions such as setTimeout.\n  --transform                   A JSON string which maps from regular\n                                expressions to paths to transformers.\n  --transformIgnorePatterns     An array of regexp pattern strings that are\n                                matched against all source file paths before\n                                transformation.\n  --unmockedModulePathPatterns  An array of regexp pattern strings that are\n                                matched against all modules before the module\n                                loader will automatically return a mock for\n                                them.\n  -u --updateSnapshot           Use this flag to re-record snapshots. Can be\n                                used together with a test suite pattern or with\n                                `--testNamePattern` to re-record snapshot for\n                                test matching the pattern\n  --useStderr                   Divert all output to stderr.\n  --verbose                     Display individual test results with the test\n                                suite hierarchy.\n  --watch                       Watch files for changes and rerun tests related\n                                to changed files. If you want to re-run all\n                                tests when a file has changed, use the\n                                `--watchAll` option.\n  --watchAll                    Watch files for changes and rerun all tests. If\n                                you want to re-run only the tests related to\n                                the changed files, use the `--watch` option.\n  --watchPathIgnorePatterns     An array of regexp pattern strings that are\n                                matched against all paths before trigger test\n                                re-run in watch mode. If the test path matches\n                                any of the patterns, it will be skipped.\n  --watchman                    Whether to use watchman for file crawling.\n                                Disable using --no-watchman.\n  -h, --help                    display help for command\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286

    比如覆盖测试:

    fes test --coverage\n
    1

    配置文件

    除了插件内置的默认配置之外,插件遵循 Jest的配置文件规范,约定项目根目录下的 jest.config.js 为用户配置文件,约定 packages.jsonjest 属性内容也是配置。

    优先级

    args 配置 > package.json中的 jest > jest.config.js > 默认配置

    ',10),g={},v=(0,e(3744).Z)(g,[["render",function(n,s){const e=(0,a.up)("OutboundLink");return(0,a.wg)(),(0,a.iD)(a.HY,null,[r,(0,a._)("p",null,[t,(0,a._)("a",l,[i,(0,a.Wm)(e)]),p]),o,(0,a._)("p",null,[c,(0,a._)("a",u,[b,(0,a.Wm)(e)]),m,h,d]),f],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const e=n.__vccOpts||n;for(const[n,a]of s)e[n]=a;return e}}}]); \ No newline at end of file diff --git a/assets/js/v-3dba8814.7cfcdbac.js b/assets/js/v-3dba8814.9f07a8e3.js similarity index 99% rename from assets/js/v-3dba8814.7cfcdbac.js rename to assets/js/v-3dba8814.9f07a8e3.js index 093472e4..510531c1 100644 --- a/assets/js/v-3dba8814.7cfcdbac.js +++ b/assets/js/v-3dba8814.9f07a8e3.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[448],{1427:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-3dba8814",path:"/guide/runtime-config.html",title:"运行时配置",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"运行时为啥需要配置?",slug:"运行时为啥需要配置",children:[]},{level:2,title:"配置项",slug:"配置项",children:[{level:3,title:"beforeRender",slug:"beforerender",children:[]},{level:3,title:"patchRoutes",slug:"patchroutes",children:[]},{level:3,title:"modifyClientRenderOpts",slug:"modifyclientrenderopts",children:[]},{level:3,title:"rootContainer",slug:"rootcontainer",children:[]},{level:3,title:"onAppCreated",slug:"onappcreated",children:[]},{level:3,title:"render",slug:"render",children:[]},{level:3,title:"onRouterCreated",slug:"onroutercreated",children:[]}]},{level:2,title:"更多配置项",slug:"更多配置项",children:[]}],filePathRelative:"guide/runtime-config.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},74:(n,s,a)=>{a.r(s),a.d(s,{default:()=>t});const p=(0,a(6252).uE)('

    运行时配置

    Fes.js 约定 src/app.js 为运行时配置文件。运行时配置和配置的区别是他跑在浏览器端,因此我们可以在这里写函数、引入浏览器端依赖项等等,注意不要引入 node 端依赖项。

    运行时为啥需要配置?

    Fes.js 框架跟传统开发模式不一样。传统开发模式中用户编写 entry 文件,而 Fes.js 中 entry 文件由框架生成,用户就不必要编写胶水代码。内置插件和其他插件提供的一些运行时功能提供用户或者其他插件自定义。

    例如:

    plugin-acess插件定义运行时配置项:

    api.addRuntimePluginKey(() => 'access');\n
    1

    plugin-acess插件读取配置项:

    const runtimeConfig = plugin.applyPlugins({\n    key: 'access',\n    type: ApplyPluginsType.modify,\n    initialValue: {}\n});\n
    1
    2
    3
    4
    5

    而用户则只需要配置:

    // app.js\nexport const access = memo => ({\n    ...memo\n    unAccessHandler({\n        router, to, from, next\n    }) {\n        // 处理逻辑\n    },\n    noFoundHandler({\n        router, to, from, next\n    }) {\n        // 处理逻辑\n    },\n});\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    配置项

    beforeRender

    beforeRender(lastOpts)

    在渲染之前执行,执行action过程中显示 loading 配置的组件,执行结果作为参数 initialState 传给 modifyClientRenderOpts

    示例:

    // app.js\nimport { access } from '@fesjs/fes';\nimport PageLoading from '@/components/PageLoading';\nimport UserCenter from '@/components/UserCenter';\n\nexport function beforeRender(lastOpts) {\n    return {\n        ...lastOpts,\n        loading: <PageLoading />,\n        action() {\n            const { setRole } = access;\n            return new Promise((resolve) => {\n                setTimeout(() => {\n                    setRole('admin');\n                    resolve({\n                        userName: 'harrywan'\n                    });\n                }, 1000);\n            });\n        }\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    patchRoutes

    patchRoutes({routes })

    修改路由。

    比如在最前面添加一个 /foo 路由:

    export function patchRoutes({ routes }) {\n  routes.unshift({\n    path: '/foo',\n    component: require('@/extraRoutes/foo').default,\n  });\n}\n
    1
    2
    3
    4
    5
    6

    提示

    直接修改 routes, 不需要返回

    modifyClientRenderOpts

    modifyClientRenderOpts(lastOpts)

    修改 clientRender 参数。参数是一个对象:

    • routes,路由配置信息
    • rootElement, 渲染的根节点,默认是 #app,可通过配置 mountElementId 修改。
    • initialState, 初始化数据,beforeRender 运行得到的数据。

    比如在微前端里动态修改渲染根节点:

    let isSubApp = false;\nexport function modifyClientRenderOpts(lastOpts) {\n  return {\n    ...lastOpts,\n    rootElement: isSubApp ? 'sub-root' : lastOpts.rootElement,    \n  };\n}\n
    1
    2
    3
    4
    5
    6
    7

    rootContainer

    rootContainer(LastRootContainer, args)

    修改交给 Vue 渲染时的根组件,默认是 <RouterView></RouterView>

    • LastRootContainer,上一个插件修改后的结果。
    • args,包含:
      • routes,全量路由配置
      • plugin,运行时插件机制

    比如在可以包一层DIV:

    export function rootContainer(container) {\n    return () => {\n        return (\n            <div>\n                <RouterView></RouterView>\n            </div>\n        )\n  }\n}\n
    1
    2
    3
    4
    5
    6
    7
    8
    9

    onAppCreated

    onAppCreated({app})

    创建 app 实例后触发。

    比如用于安装 Vue 插件:

    import { createRouter } from "vue-router";\n\nexport function onAppCreated({ app }) {\n    const router = createRouter();\n    app.use(router);\n}\n\n
    1
    2
    3
    4
    5
    6
    7

    render

    render(oldRender: Function)

    覆写 render。

    比如用于渲染之前做权限校验。

    onRouterCreated

    onRouterCreated({router})

    生成router时触发。

    比如用于收集切换路由的记录:

    export function onRouterCreated({ router }) {\n    router.afterEach((to, from) => {\n        console.log(to)\n    });\n}\n
    1
    2
    3
    4
    5

    更多配置项

    Fes.js 允许插件注册运行时配置,如果你使用插件,肯定会在插件里找到更多运行时的配置项。

    ',51),e={},t=(0,a(3744).Z)(e,[["render",function(n,s){return p}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[448],{1427:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-3dba8814",path:"/guide/runtime-config.html",title:"运行时配置",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"运行时为啥需要配置?",slug:"运行时为啥需要配置",children:[]},{level:2,title:"配置项",slug:"配置项",children:[{level:3,title:"beforeRender",slug:"beforerender",children:[]},{level:3,title:"patchRoutes",slug:"patchroutes",children:[]},{level:3,title:"modifyClientRenderOpts",slug:"modifyclientrenderopts",children:[]},{level:3,title:"rootContainer",slug:"rootcontainer",children:[]},{level:3,title:"onAppCreated",slug:"onappcreated",children:[]},{level:3,title:"render",slug:"render",children:[]},{level:3,title:"onRouterCreated",slug:"onroutercreated",children:[]}]},{level:2,title:"更多配置项",slug:"更多配置项",children:[]}],filePathRelative:"guide/runtime-config.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},74:(n,s,a)=>{a.r(s),a.d(s,{default:()=>t});const p=(0,a(6252).uE)('

    运行时配置

    Fes.js 约定 src/app.js 为运行时配置文件。运行时配置和配置的区别是他跑在浏览器端,因此我们可以在这里写函数、引入浏览器端依赖项等等,注意不要引入 node 端依赖项。

    运行时为啥需要配置?

    Fes.js 框架跟传统开发模式不一样。传统开发模式中用户编写 entry 文件,而 Fes.js 中 entry 文件由框架生成,用户就不必要编写胶水代码。内置插件和其他插件提供的一些运行时功能提供用户或者其他插件自定义。

    例如:

    plugin-acess插件定义运行时配置项:

    api.addRuntimePluginKey(() => 'access');\n
    1

    plugin-acess插件读取配置项:

    const runtimeConfig = plugin.applyPlugins({\n    key: 'access',\n    type: ApplyPluginsType.modify,\n    initialValue: {}\n});\n
    1
    2
    3
    4
    5

    而用户则只需要配置:

    // app.js\nexport const access = memo => ({\n    ...memo\n    unAccessHandler({\n        router, to, from, next\n    }) {\n        // 处理逻辑\n    },\n    noFoundHandler({\n        router, to, from, next\n    }) {\n        // 处理逻辑\n    },\n});\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    配置项

    beforeRender

    beforeRender(lastOpts)

    在渲染之前执行,执行action过程中显示 loading 配置的组件,执行结果作为参数 initialState 传给 modifyClientRenderOpts

    示例:

    // app.js\nimport { access } from '@fesjs/fes';\nimport PageLoading from '@/components/PageLoading';\nimport UserCenter from '@/components/UserCenter';\n\nexport function beforeRender(lastOpts) {\n    return {\n        ...lastOpts,\n        loading: <PageLoading />,\n        action() {\n            const { setRole } = access;\n            return new Promise((resolve) => {\n                setTimeout(() => {\n                    setRole('admin');\n                    resolve({\n                        userName: 'harrywan'\n                    });\n                }, 1000);\n            });\n        }\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    patchRoutes

    patchRoutes({routes })

    修改路由。

    比如在最前面添加一个 /foo 路由:

    export function patchRoutes({ routes }) {\n  routes.unshift({\n    path: '/foo',\n    component: require('@/extraRoutes/foo').default,\n  });\n}\n
    1
    2
    3
    4
    5
    6

    提示

    直接修改 routes, 不需要返回

    modifyClientRenderOpts

    modifyClientRenderOpts(lastOpts)

    修改 clientRender 参数。参数是一个对象:

    • routes,路由配置信息
    • rootElement, 渲染的根节点,默认是 #app,可通过配置 mountElementId 修改。
    • initialState, 初始化数据,beforeRender 运行得到的数据。

    比如在微前端里动态修改渲染根节点:

    let isSubApp = false;\nexport function modifyClientRenderOpts(lastOpts) {\n  return {\n    ...lastOpts,\n    rootElement: isSubApp ? 'sub-root' : lastOpts.rootElement,    \n  };\n}\n
    1
    2
    3
    4
    5
    6
    7

    rootContainer

    rootContainer(LastRootContainer, args)

    修改交给 Vue 渲染时的根组件,默认是 <RouterView></RouterView>

    • LastRootContainer,上一个插件修改后的结果。
    • args,包含:
      • routes,全量路由配置
      • plugin,运行时插件机制

    比如在可以包一层DIV:

    export function rootContainer(container) {\n    return () => {\n        return (\n            <div>\n                <RouterView></RouterView>\n            </div>\n        )\n  }\n}\n
    1
    2
    3
    4
    5
    6
    7
    8
    9

    onAppCreated

    onAppCreated({app})

    创建 app 实例后触发。

    比如用于安装 Vue 插件:

    import { createRouter } from "vue-router";\n\nexport function onAppCreated({ app }) {\n    const router = createRouter();\n    app.use(router);\n}\n\n
    1
    2
    3
    4
    5
    6
    7

    render

    render(oldRender: Function)

    覆写 render。

    比如用于渲染之前做权限校验。

    onRouterCreated

    onRouterCreated({router})

    生成router时触发。

    比如用于收集切换路由的记录:

    export function onRouterCreated({ router }) {\n    router.afterEach((to, from) => {\n        console.log(to)\n    });\n}\n
    1
    2
    3
    4
    5

    更多配置项

    Fes.js 允许插件注册运行时配置,如果你使用插件,肯定会在插件里找到更多运行时的配置项。

    ',51),e={},t=(0,a(3744).Z)(e,[["render",function(n,s){return p}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-411c0c9e.1c199fe9.js b/assets/js/v-411c0c9e.1c199fe9.js deleted file mode 100644 index 43dac9c7..00000000 --- a/assets/js/v-411c0c9e.1c199fe9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[496],{565:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-411c0c9e",path:"/reference/plugin/plugins/locale.html",title:"@fesjs/plugin-locale",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"配置",slug:"配置",children:[{level:3,title:"约定式配置",slug:"约定式配置",children:[]},{level:3,title:"编译时配置",slug:"编译时配置",children:[]},{level:3,title:"运行时配置",slug:"运行时配置",children:[]}]},{level:2,title:"API",slug:"api",children:[{level:3,title:"locale",slug:"locale-1",children:[]},{level:3,title:"useI18n",slug:"usei18n",children:[]}]}],filePathRelative:"reference/plugin/plugins/locale.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},4919:(n,s,a)=>{a.r(s),a.d(s,{default:()=>O});var e=a(6252);const p=(0,e._)("h1",{id:"fesjs-plugin-locale",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#fesjs-plugin-locale","aria-hidden":"true"},"#"),(0,e.Uk)(" @fesjs/plugin-locale")],-1),t=(0,e._)("h2",{id:"介绍",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),(0,e.Uk)(" 介绍")],-1),l=(0,e.Uk)("国际化插件,基于 "),o={href:"https://github.com/intlify/vue-i18n-next",target:"_blank",rel:"noopener noreferrer"},c=(0,e.Uk)("Vue I18n"),r=(0,e.Uk)(",用于解决 i18n 问题。"),i=(0,e.uE)('

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-locale": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    配置

    约定式配置

    Fes.js 约定如下目录,项目就拥有了 zh-CNen-US 国际化语言切换:

    src\n  ├── locales\n  │    ├── zh-CN.js\n  │    └── en-US.js\n  └── pages\n  │    └── index.vue\n  └── app.js\n
    1
    2
    3
    4
    5
    6
    7

    多语言文件的命名规范:<lang>-<COUNTRY>.js

    多语言文件的内容规范:键值组成的字面量,如下:

    // src/locales/zh-CN.js\nexport default {\n    menu: {\n        interface: '接口'\n    },\n    overview: '概述',\n    i18n: {\n        internationalization: '国际化,基于',\n        achieve: '实现。',\n        ui: 'UI组件'\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    // src/locales/en-US.js\nexport default {\n    menu: {\n        interface: 'interface'\n    },\n    overview: 'Overview',\n    i18n: {\n        internationalization: 'internationalization,base on',\n        achieve: 'to achieve.',\n        ui: 'UI components'\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ',11),u=(0,e.Uk)("想了解更多语言信息配置、匹配规则,请参考 "),k={href:"https://vue-i18n.intlify.dev/guide/essentials/syntax.html",target:"_blank",rel:"noopener noreferrer"},d=(0,e.Uk)("Vue I18n"),b=(0,e.Uk)(" 文档。"),g=(0,e.uE)('

    编译时配置

    在执行 fes dev 或者 fes build 时,通过此配置生成运行时的代码,在配置文件.fes.js 中配置:

    export default {\n    locale: {\n    }\n}\n
    1
    2
    3
    4

    默认配置为:

    export default {\n    locale: {\n        locale: 'zh-CN', // default locale\n        fallbackLocale: 'zh-CN', // set fallback locale\n        baseNavigator: true, // 开启浏览器语言检测\n        legacy: false, // 用户是否需要 Legacy API 模式\n    }\n} \n
    1
    2
    3
    4
    5
    6
    7
    8

    所有配置项如下:

    locale

    • 类型String

    • 默认值zh-CN

    • 详情:当前的语言。

    fallbackLocale

    • 类型String

    • 默认值zh-CN

    • 详情:兜底的语言,如果当前语言找不到配置,则使用默认语言,需要保证默认语言配置文件存在。

    baseNavigator

    • 类型Boolean

    • 默认值true

    • 详情:开启浏览器语言检测。

    默认情况下,当前语言环境的识别按照:localStoragefes_locale 值 > 浏览器检测 > default 设置的默认语言 > zh-CN 中文。

    legacy

    • 类型Boolean

    • 默认值false

    • 详情:用户是否需要 Legacy API 模式

    运行时配置

    暂无。

    API

    locale

    插件 API 通过 @fesjs/fes 导出:

    import { locale } from '@fesjs/fes'\n
    1

    locale.messages

    • 类型Object

    • 详情:当前的配置的语言信息。

    locale.setLocale

    • 类型Function

    • 详情:设置当前的语言。

    • 参数

      • locale,语言的名称,应该是符合 <lang>-<COUNTRY> 规范的名称。
    • 返回值null

    import { locale } from '@fesjs/fes';\nlocale.setLocale({ locale: 'en-US' });\n
    1
    2

    locale.addLocale

    • 类型Function

    • 详情:手动添加语言配置。

    • 参数

      • locale,语言的名称,符合 <lang>-<COUNTRY> 规范的名称。
      • messages, 语言信息。
    • 返回值null

    import { locale } from '@fesjs/fes'\nlocale.addLocale({ locale: 'ja-JP', messages: { test: 'テスト' } });\n
    1
    2

    locale.getAllLocales

    • 类型Function

    • 详情:获取当前获得所有国际化文件的列表,默认会在 locales 文件夹下寻找类似 en-US.js 文件。

    • 参数:null

    • 返回值Array

    import { locale } from '@fesjs/fes';\nconsole.log(locale.getAllLocales());\n// ["en-US", "id-ID", "ja-JP", "pt-BR", "zh-CN", "zh-TW"]\n
    1
    2
    3

    useI18n

    ',33),m=(0,e.Uk)("Composition API, 只能在 "),h=(0,e._)("code",null,"setup",-1),v=(0,e.Uk)(" 函数中使用,更多细节参考 "),f={href:"https://vue-i18n.intlify.dev/api/composition.html#usei18n",target:"_blank",rel:"noopener noreferrer"},y=(0,e.Uk)("Vue I18n"),j=(0,e.Uk)("。 \b举个 🌰:"),x=(0,e.uE)('
    <template>\n  <form>\n    <label>{{ t('language') }}</label>\n  </form>\n  <p>message: {{ t('hello') }}</p>\n</template>\n\n<script>\nimport { useI18n } from '@fesjs/fes'\n\nexport default {\n setup() {\n   const { t } = useI18n()\n   // Something to do ...\n\n   return { ..., t }\n }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    ',1),w=(0,e._)("code",null,"useI18n()",-1),U=(0,e.Uk)("返回结果是 "),_={href:"https://vue-i18n.intlify.dev/api/composition.html#composer",target:"_blank",rel:"noopener noreferrer"},q=(0,e.Uk)("Composer"),C=(0,e.Uk)(",提供类似 "),I=(0,e._)("code",null,"t",-1),N=(0,e.Uk)("、"),z=(0,e._)("code",null,"n",-1),L=(0,e.Uk)("、"),S=(0,e._)("code",null,"d",-1),A=(0,e.Uk)(" 等转换函数,在模板中使用。"),P={},O=(0,a(3744).Z)(P,[["render",function(n,s){const a=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,t,(0,e._)("p",null,[l,(0,e._)("a",o,[c,(0,e.Wm)(a)]),r]),i,(0,e._)("p",null,[u,(0,e._)("a",k,[d,(0,e.Wm)(a)]),b]),g,(0,e._)("p",null,[m,h,v,(0,e._)("a",f,[y,(0,e.Wm)(a)]),j]),x,(0,e._)("p",null,[w,U,(0,e._)("a",_,[q,(0,e.Wm)(a)]),C,I,N,z,L,S,A])],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-411c0c9e.eb0a832d.js b/assets/js/v-411c0c9e.eb0a832d.js new file mode 100644 index 00000000..b61c7ebb --- /dev/null +++ b/assets/js/v-411c0c9e.eb0a832d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[496],{565:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-411c0c9e",path:"/reference/plugin/plugins/locale.html",title:"@fesjs/plugin-locale",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"配置",slug:"配置",children:[{level:3,title:"约定式配置",slug:"约定式配置",children:[]},{level:3,title:"编译时配置",slug:"编译时配置",children:[]},{level:3,title:"运行时配置",slug:"运行时配置",children:[]}]},{level:2,title:"API",slug:"api",children:[{level:3,title:"locale",slug:"locale-1",children:[]},{level:3,title:"useI18n",slug:"usei18n",children:[]}]}],filePathRelative:"reference/plugin/plugins/locale.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},4919:(n,s,a)=>{a.r(s),a.d(s,{default:()=>f});var e=a(6252);const p=(0,e._)("h1",{id:"fesjs-plugin-locale",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#fesjs-plugin-locale","aria-hidden":"true"},"#"),(0,e.Uk)(" @fesjs/plugin-locale")],-1),t=(0,e._)("h2",{id:"介绍",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),(0,e.Uk)(" 介绍")],-1),l={href:"https://github.com/intlify/vue-i18n-next",target:"_blank",rel:"noopener noreferrer"},o=(0,e.uE)('

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-locale": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    配置

    约定式配置

    Fes.js 约定如下目录,项目就拥有了 zh-CNen-US 国际化语言切换:

    src\n  ├── locales\n  │    ├── zh-CN.js\n  │    └── en-US.js\n  └── pages\n  │    └── index.vue\n  └── app.js\n
    1
    2
    3
    4
    5
    6
    7

    多语言文件的命名规范:<lang>-<COUNTRY>.js

    多语言文件的内容规范:键值组成的字面量,如下:

    // src/locales/zh-CN.js\nexport default {\n    menu: {\n        interface: '接口'\n    },\n    overview: '概述',\n    i18n: {\n        internationalization: '国际化,基于',\n        achieve: '实现。',\n        ui: 'UI组件'\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    // src/locales/en-US.js\nexport default {\n    menu: {\n        interface: 'interface'\n    },\n    overview: 'Overview',\n    i18n: {\n        internationalization: 'internationalization,base on',\n        achieve: 'to achieve.',\n        ui: 'UI components'\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ',11),c={href:"https://vue-i18n.intlify.dev/guide/essentials/syntax.html",target:"_blank",rel:"noopener noreferrer"},r=(0,e.uE)('

    编译时配置

    在执行 fes dev 或者 fes build 时,通过此配置生成运行时的代码,在配置文件.fes.js 中配置:

    export default {\n    locale: {\n    }\n}\n
    1
    2
    3
    4

    默认配置为:

    export default {\n    locale: {\n        locale: 'zh-CN', // default locale\n        fallbackLocale: 'zh-CN', // set fallback locale\n        baseNavigator: true, // 开启浏览器语言检测\n        legacy: false, // 用户是否需要 Legacy API 模式\n    }\n} \n
    1
    2
    3
    4
    5
    6
    7
    8

    所有配置项如下:

    locale

    • 类型String

    • 默认值zh-CN

    • 详情:当前的语言。

    fallbackLocale

    • 类型String

    • 默认值zh-CN

    • 详情:兜底的语言,如果当前语言找不到配置,则使用默认语言,需要保证默认语言配置文件存在。

    baseNavigator

    • 类型Boolean

    • 默认值true

    • 详情:开启浏览器语言检测。

    默认情况下,当前语言环境的识别按照:localStoragefes_locale 值 > 浏览器检测 > default 设置的默认语言 > zh-CN 中文。

    legacy

    • 类型Boolean

    • 默认值false

    • 详情:用户是否需要 Legacy API 模式

    运行时配置

    暂无。

    API

    locale

    插件 API 通过 @fesjs/fes 导出:

    import { locale } from '@fesjs/fes'\n
    1

    locale.messages

    • 类型Object

    • 详情:当前的配置的语言信息。

    locale.setLocale

    • 类型Function

    • 详情:设置当前的语言。

    • 参数

      • locale,语言的名称,应该是符合 <lang>-<COUNTRY> 规范的名称。
    • 返回值null

    import { locale } from '@fesjs/fes';\nlocale.setLocale({ locale: 'en-US' });\n
    1
    2

    locale.addLocale

    • 类型Function

    • 详情:手动添加语言配置。

    • 参数

      • locale,语言的名称,符合 <lang>-<COUNTRY> 规范的名称。
      • messages, 语言信息。
    • 返回值null

    import { locale } from '@fesjs/fes'\nlocale.addLocale({ locale: 'ja-JP', messages: { test: 'テスト' } });\n
    1
    2

    locale.getAllLocales

    • 类型Function

    • 详情:获取当前获得所有国际化文件的列表,默认会在 locales 文件夹下寻找类似 en-US.js 文件。

    • 参数:null

    • 返回值Array

    import { locale } from '@fesjs/fes';\nconsole.log(locale.getAllLocales());\n// ["en-US", "id-ID", "ja-JP", "pt-BR", "zh-CN", "zh-TW"]\n
    1
    2
    3

    useI18n

    ',33),i=(0,e._)("code",null,"setup",-1),u={href:"https://vue-i18n.intlify.dev/api/composition.html#usei18n",target:"_blank",rel:"noopener noreferrer"},k=(0,e.uE)('
    <template>\n  <form>\n    <label>{{ t('language') }}</label>\n  </form>\n  <p>message: {{ t('hello') }}</p>\n</template>\n\n<script>\nimport { useI18n } from '@fesjs/fes'\n\nexport default {\n setup() {\n   const { t } = useI18n()\n   // Something to do ...\n\n   return { ..., t }\n }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    ',1),d=(0,e._)("code",null,"useI18n()",-1),b={href:"https://vue-i18n.intlify.dev/api/composition.html#composer",target:"_blank",rel:"noopener noreferrer"},g=(0,e._)("code",null,"t",-1),m=(0,e._)("code",null,"n",-1),h=(0,e._)("code",null,"d",-1),v={},f=(0,a(3744).Z)(v,[["render",function(n,s){const a=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,t,(0,e._)("p",null,[(0,e.Uk)("国际化插件,基于 "),(0,e._)("a",l,[(0,e.Uk)("Vue I18n"),(0,e.Wm)(a)]),(0,e.Uk)(",用于解决 i18n 问题。")]),o,(0,e._)("p",null,[(0,e.Uk)("想了解更多语言信息配置、匹配规则,请参考 "),(0,e._)("a",c,[(0,e.Uk)("Vue I18n"),(0,e.Wm)(a)]),(0,e.Uk)(" 文档。")]),r,(0,e._)("p",null,[(0,e.Uk)("Composition API, 只能在 "),i,(0,e.Uk)(" 函数中使用,更多细节参考 "),(0,e._)("a",u,[(0,e.Uk)("Vue I18n"),(0,e.Wm)(a)]),(0,e.Uk)("。 \b举个 🌰:")]),k,(0,e._)("p",null,[d,(0,e.Uk)("返回结果是 "),(0,e._)("a",b,[(0,e.Uk)("Composer"),(0,e.Wm)(a)]),(0,e.Uk)(",提供类似 "),g,(0,e.Uk)("、"),m,(0,e.Uk)("、"),h,(0,e.Uk)(" 等转换函数,在模板中使用。")])],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-41dee210.11afeb11.js b/assets/js/v-41dee210.11afeb11.js deleted file mode 100644 index 5a59ede6..00000000 --- a/assets/js/v-41dee210.11afeb11.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[919],{2121:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-41dee210",path:"/reference/plugin/plugins/request.html",title:"@fesjs/plugin-request",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"配置",slug:"配置",children:[{level:3,title:"构建时配置",slug:"构建时配置",children:[]},{level:3,title:"运行时配置",slug:"运行时配置",children:[]}]},{level:2,title:"使用",slug:"使用",children:[{level:3,title:"发起一个普通 post 请求",slug:"发起一个普通-post-请求",children:[]},{level:3,title:"merge 重复请求",slug:"merge-重复请求",children:[]},{level:3,title:"请求节流(即将废弃)",slug:"请求节流-即将废弃",children:[]},{level:3,title:"请求缓存",slug:"请求缓存",children:[]},{level:3,title:"结合 use 使用",slug:"结合-use-使用",children:[]},{level:3,title:"配置拦截器",slug:"配置拦截器",children:[]}]},{level:2,title:"API",slug:"api",children:[{level:3,title:"request",slug:"request",children:[]},{level:3,title:"useRequest",slug:"userequest",children:[]}]}],filePathRelative:"reference/plugin/plugins/request.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},2434:(n,s,a)=>{a.r(s),a.d(s,{default:()=>f});var p=a(6252);const e=(0,p.uE)('

    @fesjs/plugin-request

    基于 axios 封装的 request,内置防止重复请求、请求节流、错误处理等功能。

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-request": "^2.0.0"\n    }\n}\n
    1
    2
    3
    4
    5
    6

    配置

    构建时配置

    export default {\n    request: {\n        dataField: 'result'\n    }\n};\n
    1
    2
    3
    4
    5

    dataField

    • 类型: string

    • 默认值: ''

    • 详情:

      dataField 对应接口统一格式中的数据字段,比如接口如果统一的规范是 { success: boolean, result: any} ,那么就不需要配置,这样你通过 useRequest 消费的时候会生成一个默认的 formatResult,直接返回 result 中的数据,方便使用。如果你的后端接口不符合这个规范,可以自行配置 dataField。配置为 ''(空字符串)的时候不做处理。

    base(即将废弃)

    • 类型: string

    • 默认值: ''

    • 详情:

      base 接口前缀。

    ',12),t={class:"custom-container warning"},o=(0,p._)("p",{class:"custom-container-title"},"即将废弃",-1),c=(0,p.Uk)("这个字段将在下个版本废弃,推荐使用 "),l={href:"https://github.com/axios/axios",target:"_blank",rel:"noopener noreferrer"},r=(0,p.Uk)("axios baseURL"),u=(0,p.Uk)("。"),i=(0,p.uE)('

    运行时配置

    app.js 中进行运行时配置。

    export const request = {\n    // 格式化 response.data (只有 response.data 类型为 object 才会调用)\n    responseDataAdaptor: (data) => {\n        data.code = data.code === '200' ? '0' : data.code;\n        return data;\n    },\n    // 关闭 response data 校验(只判断 xhr status)\n    closeResDataCheck: false,\n    // 请求拦截器 http://axios-js.com/zh-cn/docs/#%E6%8B%A6%E6%88%AA%E5%99%A8\n    requestInterceptors: [],\n    // 响应拦截器\n    responseInterceptors: [],\n    // 错误处理\n    // 内部以 reponse.data.code === '0' 判断请求是否成功\n    // 若使用其他字段判断,可以使用 responseDataAdaptor 对响应数据进行格式\n    errorHandler: {\n        11199(response) {\n            // 特殊 code 处理逻辑\n        },\n        404(error) {},\n        default(error) {\n            // 异常统一处理\n        }\n    },\n    // 其他 axios 配置\n    ...otherConfigs\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27

    skipErrorHandler

    • 类型: boolean | string | number | array<string | number>

    • 默认值: ``

    • 详情:

      指定当前请求的某些错误状态不走 errorHandler,单独进行处理。如果设置为 true,当前请求的错误处理都不走 errorHandler

    • 示列:

    import { request } from '@fesjs/fes';\n\nrequest('/api/login', null, {\n    skipErrorHandler: '110'\n})\n    .then((res) => {\n        // do something\n    })\n    .catch((err) => {\n        // \b这里处理 code 为 110 的异常\n        // 此时 errorHandler[110] 函数不会生效,也不会执行 errorHandler.default\n    });\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    使用

    发起一个普通 post 请求

    import { request } from '@fesjs/fes';\n\nrequest('/api/login', {\n    username: 'robby',\n    password: '123456'\n})\n    .then((res) => {\n        // do something\n    })\n    .catch((err) => {\n        // 处理异常\n    });\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    merge 重复请求

    连续发送多个请求,会被合并成一个请求,不会报 REPEAT 接口错误。

    当发生 REPEAT 请求异常,并且确保自身代码合理的情况下,可以使用该配置。

    import { request } from '@fesjs/fes';\n\nrequest(\n    '/api/login',\n    {\n        username: 'robby',\n        password: '123456'\n    },\n    {\n        mergeRequest: true // 在一个请求没有回来前,重复发送的请求会合并成一个请求\n    }\n)\n    .then((res) => {\n        // do something\n    })\n    .catch((err) => {\n        // 处理异常\n    });\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18

    请求节流(即将废弃)

    即将废弃

    因为 request 的请求总会有一个 promise 结果,要么成功,要么失败,和防抖、节流的语义不一致,防抖、节流只是函数的不执行

    请求缓存

    import { request } from '@fesjs/fes';\n\nrequest(\n    '/api/login',\n    {\n        username: 'robby',\n        password: '123456'\n    },\n    {\n        cache: {\n            cacheType: 'ram', // ram: 内存,session: sessionStorage,local:localStorage\n            cacheTime: 1000 * 60 * 3 // 缓存时间:默认3min\n        }\n    }\n)\n    .then((res) => {\n        // do something\n    })\n    .catch((err) => {\n        // 处理异常\n    });\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21

    cachetrue,则默认使用 ram 缓存类型,缓存时间 3min。

    结合 use 使用

    import { useRequest } from '@fesjs/fes';\n\nexport default {\n    setup() {\n        const { loading, data, error } = useRequest('/api/login', {\n            username: 'robby',\n            password: '123456'\n        });\n\n        return {\n            loading,\n            data,\n            error\n        };\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    配置拦截器

    ',21),k=(0,p.Uk)("函数的参数格式:"),b={href:"http://axios-js.com/zh-cn/docs/#%E6%8B%A6%E6%88%AA%E5%99%A8",target:"_blank",rel:"noopener noreferrer"},d=(0,p.Uk)("传送门"),m=(0,p.Uk)(";"),h=(0,p.uE)('
    export const request = {\n    requestInterceptors: [\n        function (config) {\n            // 在发送请求之前做些什么\n            return config;\n        },\n        [\n            function (config) {\n                // 在发送请求之前做些什么\n                return config;\n            },\n            function (error) {\n                // 对请求错误做些什么\n                return Promise.reject(error);\n            }\n        ]\n    ],\n    // 响应拦截器\n    responseInterceptors: [\n        function (response) {\n            // 对响应数据做点什么\n            return response;\n        },\n        [\n            function (response) {\n                // 对响应数据做点什么\n                return response;\n            },\n            function (error) {\n                // 对响应错误做点什么\n                return Promise.reject(error);\n            }\n        ]\n    ]\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35

    API

    request

    • 类型:函数

    • 详情:请求后端接口

    • 参数

      • url: 后端接口 url
      • data: 参数
      • options: \b 配置( 支持 axios 所有配置)
    • 返回值: Promise

    useRequest

    request 的封装,返回响应式 loadingerrordata

    ',6),g={},f=(0,a(3744).Z)(g,[["render",function(n,s){const a=(0,p.up)("OutboundLink");return(0,p.wg)(),(0,p.iD)(p.HY,null,[e,(0,p._)("div",t,[o,(0,p._)("p",null,[c,(0,p._)("a",l,[r,(0,p.Wm)(a)]),u])]),i,(0,p._)("p",null,[k,(0,p._)("a",b,[d,(0,p.Wm)(a)]),m]),h],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-41dee210.18d5dcb0.js b/assets/js/v-41dee210.18d5dcb0.js new file mode 100644 index 00000000..93844631 --- /dev/null +++ b/assets/js/v-41dee210.18d5dcb0.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[919],{2121:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-41dee210",path:"/reference/plugin/plugins/request.html",title:"@fesjs/plugin-request",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"配置",slug:"配置",children:[{level:3,title:"构建时配置",slug:"构建时配置",children:[]},{level:3,title:"运行时配置",slug:"运行时配置",children:[]}]},{level:2,title:"使用",slug:"使用",children:[{level:3,title:"发起一个普通 post 请求",slug:"发起一个普通-post-请求",children:[]},{level:3,title:"merge 重复请求",slug:"merge-重复请求",children:[]},{level:3,title:"请求节流(即将废弃)",slug:"请求节流-即将废弃",children:[]},{level:3,title:"请求缓存",slug:"请求缓存",children:[]},{level:3,title:"结合 use 使用",slug:"结合-use-使用",children:[]},{level:3,title:"配置拦截器",slug:"配置拦截器",children:[]}]},{level:2,title:"API",slug:"api",children:[{level:3,title:"request",slug:"request",children:[]},{level:3,title:"useRequest",slug:"userequest",children:[]}]}],filePathRelative:"reference/plugin/plugins/request.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},2434:(n,s,a)=>{a.r(s),a.d(s,{default:()=>k});var p=a(6252);const e=(0,p.uE)('

    @fesjs/plugin-request

    基于 axios 封装的 request,内置防止重复请求、请求节流、错误处理等功能。

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-request": "^2.0.0"\n    }\n}\n
    1
    2
    3
    4
    5
    6

    配置

    构建时配置

    export default {\n    request: {\n        dataField: 'result'\n    }\n};\n
    1
    2
    3
    4
    5

    dataField

    • 类型: string

    • 默认值: ''

    • 详情:

      dataField 对应接口统一格式中的数据字段,比如接口如果统一的规范是 { success: boolean, result: any} ,那么就不需要配置,这样你通过 useRequest 消费的时候会生成一个默认的 formatResult,直接返回 result 中的数据,方便使用。如果你的后端接口不符合这个规范,可以自行配置 dataField。配置为 ''(空字符串)的时候不做处理。

    base(即将废弃)

    • 类型: string

    • 默认值: ''

    • 详情:

      base 接口前缀。

    ',12),t={class:"custom-container warning"},o=(0,p._)("p",{class:"custom-container-title"},"即将废弃",-1),c={href:"https://github.com/axios/axios",target:"_blank",rel:"noopener noreferrer"},l=(0,p.uE)('

    运行时配置

    app.js 中进行运行时配置。

    export const request = {\n    // 格式化 response.data (只有 response.data 类型为 object 才会调用)\n    responseDataAdaptor: (data) => {\n        data.code = data.code === '200' ? '0' : data.code;\n        return data;\n    },\n    // 关闭 response data 校验(只判断 xhr status)\n    closeResDataCheck: false,\n    // 请求拦截器 http://axios-js.com/zh-cn/docs/#%E6%8B%A6%E6%88%AA%E5%99%A8\n    requestInterceptors: [],\n    // 响应拦截器\n    responseInterceptors: [],\n    // 错误处理\n    // 内部以 reponse.data.code === '0' 判断请求是否成功\n    // 若使用其他字段判断,可以使用 responseDataAdaptor 对响应数据进行格式\n    errorHandler: {\n        11199(response) {\n            // 特殊 code 处理逻辑\n        },\n        404(error) {},\n        default(error) {\n            // 异常统一处理\n        }\n    },\n    // 其他 axios 配置\n    ...otherConfigs\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27

    skipErrorHandler

    • 类型: boolean | string | number | array<string | number>

    • 默认值: ``

    • 详情:

      指定当前请求的某些错误状态不走 errorHandler,单独进行处理。如果设置为 true,当前请求的错误处理都不走 errorHandler

    • 示列:

    import { request } from '@fesjs/fes';\n\nrequest('/api/login', null, {\n    skipErrorHandler: '110'\n})\n    .then((res) => {\n        // do something\n    })\n    .catch((err) => {\n        // \b这里处理 code 为 110 的异常\n        // 此时 errorHandler[110] 函数不会生效,也不会执行 errorHandler.default\n    });\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    使用

    发起一个普通 post 请求

    import { request } from '@fesjs/fes';\n\nrequest('/api/login', {\n    username: 'robby',\n    password: '123456'\n})\n    .then((res) => {\n        // do something\n    })\n    .catch((err) => {\n        // 处理异常\n    });\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    merge 重复请求

    连续发送多个请求,会被合并成一个请求,不会报 REPEAT 接口错误。

    当发生 REPEAT 请求异常,并且确保自身代码合理的情况下,可以使用该配置。

    import { request } from '@fesjs/fes';\n\nrequest(\n    '/api/login',\n    {\n        username: 'robby',\n        password: '123456'\n    },\n    {\n        mergeRequest: true // 在一个请求没有回来前,重复发送的请求会合并成一个请求\n    }\n)\n    .then((res) => {\n        // do something\n    })\n    .catch((err) => {\n        // 处理异常\n    });\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18

    请求节流(即将废弃)

    即将废弃

    因为 request 的请求总会有一个 promise 结果,要么成功,要么失败,和防抖、节流的语义不一致,防抖、节流只是函数的不执行

    请求缓存

    import { request } from '@fesjs/fes';\n\nrequest(\n    '/api/login',\n    {\n        username: 'robby',\n        password: '123456'\n    },\n    {\n        cache: {\n            cacheType: 'ram', // ram: 内存,session: sessionStorage,local:localStorage\n            cacheTime: 1000 * 60 * 3 // 缓存时间:默认3min\n        }\n    }\n)\n    .then((res) => {\n        // do something\n    })\n    .catch((err) => {\n        // 处理异常\n    });\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21

    cachetrue,则默认使用 ram 缓存类型,缓存时间 3min。

    结合 use 使用

    import { useRequest } from '@fesjs/fes';\n\nexport default {\n    setup() {\n        const { loading, data, error } = useRequest('/api/login', {\n            username: 'robby',\n            password: '123456'\n        });\n\n        return {\n            loading,\n            data,\n            error\n        };\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    配置拦截器

    ',21),r={href:"http://axios-js.com/zh-cn/docs/#%E6%8B%A6%E6%88%AA%E5%99%A8",target:"_blank",rel:"noopener noreferrer"},u=(0,p.uE)('
    export const request = {\n    requestInterceptors: [\n        function (config) {\n            // 在发送请求之前做些什么\n            return config;\n        },\n        [\n            function (config) {\n                // 在发送请求之前做些什么\n                return config;\n            },\n            function (error) {\n                // 对请求错误做些什么\n                return Promise.reject(error);\n            }\n        ]\n    ],\n    // 响应拦截器\n    responseInterceptors: [\n        function (response) {\n            // 对响应数据做点什么\n            return response;\n        },\n        [\n            function (response) {\n                // 对响应数据做点什么\n                return response;\n            },\n            function (error) {\n                // 对响应错误做点什么\n                return Promise.reject(error);\n            }\n        ]\n    ]\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35

    API

    request

    • 类型:函数

    • 详情:请求后端接口

    • 参数

      • url: 后端接口 url
      • data: 参数
      • options: \b 配置( 支持 axios 所有配置)
    • 返回值: Promise

    useRequest

    request 的封装,返回响应式 loadingerrordata

    ',6),i={},k=(0,a(3744).Z)(i,[["render",function(n,s){const a=(0,p.up)("OutboundLink");return(0,p.wg)(),(0,p.iD)(p.HY,null,[e,(0,p._)("div",t,[o,(0,p._)("p",null,[(0,p.Uk)("这个字段将在下个版本废弃,推荐使用 "),(0,p._)("a",c,[(0,p.Uk)("axios baseURL"),(0,p.Wm)(a)]),(0,p.Uk)("。")])]),l,(0,p._)("p",null,[(0,p.Uk)("函数的参数格式:"),(0,p._)("a",r,[(0,p.Uk)("传送门"),(0,p.Wm)(a)]),(0,p.Uk)(";")]),u],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-494b840e.ae393909.js b/assets/js/v-494b840e.3219979d.js similarity index 99% rename from assets/js/v-494b840e.ae393909.js rename to assets/js/v-494b840e.3219979d.js index d5f58fbc..aa8ef019 100644 --- a/assets/js/v-494b840e.ae393909.js +++ b/assets/js/v-494b840e.3219979d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[861],{4794:(a,n,s)=>{s.r(n),s.d(n,{data:()=>e});const e={key:"v-494b840e",path:"/reference/plugin/dev/",title:"插件介绍",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"开始",slug:"开始",children:[]},{level:2,title:"创建插件",slug:"创建插件",children:[]},{level:2,title:"发布到 npm",slug:"发布到-npm",children:[]}],filePathRelative:"reference/plugin/dev/README.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},2754:(a,n,s)=>{s.r(n),s.d(n,{default:()=>c});const e=(0,s(6252).uE)('

    插件介绍

    开始

    一个插件是一个 npm 包,它能够为 Fes.js 创建的项目添加额外的功能,这些功能包括:

    • 项目的 webpack 配置。
    • 修改项目的 babel 配置。
    • 添加新的 fes 命令 - 例如 @fes/plugin-jest 添加了 fes test 命令,允许开发者运行单元测试。
    • 集成 Vue 的插件。
    • 修改路由配置
    • 提供运行时 API
    • ...

    插件的入口是一个函数,函数会以 API 对象作为第一个参数:

    export default (api)=>{\n    api.describe({\n        key: 'esbuild',\n        config: {\n            schema(joi) {\n                return joi.object();\n            },\n            default: {}\n        },\n        enableBy: api.EnableBy.config,\n    });\n}\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    API 对象是构建流程管理 Service 类的实例,api 提供一些有用的方法帮助你开发插件。

    api.describe用来描述插件:

    • key, 插件的 key,可以理解为插件的名称,在 .fes.js 中用 key 配置此插件。
    • config,插件的配置信息:
      • schema,定义配置的类型
      • default,默认配置
    • enableBy, 是否开启插件,可配置某些场景下禁用插件。

    创建插件

    第一步:安装create-fes-app
    npm i -g @fesjs/create-fes-app\n
    1
    第二步:创建插件项目
    create-fes-app pluginName\n
    1

    在询问Pick an template时选择Plugin!

    第三步:进入插件目录 & 安装依赖
    cd pluginName & yarn\n
    1
    第四步:启动编译
    yarn dev\n
    1
    第五步:使用插件API完成你的插件!(可以参考其他插件理解api用法和场景)

    发布到 npm

    @fesjs/preset-@fesjs/plugin-@webank/fes-preset-@webank/fes-plugin-fes-preset-fes-plugin- 开头的依赖会被 Fes.js 自动注册为插件或插件集。

    所以编写好的插件想发布到 npm 供其他人使用,包名必须是 fes-preset-fes-plugin- 开头。

    ',23),p={},c=(0,s(3744).Z)(p,[["render",function(a,n){return e}]])},3744:(a,n)=>{n.Z=(a,n)=>{const s=a.__vccOpts||a;for(const[a,e]of n)s[a]=e;return s}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[861],{4794:(a,n,s)=>{s.r(n),s.d(n,{data:()=>e});const e={key:"v-494b840e",path:"/reference/plugin/dev/",title:"插件介绍",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"开始",slug:"开始",children:[]},{level:2,title:"创建插件",slug:"创建插件",children:[]},{level:2,title:"发布到 npm",slug:"发布到-npm",children:[]}],filePathRelative:"reference/plugin/dev/README.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},2754:(a,n,s)=>{s.r(n),s.d(n,{default:()=>c});const e=(0,s(6252).uE)('

    插件介绍

    开始

    一个插件是一个 npm 包,它能够为 Fes.js 创建的项目添加额外的功能,这些功能包括:

    • 项目的 webpack 配置。
    • 修改项目的 babel 配置。
    • 添加新的 fes 命令 - 例如 @fes/plugin-jest 添加了 fes test 命令,允许开发者运行单元测试。
    • 集成 Vue 的插件。
    • 修改路由配置
    • 提供运行时 API
    • ...

    插件的入口是一个函数,函数会以 API 对象作为第一个参数:

    export default (api)=>{\n    api.describe({\n        key: 'esbuild',\n        config: {\n            schema(joi) {\n                return joi.object();\n            },\n            default: {}\n        },\n        enableBy: api.EnableBy.config,\n    });\n}\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    API 对象是构建流程管理 Service 类的实例,api 提供一些有用的方法帮助你开发插件。

    api.describe用来描述插件:

    • key, 插件的 key,可以理解为插件的名称,在 .fes.js 中用 key 配置此插件。
    • config,插件的配置信息:
      • schema,定义配置的类型
      • default,默认配置
    • enableBy, 是否开启插件,可配置某些场景下禁用插件。

    创建插件

    第一步:安装create-fes-app
    npm i -g @fesjs/create-fes-app\n
    1
    第二步:创建插件项目
    create-fes-app pluginName\n
    1

    在询问Pick an template时选择Plugin!

    第三步:进入插件目录 & 安装依赖
    cd pluginName & yarn\n
    1
    第四步:启动编译
    yarn dev\n
    1
    第五步:使用插件API完成你的插件!(可以参考其他插件理解api用法和场景)

    发布到 npm

    @fesjs/preset-@fesjs/plugin-@webank/fes-preset-@webank/fes-plugin-fes-preset-fes-plugin- 开头的依赖会被 Fes.js 自动注册为插件或插件集。

    所以编写好的插件想发布到 npm 供其他人使用,包名必须是 fes-preset-fes-plugin- 开头。

    ',23),p={},c=(0,s(3744).Z)(p,[["render",function(a,n){return e}]])},3744:(a,n)=>{n.Z=(a,n)=>{const s=a.__vccOpts||a;for(const[a,e]of n)s[a]=e;return s}}}]); \ No newline at end of file diff --git a/assets/js/v-528b8b6c.7f10a88c.js b/assets/js/v-528b8b6c.e0560471.js similarity index 98% rename from assets/js/v-528b8b6c.7f10a88c.js rename to assets/js/v-528b8b6c.e0560471.js index 8f06894c..3edd0b1a 100644 --- a/assets/js/v-528b8b6c.7f10a88c.js +++ b/assets/js/v-528b8b6c.e0560471.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[972],{2296:(n,a,s)=>{s.r(a),s.d(a,{data:()=>e});const e={key:"v-528b8b6c",path:"/guide/image.html",title:"使用图片",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"使用图片",slug:"使用图片-1",children:[{level:3,title:"Vue 里使用图片",slug:"vue-里使用图片",children:[]},{level:3,title:"JS 里使用图片",slug:"js-里使用图片",children:[]},{level:3,title:"CSS 里使用图片",slug:"css-里使用图片",children:[]}]},{level:2,title:"public 文件夹",slug:"public-文件夹",children:[{level:3,title:"在HTML模板中使用",slug:"在html模板中使用",children:[]},{level:3,title:"在.vue 文件中使用",slug:"在-vue-文件中使用",children:[]}]}],filePathRelative:"guide/image.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},2682:(n,a,s)=>{s.r(a),s.d(a,{default:()=>p});const e=(0,s(6252).uE)('

    使用图片

    使用图片

    假设在 src/images 目录下有 logo.png

    Vue 里使用图片

    <template>\n  <img src="@/images/logo.png`">\n</template>\n
    1
    2
    3

    JS 里使用图片

    import imageUrl from '@/images/logo.png`'\n
    1

    CSS 里使用图片

    .logo {\n    background: url('@/images/logo.png')\n}\n
    1
    2
    3

    注意:

    1. 这是 webpack 的规则,如果切到其他打包工具,可能会有变化
    2. less 中同样适用

    public 文件夹

    有些内容不需要经过 webpack 模块化处理,则可以将这些内容放在 public 文件夹,构建后会直接复制到 dist 目录,所以你需要通过BASE_URL来引入它们。

    在HTML模板中使用

    public/index.html 中需要设置:

    <link rel="icon" href="<%= BASE_URL %>favicon.ico">\n
    1

    在.vue 文件中使用

    <template>\n  <img :src="`${publicPath}my-image.png`">\n</template>\n<script>\nexport default {\n  setup() {\n    return {\n      publicPath: process.env.BASE_URL\n    }\n  }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ',18),t={},p=(0,s(3744).Z)(t,[["render",function(n,a){return e}]])},3744:(n,a)=>{a.Z=(n,a)=>{const s=n.__vccOpts||n;for(const[n,e]of a)s[n]=e;return s}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[972],{2296:(n,a,s)=>{s.r(a),s.d(a,{data:()=>e});const e={key:"v-528b8b6c",path:"/guide/image.html",title:"使用图片",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"使用图片",slug:"使用图片-1",children:[{level:3,title:"Vue 里使用图片",slug:"vue-里使用图片",children:[]},{level:3,title:"JS 里使用图片",slug:"js-里使用图片",children:[]},{level:3,title:"CSS 里使用图片",slug:"css-里使用图片",children:[]}]},{level:2,title:"public 文件夹",slug:"public-文件夹",children:[{level:3,title:"在HTML模板中使用",slug:"在html模板中使用",children:[]},{level:3,title:"在.vue 文件中使用",slug:"在-vue-文件中使用",children:[]}]}],filePathRelative:"guide/image.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},2682:(n,a,s)=>{s.r(a),s.d(a,{default:()=>p});const e=(0,s(6252).uE)('

    使用图片

    使用图片

    假设在 src/images 目录下有 logo.png

    Vue 里使用图片

    <template>\n  <img src="@/images/logo.png`">\n</template>\n
    1
    2
    3

    JS 里使用图片

    import imageUrl from '@/images/logo.png`'\n
    1

    CSS 里使用图片

    .logo {\n    background: url('@/images/logo.png')\n}\n
    1
    2
    3

    注意:

    1. 这是 webpack 的规则,如果切到其他打包工具,可能会有变化
    2. less 中同样适用

    public 文件夹

    有些内容不需要经过 webpack 模块化处理,则可以将这些内容放在 public 文件夹,构建后会直接复制到 dist 目录,所以你需要通过BASE_URL来引入它们。

    在HTML模板中使用

    public/index.html 中需要设置:

    <link rel="icon" href="<%= BASE_URL %>favicon.ico">\n
    1

    在.vue 文件中使用

    <template>\n  <img :src="`${publicPath}my-image.png`">\n</template>\n<script>\nexport default {\n  setup() {\n    return {\n      publicPath: process.env.BASE_URL\n    }\n  }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ',18),t={},p=(0,s(3744).Z)(t,[["render",function(n,a){return e}]])},3744:(n,a)=>{a.Z=(n,a)=>{const s=n.__vccOpts||n;for(const[n,e]of a)s[n]=e;return s}}}]); \ No newline at end of file diff --git a/assets/js/v-5bf80046.7053c98c.js b/assets/js/v-5bf80046.734741c7.js similarity index 98% rename from assets/js/v-5bf80046.7053c98c.js rename to assets/js/v-5bf80046.734741c7.js index 7326a31e..d75e4cd8 100644 --- a/assets/js/v-5bf80046.7053c98c.js +++ b/assets/js/v-5bf80046.734741c7.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[463],{93:(s,a,n)=>{n.r(a),n.d(a,{data:()=>e});const e={key:"v-5bf80046",path:"/reference/plugin/plugins/sass.html",title:"@fesjs/plugin-sass",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"global css",slug:"global-css",children:[]},{level:2,title:"Vue 单文件组件",slug:"vue-单文件组件",children:[]}],filePathRelative:"reference/plugin/plugins/sass.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5310:(s,a,n)=>{n.r(a),n.d(a,{default:()=>l});const e=(0,n(6252).uE)('

    @fesjs/plugin-sass

    介绍

    Fes.js 默认只支持 less,通过此插件扩展支持 sass

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-sass": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    global css

    添加 src/global.scsssrc/global.sass 为全局CSS入口,添加一些通用样式内容。

    Vue 单文件组件

    Vue 单文件组件的 <style></style> 添加 lang='scss',例如:

    <style lang="scss">\n</style>\n
    1
    2
    ',11),t={},l=(0,n(3744).Z)(t,[["render",function(s,a){return e}]])},3744:(s,a)=>{a.Z=(s,a)=>{const n=s.__vccOpts||s;for(const[s,e]of a)n[s]=e;return n}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[463],{93:(s,a,n)=>{n.r(a),n.d(a,{data:()=>e});const e={key:"v-5bf80046",path:"/reference/plugin/plugins/sass.html",title:"@fesjs/plugin-sass",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"global css",slug:"global-css",children:[]},{level:2,title:"Vue 单文件组件",slug:"vue-单文件组件",children:[]}],filePathRelative:"reference/plugin/plugins/sass.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5310:(s,a,n)=>{n.r(a),n.d(a,{default:()=>l});const e=(0,n(6252).uE)('

    @fesjs/plugin-sass

    介绍

    Fes.js 默认只支持 less,通过此插件扩展支持 sass

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-sass": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    global css

    添加 src/global.scsssrc/global.sass 为全局CSS入口,添加一些通用样式内容。

    Vue 单文件组件

    Vue 单文件组件的 <style></style> 添加 lang='scss',例如:

    <style lang="scss">\n</style>\n
    1
    2
    ',11),t={},l=(0,n(3744).Z)(t,[["render",function(s,a){return e}]])},3744:(s,a)=>{a.Z=(s,a)=>{const n=s.__vccOpts||s;for(const[s,e]of a)n[s]=e;return n}}}]); \ No newline at end of file diff --git a/assets/js/v-5f4c684e.1ee28031.js b/assets/js/v-5f4c684e.004fc897.js similarity index 95% rename from assets/js/v-5f4c684e.1ee28031.js rename to assets/js/v-5f4c684e.004fc897.js index 10a28264..9e6d6990 100644 --- a/assets/js/v-5f4c684e.1ee28031.js +++ b/assets/js/v-5f4c684e.004fc897.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[132],{8462:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-5f4c684e",path:"/reference/plugin/plugins/vuex.html",title:"@fesjs/plugin-vuex",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"配置",slug:"配置",children:[]},{level:2,title:"场景使用",slug:"场景使用",children:[]},{level:2,title:"vuex插件",slug:"vuex插件",children:[]},{level:2,title:"API",slug:"api",children:[{level:3,title:"store",slug:"store",children:[]},{level:3,title:"MUTATION_TYPES",slug:"mutation-types",children:[]},{level:3,title:"GETTER_TYPES",slug:"getter-types",children:[]},{level:3,title:"ACTION_TYPES",slug:"action-types",children:[]}]}],filePathRelative:"reference/plugin/plugins/vuex.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},4565:(n,s,a)=>{a.r(s),a.d(s,{default:()=>r});var p=a(6252);const t=(0,p.uE)('

    @fesjs/plugin-vuex

    介绍

    集成vuex插件

    增强vuex,导出所有的mutationsactionsgetter的事件类型,编辑器提示

    约定模式,module和plugin定义放在stores目录下,文件名包含plugin被解析为插件,无需额外配置,定义即可用。

    └── src\n    ├── pages\n    │    └── index.vue\n    └── stores \n    │    └── foo\n    │    │    └── bar.js\n    │    ├── counter.js\n    │    ├── plugin-logger.js       \n    │    ├── user.js\n    └── app.js\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    提示

    为了防止fesjsvuex的export冲突,fesjs不提供导出vuex的任何api。你可以直接使用vuex的api

    import { useStore } from 'vuex';\n
    1

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-vuex": "^2.0.0"\n    }\n}\n
    1
    2
    3
    4
    5
    6

    配置

    .fes.js 中配置:

    export default {\n    vuex: {\n        strict: true // 开启严格模式\n    }\n}\n
    1
    2
    3
    4
    5

    场景使用

    先定义在stores下定义user模块,包含嵌套模块

    stores/user.js

    export default {\n    namespaced: true,\n    state: () => ({\n        name: 'aring',\n        age: 20\n    }),\n    actions: {\n        login() {\n            return new Promise((reslove) => {\n                setTimeout(() => {\n                    console.log('login');\n                    reslove('OK');\n                }, 1000);\n            });\n        }\n    },\n    modules: {\n        address: {\n            state: () => ({\n                province: '广东省',\n                city: '深圳市',\n                zone: '南山区'\n            }),\n            getters: {\n                address(state) {\n                    return state.province + state.city + state.zone;\n                }\n            }\n        }\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31

    stores/foo/bar.js

    export default {\n    namespaced: true,\n    state: () => ({\n        count: 0\n    }),\n    mutations: {\n        increment(state) {\n            state.count++;\n        }\n    },\n    getters: {\n        doubleCount(state) {\n            return state.count * 2;\n        }\n    },\n    actions: {\n        asyncIncrement({ commit }) {\n            setTimeout(() => {\n                commit('increment');\n            }, 2000);\n        }\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23

    提示

    导出的mutationsactionsgetter的事件类型,将会按文件命名;

    ACTION_TYPES.user.login指向user模块中actions的login方法

    GETTER_TYPES.user.address指向user模块中嵌套的address getter

    MUTATION_TYPES.fooBar.increment指向foo/bar模块中mutations的increment方法

    在vue文件中使用store

    <template>\n    <div>\n        <h4>Vuex</h4>\n        <div><button :disabled="disabled" @click="login">async login</button></div>\n        <div><button @click="fooBarIncrement">foo/bar:{{fooBarDoubleCount}}</button></div>\n        <div>{{address}}</div>\n    </div>\n</template>\n<config>\n{\n    "name": "store",\n    "title": "vuex测试"\n}\n</config>\n<script>\nimport { computed, ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { MUTATION_TYPES, GETTER_TYPES, ACTION_TYPES } from '@fesjs/fes';\n\nexport default {\n    setup() {\n        const store = useStore();\n        console.log('store==>', store);\n        const disabled = ref(false);\n        // 可以利用导出的事件类型,不再通过字符传入(store.getters['user/address'])\n        return {\n            address: computed(() => store.getters[GETTER_TYPES.user.address]),\n            disabled,\n            login: () => {\n                disabled.value = true;\n                store.dispatch(ACTION_TYPES.user.login).then((res) => {\n                    window.alert(res);\n                    disabled.value = false;\n                });\n            },\n            fooBarIncrement: () => store.commit(MUTATION_TYPES.fooBar.increment), // foo/bar目录会解析成驼峰fooBar\n            fooBarDoubleCount: computed(() => store.getters[GETTER_TYPES.fooBar.doubleCount])\n        };\n    }\n};\n</script>\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42

    提示

    由于该插件注册在onAppCreated中,如果在onAppCreated及之前使用useStore时,获取不到vuex实例

    fesjs导出了vuex实例store,如在app.js文件中

    import { store, GETTER_TYPES } from '@fesjs/fes';\nconsole.log(store.getters[GETTER_TYPES.user.address])\n
    1
    2

    vuex插件

    ',24),e=(0,p.Uk)("stores文件夹下的文件名包含plugin被解析为插件,vuex插件写法参考"),o={href:"https://next.vuex.vuejs.org/guide/plugins.html",target:"_blank",rel:"noopener noreferrer"},c=(0,p.Uk)("官方文档"),l=(0,p.uE)('

    API

    store

    • 类型 Object
    • vuex实例

    MUTATION_TYPES

    • 类型 Object
    • mutation的所有事件类型

    GETTER_TYPES

    • 类型 Object
    • getter的所有方法名

    ACTION_TYPES

    • 类型 Object
    • action的所有事件类型
    ',9),u={},r=(0,a(3744).Z)(u,[["render",function(n,s){const a=(0,p.up)("OutboundLink");return(0,p.wg)(),(0,p.iD)(p.HY,null,[t,(0,p._)("p",null,[e,(0,p._)("a",o,[c,(0,p.Wm)(a)])]),l],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[132],{8462:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-5f4c684e",path:"/reference/plugin/plugins/vuex.html",title:"@fesjs/plugin-vuex",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"配置",slug:"配置",children:[]},{level:2,title:"场景使用",slug:"场景使用",children:[]},{level:2,title:"vuex插件",slug:"vuex插件",children:[]},{level:2,title:"API",slug:"api",children:[{level:3,title:"store",slug:"store",children:[]},{level:3,title:"MUTATION_TYPES",slug:"mutation-types",children:[]},{level:3,title:"GETTER_TYPES",slug:"getter-types",children:[]},{level:3,title:"ACTION_TYPES",slug:"action-types",children:[]}]}],filePathRelative:"reference/plugin/plugins/vuex.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},4565:(n,s,a)=>{a.r(s),a.d(s,{default:()=>l});var p=a(6252);const t=(0,p.uE)('

    @fesjs/plugin-vuex

    介绍

    集成vuex插件

    增强vuex,导出所有的mutationsactionsgetter的事件类型,编辑器提示

    约定模式,module和plugin定义放在stores目录下,文件名包含plugin被解析为插件,无需额外配置,定义即可用。

    └── src\n    ├── pages\n    │    └── index.vue\n    └── stores \n    │    └── foo\n    │    │    └── bar.js\n    │    ├── counter.js\n    │    ├── plugin-logger.js       \n    │    ├── user.js\n    └── app.js\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    提示

    为了防止fesjsvuex的export冲突,fesjs不提供导出vuex的任何api。你可以直接使用vuex的api

    import { useStore } from 'vuex';\n
    1

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-vuex": "^2.0.0"\n    }\n}\n
    1
    2
    3
    4
    5
    6

    配置

    .fes.js 中配置:

    export default {\n    vuex: {\n        strict: true // 开启严格模式\n    }\n}\n
    1
    2
    3
    4
    5

    场景使用

    先定义在stores下定义user模块,包含嵌套模块

    stores/user.js

    export default {\n    namespaced: true,\n    state: () => ({\n        name: 'aring',\n        age: 20\n    }),\n    actions: {\n        login() {\n            return new Promise((reslove) => {\n                setTimeout(() => {\n                    console.log('login');\n                    reslove('OK');\n                }, 1000);\n            });\n        }\n    },\n    modules: {\n        address: {\n            state: () => ({\n                province: '广东省',\n                city: '深圳市',\n                zone: '南山区'\n            }),\n            getters: {\n                address(state) {\n                    return state.province + state.city + state.zone;\n                }\n            }\n        }\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31

    stores/foo/bar.js

    export default {\n    namespaced: true,\n    state: () => ({\n        count: 0\n    }),\n    mutations: {\n        increment(state) {\n            state.count++;\n        }\n    },\n    getters: {\n        doubleCount(state) {\n            return state.count * 2;\n        }\n    },\n    actions: {\n        asyncIncrement({ commit }) {\n            setTimeout(() => {\n                commit('increment');\n            }, 2000);\n        }\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23

    提示

    导出的mutationsactionsgetter的事件类型,将会按文件命名;

    ACTION_TYPES.user.login指向user模块中actions的login方法

    GETTER_TYPES.user.address指向user模块中嵌套的address getter

    MUTATION_TYPES.fooBar.increment指向foo/bar模块中mutations的increment方法

    在vue文件中使用store

    <template>\n    <div>\n        <h4>Vuex</h4>\n        <div><button :disabled="disabled" @click="login">async login</button></div>\n        <div><button @click="fooBarIncrement">foo/bar:{{fooBarDoubleCount}}</button></div>\n        <div>{{address}}</div>\n    </div>\n</template>\n<config>\n{\n    "name": "store",\n    "title": "vuex测试"\n}\n</config>\n<script>\nimport { computed, ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { MUTATION_TYPES, GETTER_TYPES, ACTION_TYPES } from '@fesjs/fes';\n\nexport default {\n    setup() {\n        const store = useStore();\n        console.log('store==>', store);\n        const disabled = ref(false);\n        // 可以利用导出的事件类型,不再通过字符传入(store.getters['user/address'])\n        return {\n            address: computed(() => store.getters[GETTER_TYPES.user.address]),\n            disabled,\n            login: () => {\n                disabled.value = true;\n                store.dispatch(ACTION_TYPES.user.login).then((res) => {\n                    window.alert(res);\n                    disabled.value = false;\n                });\n            },\n            fooBarIncrement: () => store.commit(MUTATION_TYPES.fooBar.increment), // foo/bar目录会解析成驼峰fooBar\n            fooBarDoubleCount: computed(() => store.getters[GETTER_TYPES.fooBar.doubleCount])\n        };\n    }\n};\n</script>\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42

    提示

    由于该插件注册在onAppCreated中,如果在onAppCreated及之前使用useStore时,获取不到vuex实例

    fesjs导出了vuex实例store,如在app.js文件中

    import { store, GETTER_TYPES } from '@fesjs/fes';\nconsole.log(store.getters[GETTER_TYPES.user.address])\n
    1
    2

    vuex插件

    ',24),e={href:"https://next.vuex.vuejs.org/guide/plugins.html",target:"_blank",rel:"noopener noreferrer"},o=(0,p.uE)('

    API

    store

    • 类型 Object
    • vuex实例

    MUTATION_TYPES

    • 类型 Object
    • mutation的所有事件类型

    GETTER_TYPES

    • 类型 Object
    • getter的所有方法名

    ACTION_TYPES

    • 类型 Object
    • action的所有事件类型
    ',9),c={},l=(0,a(3744).Z)(c,[["render",function(n,s){const a=(0,p.up)("OutboundLink");return(0,p.wg)(),(0,p.iD)(p.HY,null,[t,(0,p._)("p",null,[(0,p.Uk)("stores文件夹下的文件名包含plugin被解析为插件,vuex插件写法参考"),(0,p._)("a",e,[(0,p.Uk)("官方文档"),(0,p.Wm)(a)])]),o],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-6320961c.594d5357.js b/assets/js/v-6320961c.594d5357.js new file mode 100644 index 00000000..55f11b2d --- /dev/null +++ b/assets/js/v-6320961c.594d5357.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[626],{6254:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-6320961c",path:"/guide/route.html",title:"路由",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"路由配置",slug:"路由配置",children:[{level:3,title:"routes",slug:"routes",children:[]},{level:3,title:"mode",slug:"mode",children:[]}]},{level:2,title:"约定式路由",slug:"约定式路由",children:[{level:3,title:"约定规范",slug:"约定规范",children:[]},{level:3,title:"动态路由",slug:"动态路由",children:[]},{level:3,title:"嵌套路由",slug:"嵌套路由",children:[]},{level:3,title:"模糊匹配",slug:"模糊匹配",children:[]},{level:3,title:"扩展路由元信息",slug:"扩展路由元信息",children:[]},{level:3,title:"智能路由",slug:"智能路由",children:[]}]},{level:2,title:"路由跳转",slug:"路由跳转",children:[{level:3,title:"声明式",slug:"声明式",children:[]},{level:3,title:"命令式",slug:"命令式",children:[]}]}],filePathRelative:"guide/route.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},7570:(n,s,a)=>{a.r(s),a.d(s,{default:()=>F});var p=a(6252);const t=(0,p._)("h1",{id:"路由",tabindex:"-1"},[(0,p._)("a",{class:"header-anchor",href:"#路由","aria-hidden":"true"},"#"),(0,p.Uk)(" 路由")],-1),e=(0,p._)("code",null,"Vue Router",-1),o={href:"https://next.router.vuejs.org/",target:"_blank",rel:"noopener noreferrer"},r=(0,p.uE)('

    路由配置

    在配置文件 .fes.js中通过 router 进行配置。

    export default {\n    router: {\n        routes: [],\n        mode: 'hash'\n    }\n}\n
    1
    2
    3
    4
    5
    6

    routes

    ',4),l=(0,p._)("code",null,"routes",-1),c={href:"https://next.router.vuejs.org/zh/guide/",target:"_blank",rel:"noopener noreferrer"},u=(0,p._)("h3",{id:"mode",tabindex:"-1"},[(0,p._)("a",{class:"header-anchor",href:"#mode","aria-hidden":"true"},"#"),(0,p.Uk)(" mode")],-1),i=(0,p._)("p",null,"创建历史记录的类型:",-1),k=(0,p._)("strong",null,"history",-1),b={href:"https://next.router.vuejs.org/zh/api/#createwebhistory",target:"_blank",rel:"noopener noreferrer"},m=(0,p._)("strong",null,"hash",-1),d={href:"https://next.router.vuejs.org/zh/api/#createWebHashHistory",target:"_blank",rel:"noopener noreferrer"},g=(0,p._)("strong",null,"memory",-1),h={href:"https://next.router.vuejs.org/zh/api/#createWebHashHistory",target:"_blank",rel:"noopener noreferrer"},y=(0,p.uE)('

    默认是hash模式。

    约定式路由

    约定式路由也叫文件路由,就是不需要手写配置,文件系统即路由,通过目录和文件及其命名分析出路由配置。

    约定规范

    比如以下文件结构:

    pages\n├── index.vue         # 根路由页面 路径为 /\n├── *.vue             # 模糊匹配 路径为 *\n├── a.vue             # 路径 /a\n├── b                 # 文件夹b\n│   ├── index.vue     # 路径 /b\n│   ├── @id.vue       # 动态路由 /b/:id\n│   ├── c.vue         # 路径 /b/c\n│   └── layout.vue    # /b 路径下所有页面公共的布局组件\n└── layout.vue        # 根路由下所有页面共用的布局组件\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    编译后会得到以下路由配置:

    [\n    {\n        "path": "/",\n        "component": require('@/pages/layout').default,\n        "count": 5,\n        "children": [\n            {\n                "path": "/a",\n                "component": require('@/pages/a').default,\n                "name": "a",\n                "meta": {},\n                "count": 7\n            },\n            {\n                "path": "/b",\n                "component": require('@/pages/b/layout').default,\n                "count": 7,\n                "children": [\n                    {\n                        "path": "/b/c",\n                        "component": require('@/pages/b/c').default,\n                        "name": "b_c",\n                        "meta": {},\n                        "count": 14\n                    },\n                    {\n                        "path": "/b/:id",\n                        "component": require('@/pages/b/@id').default,\n                        "name": "b__id",\n                        "meta": {},\n                        "count": 13\n                    },\n                    {\n                        "path": "/b",\n                        "component": require('@/pages/b/index').default,\n                        "name": "b_index",\n                        "meta": {},\n                        "count": 7\n                    }\n                ]\n            },\n            {\n                "path": "/",\n                "component": require('@/pages/index').default,\n                "name": "index",\n                "meta": {},\n                "count": 5\n            },\n            {\n                "path": "/:pathMatch(.*)",\n                "component": require('@/pages/*').default,\n                "name": "FUZZYMATCH",\n                "meta": {},\n                "count": 3\n            }\n        ]\n    }\n]\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58

    需要注意的是,满足以下任意规则的文件不会被注册为路由

    • 不是 .vue .jsx 文件
    • components 目录中的文件

    动态路由

    Fes.js 里约定以 @ 开头的文件或文件夹映射为动态路由。 比如:

    • src/pages/users/@id.vue 会成为 /users/:id
    • src/pages/users/@id/settings.vue 会成为 /users/:id/settings

    嵌套路由

    Fes.js 里约定目录下有 layout.vue 时会生成嵌套路由,以 layout.vue 为该目录的公共父组件,layout.vue 中必须实现 RouterView

    比如以下目录结构:

    pages\n└── users\n    ├── layout.vue\n    ├── index.vue\n    └── list.vue\n
    1
    2
    3
    4
    5

    会生成路由:

    [\n    { \n        path: '/users', component: require('@/pages/users/layout').default,\n        children: [\n            { path: '/users', component: require('@/pages/users/index').default },\n            { path: '/users/list', component: require('@/pages/users/list').default },\n        ]\n    }\n]\n
    1
    2
    3
    4
    5
    6
    7
    8
    9

    模糊匹配

    ',20),_=(0,p._)("code",null,"*",-1),v={href:"https://next.router.vuejs.org/zh/guide/essentials/dynamic-matching.html#%E6%8D%95%E8%8E%B7%E6%89%80%E6%9C%89%E8%B7%AF%E7%94%B1%E6%88%96-404-not-found-%E8%B7%AF%E7%94%B1",target:"_blank",rel:"noopener noreferrer"},q=(0,p.uE)('

    比如以下目录结构:

    pages\n├── index.vue         # 根路由页面 路径为 /\n└── *.vue             # 模糊匹配 路径为 *\n
    1
    2
    3

    会生成路由:

    [\n    { \n        path: '/', component: require('@/pages/index').default, count: 5\n    },\n    {\n        path: '/:pathMatch(.*)', component: require('@/pages/**').default, count: 3\n    }\n]\n
    1
    2
    3
    4
    5
    6
    7
    8

    这样,如果访问 /foo/ 不能匹配,会 fallback 到 * 路由,通过 src/pages/*.vue 进行渲染。

    扩展路由元信息

    我们在定义路由时可以配置meta字段,用来记录一些跟路由相关的信息:

    const router = new VueRouter({\n  routes: [\n    {\n      path: '/foo',\n      component: Foo,\n      children: [\n        {\n          path: 'bar',\n          component: Bar,\n          // a meta field\n          meta: { requiresAuth: true }\n        }\n      ]\n    }\n  ]\n})\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    接下来我们来配置 meta

    ',9),f=(0,p._)("div",{class:"language-vue ext-vue line-numbers-mode"},[(0,p._)("pre",{class:"language-vue"},[(0,p._)("code",null,[(0,p._)("span",{class:"token tag"},[(0,p._)("span",{class:"token tag"},[(0,p._)("span",{class:"token punctuation"},"<"),(0,p.Uk)("config")]),(0,p._)("span",{class:"token punctuation"},">")]),(0,p.Uk)('\n{\n "name": "store",\n "title": "vuex测试"\n}\n'),(0,p._)("span",{class:"token tag"},[(0,p._)("span",{class:"token tag"},[(0,p._)("span",{class:"token punctuation"},"")]),(0,p.Uk)("\n")])]),(0,p._)("div",{class:"line-numbers"},[(0,p._)("span",{class:"line-number"},"1"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"2"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"3"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"4"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"5"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"6"),(0,p._)("br")])],-1),x=(0,p._)("div",{class:"language-jsx ext-jsx line-numbers-mode"},[(0,p._)("pre",{class:"language-jsx"},[(0,p._)("code",null,[(0,p._)("span",{class:"token keyword"},"import"),(0,p.Uk)(),(0,p._)("span",{class:"token punctuation"},"{"),(0,p.Uk)(" defineRouteMeta"),(0,p._)("span",{class:"token punctuation"},","),(0,p.Uk)(" useRoute "),(0,p._)("span",{class:"token punctuation"},"}"),(0,p.Uk)(),(0,p._)("span",{class:"token keyword"},"from"),(0,p.Uk)(),(0,p._)("span",{class:"token string"},"'@fesjs/fes'"),(0,p._)("span",{class:"token punctuation"},";"),(0,p.Uk)("\n"),(0,p._)("span",{class:"token function"},"defineRouteMeta"),(0,p._)("span",{class:"token punctuation"},"("),(0,p._)("span",{class:"token punctuation"},"{"),(0,p.Uk)("\n "),(0,p._)("span",{class:"token literal-property property"},"name"),(0,p._)("span",{class:"token operator"},":"),(0,p.Uk)(),(0,p._)("span",{class:"token string"},'"store"'),(0,p._)("span",{class:"token punctuation"},","),(0,p.Uk)("\n "),(0,p._)("span",{class:"token literal-property property"},"title"),(0,p._)("span",{class:"token operator"},":"),(0,p.Uk)(),(0,p._)("span",{class:"token string"},'"vuex测试"'),(0,p.Uk)("\n"),(0,p._)("span",{class:"token punctuation"},"}"),(0,p._)("span",{class:"token punctuation"},")"),(0,p.Uk)("\n")])]),(0,p._)("div",{class:"line-numbers"},[(0,p._)("span",{class:"line-number"},"1"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"2"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"3"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"4"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"5"),(0,p._)("br")])],-1),U=(0,p._)("div",{class:"language-tsx ext-tsx line-numbers-mode"},[(0,p._)("pre",{class:"language-tsx"},[(0,p._)("code",null,[(0,p._)("span",{class:"token keyword"},"import"),(0,p.Uk)(),(0,p._)("span",{class:"token punctuation"},"{"),(0,p.Uk)(" defineRouteMeta"),(0,p._)("span",{class:"token punctuation"},","),(0,p.Uk)(" useRoute "),(0,p._)("span",{class:"token punctuation"},"}"),(0,p.Uk)(),(0,p._)("span",{class:"token keyword"},"from"),(0,p.Uk)(),(0,p._)("span",{class:"token string"},"'@fesjs/fes'"),(0,p._)("span",{class:"token punctuation"},";"),(0,p.Uk)("\n"),(0,p._)("span",{class:"token function"},"defineRouteMeta"),(0,p._)("span",{class:"token punctuation"},"("),(0,p._)("span",{class:"token punctuation"},"{"),(0,p.Uk)("\n name"),(0,p._)("span",{class:"token operator"},":"),(0,p.Uk)(),(0,p._)("span",{class:"token string"},'"store"'),(0,p._)("span",{class:"token punctuation"},","),(0,p.Uk)("\n title"),(0,p._)("span",{class:"token operator"},":"),(0,p.Uk)(),(0,p._)("span",{class:"token string"},'"vuex测试"'),(0,p.Uk)("\n"),(0,p._)("span",{class:"token punctuation"},"}"),(0,p._)("span",{class:"token punctuation"},")"),(0,p.Uk)("\n")])]),(0,p._)("div",{class:"line-numbers"},[(0,p._)("span",{class:"line-number"},"1"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"2"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"3"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"4"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"5"),(0,p._)("br")])],-1),j=(0,p.uE)('

    则编译后的路由配置为:

    [\n    { \n        path: '/a', \n        component: require('@/pages/a').default, \n        meta: {\n            "name": "store",\n            "title": "vuex测试"\n        }\n    },\n]\n




     
     
     
     


    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    智能路由

    可以看到,编译后路由都会有 count 属性,这是我们根据精准匹配优先算法原则设计出路由排名算法,对匹配到的路由打分:

    • 路由的路径每个子项得到4分
    • 子项为静态细分(/list)再加3分
    • 子项为动态细分(/:orderId)再加2分
    • 根段(/)再1分
    • 通配符(*)匹配到的减去1分

    当我们跳转路由时,如果 URL 匹配到多个路由,则选择分数最高的路由。

    路由跳转

    ',7),w={href:"https://next.router.vuejs.org/zh/guide/essentials/navigation.html#%E6%9B%BF%E6%8D%A2%E5%BD%93%E5%89%8D%E4%BD%8D%E7%BD%AE",target:"_blank",rel:"noopener noreferrer"},E=(0,p.uE)('

    声明式

    <template>\n    <router-link to="/home">Home</router-link>\n</template>\n
    1
    2
    3

    命令式

    ',3),R=(0,p._)("code",null,"router",-1),W={href:"https://next.router.vuejs.org/zh/api/#router-%E6%96%B9%E6%B3%95",target:"_blank",rel:"noopener noreferrer"},B=(0,p.uE)('
    import { useRouter } from '@fesjs/fes';\n\nexport default {\n    setup(){\n        const router = useRouter();\n        // 这三种形式是等价的\n        router.push('/users/posva#bio')\n        router.push({ path: '/users/posva', hash: '#bio' })\n        router.push({ name: 'users', params: { username: 'posva' }, hash: '#bio' })\n        // 只改变 hash\n        router.push({ hash: '#bio' })\n        // 只改变 query\n        router.push({ query: { page: '2' } })\n        // 只改变 param\n        router.push({ params: { username: 'jolyne' } })\n\n        // 跳转到上一个路由\n        router.goBack();\n\n        // \b跳转到前一个历史记录\n        router.go(1);\n\n        // 替换历史堆栈中的记录\n        router.replace('/new');\n    }\n}\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    ',1),H={},F=(0,a(3744).Z)(H,[["render",function(n,s){const a=(0,p.up)("OutboundLink"),H=(0,p.up)("CodeGroupItem"),F=(0,p.up)("CodeGroup");return(0,p.wg)(),(0,p.iD)(p.HY,null,[t,(0,p._)("p",null,[(0,p.Uk)("像 Vue 、React 这类框架是用组件化搭建页面,路由解决的是路径到组件的匹配问题。Fes.js 基于 "),e,(0,p.Uk)(" 实现的路由,想了解更多的同学可以看看"),(0,p._)("a",o,[(0,p.Uk)("官方文档"),(0,p.Wm)(a)]),(0,p.Uk)("。")]),r,(0,p._)("p",null,[l,(0,p.Uk)(" 是配置添加到路由的初始路由列表,格式为路由信息的数组。具体使用参考 "),(0,p._)("a",c,[(0,p.Uk)("Vue Router 文档"),(0,p.Wm)(a)]),(0,p.Uk)(" 中关于路由配置、路由匹配相关内容。")]),u,i,(0,p._)("ul",null,[(0,p._)("li",null,[k,(0,p.Uk)(",对应 "),(0,p._)("a",b,[(0,p.Uk)("createWebHistory"),(0,p.Wm)(a)])]),(0,p._)("li",null,[m,(0,p.Uk)(",对应 "),(0,p._)("a",d,[(0,p.Uk)("createWebHashHistory"),(0,p.Wm)(a)])]),(0,p._)("li",null,[g,(0,p.Uk)(",对应 "),(0,p._)("a",h,[(0,p.Uk)("createMemoryHistory"),(0,p.Wm)(a)])])]),y,(0,p._)("p",null,[(0,p.Uk)("Fes.js 下约定文件名为 "),_,(0,p.Uk)(" 的路由是模糊匹配路由,可以用此特性实现 "),(0,p._)("a",v,[(0,p.Uk)("404 路由"),(0,p.Wm)(a)]),(0,p.Uk)("。")]),q,(0,p.Wm)(F,null,{default:(0,p.w5)((()=>[(0,p.Wm)(H,{title:"vue",active:""},{default:(0,p.w5)((()=>[f])),_:1}),(0,p.Wm)(H,{title:"jsx"},{default:(0,p.w5)((()=>[x])),_:1}),(0,p.Wm)(H,{title:"tsx"},{default:(0,p.w5)((()=>[U])),_:1})])),_:1}),j,(0,p._)("p",null,[(0,p.Uk)("想学习更多,可以查看 "),(0,p._)("a",w,[(0,p.Uk)("Vue Router 官方文档"),(0,p.Wm)(a)]),(0,p.Uk)("。")]),E,(0,p._)("p",null,[(0,p.Uk)("页面跳转 API 由 "),R,(0,p.Uk)(" 实例提供,查看 "),(0,p._)("a",W,[(0,p.Uk)("Vue Rouer 文档"),(0,p.Wm)(a)]),(0,p.Uk)("了解更多。")]),B],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-6320961c.a4f16bae.js b/assets/js/v-6320961c.a4f16bae.js deleted file mode 100644 index 5021a16b..00000000 --- a/assets/js/v-6320961c.a4f16bae.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[626],{6254:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-6320961c",path:"/guide/route.html",title:"路由",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"路由配置",slug:"路由配置",children:[{level:3,title:"routes",slug:"routes",children:[]},{level:3,title:"mode",slug:"mode",children:[]}]},{level:2,title:"约定式路由",slug:"约定式路由",children:[{level:3,title:"约定规范",slug:"约定规范",children:[]},{level:3,title:"动态路由",slug:"动态路由",children:[]},{level:3,title:"嵌套路由",slug:"嵌套路由",children:[]},{level:3,title:"模糊匹配",slug:"模糊匹配",children:[]},{level:3,title:"扩展路由元信息",slug:"扩展路由元信息",children:[]},{level:3,title:"智能路由",slug:"智能路由",children:[]}]},{level:2,title:"路由跳转",slug:"路由跳转",children:[{level:3,title:"声明式",slug:"声明式",children:[]},{level:3,title:"命令式",slug:"命令式",children:[]}]}],filePathRelative:"guide/route.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},7570:(n,s,a)=>{a.r(s),a.d(s,{default:()=>an});var p=a(6252);const t=(0,p._)("h1",{id:"路由",tabindex:"-1"},[(0,p._)("a",{class:"header-anchor",href:"#路由","aria-hidden":"true"},"#"),(0,p.Uk)(" 路由")],-1),e=(0,p.Uk)("像 Vue 、React 这类框架是用组件化搭建页面,路由解决的是路径到组件的匹配问题。Fes.js 基于 "),o=(0,p._)("code",null,"Vue Router",-1),r=(0,p.Uk)(" 实现的路由,想了解更多的同学可以看看"),l={href:"https://next.router.vuejs.org/",target:"_blank",rel:"noopener noreferrer"},c=(0,p.Uk)("官方文档"),u=(0,p.Uk)("。"),i=(0,p.uE)('

    路由配置

    在配置文件 .fes.js中通过 router 进行配置。

    export default {\n    router: {\n        routes: [],\n        mode: 'hash'\n    }\n}\n
    1
    2
    3
    4
    5
    6

    routes

    ',4),k=(0,p._)("code",null,"routes",-1),b=(0,p.Uk)(" 是配置添加到路由的初始路由列表,格式为路由信息的数组。具体使用参考 "),m={href:"https://next.router.vuejs.org/zh/guide/",target:"_blank",rel:"noopener noreferrer"},d=(0,p.Uk)("Vue Router 文档"),g=(0,p.Uk)(" 中关于路由配置、路由匹配相关内容。"),h=(0,p._)("h3",{id:"mode",tabindex:"-1"},[(0,p._)("a",{class:"header-anchor",href:"#mode","aria-hidden":"true"},"#"),(0,p.Uk)(" mode")],-1),y=(0,p._)("p",null,"创建历史记录的类型:",-1),_=(0,p._)("strong",null,"history",-1),v=(0,p.Uk)(",对应 "),q={href:"https://next.router.vuejs.org/zh/api/#createwebhistory",target:"_blank",rel:"noopener noreferrer"},f=(0,p.Uk)("createWebHistory"),x=(0,p._)("strong",null,"hash",-1),U=(0,p.Uk)(",对应 "),j={href:"https://next.router.vuejs.org/zh/api/#createWebHashHistory",target:"_blank",rel:"noopener noreferrer"},w=(0,p.Uk)("createWebHashHistory"),E=(0,p._)("strong",null,"memory",-1),R=(0,p.Uk)(",对应 "),W={href:"https://next.router.vuejs.org/zh/api/#createWebHashHistory",target:"_blank",rel:"noopener noreferrer"},B=(0,p.Uk)("createMemoryHistory"),H=(0,p.uE)('

    默认是hash模式。

    约定式路由

    约定式路由也叫文件路由,就是不需要手写配置,文件系统即路由,通过目录和文件及其命名分析出路由配置。

    约定规范

    比如以下文件结构:

    pages\n├── index.vue         # 根路由页面 路径为 /\n├── *.vue             # 模糊匹配 路径为 *\n├── a.vue             # 路径 /a\n├── b                 # 文件夹b\n│   ├── index.vue     # 路径 /b\n│   ├── @id.vue       # 动态路由 /b/:id\n│   ├── c.vue         # 路径 /b/c\n│   └── layout.vue    # /b 路径下所有页面公共的布局组件\n└── layout.vue        # 根路由下所有页面共用的布局组件\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    编译后会得到以下路由配置:

    [\n    {\n        "path": "/",\n        "component": require('@/pages/layout').default,\n        "count": 5,\n        "children": [\n            {\n                "path": "/a",\n                "component": require('@/pages/a').default,\n                "name": "a",\n                "meta": {},\n                "count": 7\n            },\n            {\n                "path": "/b",\n                "component": require('@/pages/b/layout').default,\n                "count": 7,\n                "children": [\n                    {\n                        "path": "/b/c",\n                        "component": require('@/pages/b/c').default,\n                        "name": "b_c",\n                        "meta": {},\n                        "count": 14\n                    },\n                    {\n                        "path": "/b/:id",\n                        "component": require('@/pages/b/@id').default,\n                        "name": "b__id",\n                        "meta": {},\n                        "count": 13\n                    },\n                    {\n                        "path": "/b",\n                        "component": require('@/pages/b/index').default,\n                        "name": "b_index",\n                        "meta": {},\n                        "count": 7\n                    }\n                ]\n            },\n            {\n                "path": "/",\n                "component": require('@/pages/index').default,\n                "name": "index",\n                "meta": {},\n                "count": 5\n            },\n            {\n                "path": "/:pathMatch(.*)",\n                "component": require('@/pages/*').default,\n                "name": "FUZZYMATCH",\n                "meta": {},\n                "count": 3\n            }\n        ]\n    }\n]\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58

    需要注意的是,满足以下任意规则的文件不会被注册为路由

    • 不是 .vue .jsx 文件
    • components 目录中的文件

    动态路由

    Fes.js 里约定以 @ 开头的文件或文件夹映射为动态路由。 比如:

    • src/pages/users/@id.vue 会成为 /users/:id
    • src/pages/users/@id/settings.vue 会成为 /users/:id/settings

    嵌套路由

    Fes.js 里约定目录下有 layout.vue 时会生成嵌套路由,以 layout.vue 为该目录的公共父组件,layout.vue 中必须实现 RouterView

    比如以下目录结构:

    pages\n└── users\n    ├── layout.vue\n    ├── index.vue\n    └── list.vue\n
    1
    2
    3
    4
    5

    会生成路由:

    [\n    { \n        path: '/users', component: require('@/pages/users/layout').default,\n        children: [\n            { path: '/users', component: require('@/pages/users/index').default },\n            { path: '/users/list', component: require('@/pages/users/list').default },\n        ]\n    }\n]\n
    1
    2
    3
    4
    5
    6
    7
    8
    9

    模糊匹配

    ',20),F=(0,p.Uk)("Fes.js 下约定文件名为 "),z=(0,p._)("code",null,"*",-1),D=(0,p.Uk)(" 的路由是模糊匹配路由,可以用此特性实现 "),M={href:"https://next.router.vuejs.org/zh/guide/essentials/dynamic-matching.html#%E6%8D%95%E8%8E%B7%E6%89%80%E6%9C%89%E8%B7%AF%E7%94%B1%E6%88%96-404-not-found-%E8%B7%AF%E7%94%B1",target:"_blank",rel:"noopener noreferrer"},A=(0,p.Uk)("404 路由"),C=(0,p.Uk)("。"),V=(0,p.uE)('

    比如以下目录结构:

    pages\n├── index.vue         # 根路由页面 路径为 /\n└── *.vue             # 模糊匹配 路径为 *\n
    1
    2
    3

    会生成路由:

    [\n    { \n        path: '/', component: require('@/pages/index').default, count: 5\n    },\n    {\n        path: '/:pathMatch(.*)', component: require('@/pages/**').default, count: 3\n    }\n]\n
    1
    2
    3
    4
    5
    6
    7
    8

    这样,如果访问 /foo/ 不能匹配,会 fallback 到 * 路由,通过 src/pages/*.vue 进行渲染。

    扩展路由元信息

    我们在定义路由时可以配置meta字段,用来记录一些跟路由相关的信息:

    const router = new VueRouter({\n  routes: [\n    {\n      path: '/foo',\n      component: Foo,\n      children: [\n        {\n          path: 'bar',\n          component: Bar,\n          // a meta field\n          meta: { requiresAuth: true }\n        }\n      ]\n    }\n  ]\n})\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    接下来我们来配置 meta

    ',9),Z=(0,p._)("div",{class:"language-vue ext-vue line-numbers-mode"},[(0,p._)("pre",{class:"language-vue"},[(0,p._)("code",null,[(0,p._)("span",{class:"token tag"},[(0,p._)("span",{class:"token tag"},[(0,p._)("span",{class:"token punctuation"},"<"),(0,p.Uk)("config")]),(0,p._)("span",{class:"token punctuation"},">")]),(0,p.Uk)('\n{\n "name": "store",\n "title": "vuex测试"\n}\n'),(0,p._)("span",{class:"token tag"},[(0,p._)("span",{class:"token tag"},[(0,p._)("span",{class:"token punctuation"},"")]),(0,p.Uk)("\n")])]),(0,p._)("div",{class:"line-numbers"},[(0,p._)("span",{class:"line-number"},"1"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"2"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"3"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"4"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"5"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"6"),(0,p._)("br")])],-1),I=(0,p._)("div",{class:"language-jsx ext-jsx line-numbers-mode"},[(0,p._)("pre",{class:"language-jsx"},[(0,p._)("code",null,[(0,p._)("span",{class:"token keyword"},"import"),(0,p.Uk)(),(0,p._)("span",{class:"token punctuation"},"{"),(0,p.Uk)(" defineRouteMeta"),(0,p._)("span",{class:"token punctuation"},","),(0,p.Uk)(" useRoute "),(0,p._)("span",{class:"token punctuation"},"}"),(0,p.Uk)(),(0,p._)("span",{class:"token keyword"},"from"),(0,p.Uk)(),(0,p._)("span",{class:"token string"},"'@fesjs/fes'"),(0,p._)("span",{class:"token punctuation"},";"),(0,p.Uk)("\n"),(0,p._)("span",{class:"token function"},"defineRouteMeta"),(0,p._)("span",{class:"token punctuation"},"("),(0,p._)("span",{class:"token punctuation"},"{"),(0,p.Uk)("\n "),(0,p._)("span",{class:"token literal-property property"},"name"),(0,p._)("span",{class:"token operator"},":"),(0,p.Uk)(),(0,p._)("span",{class:"token string"},'"store"'),(0,p._)("span",{class:"token punctuation"},","),(0,p.Uk)("\n "),(0,p._)("span",{class:"token literal-property property"},"title"),(0,p._)("span",{class:"token operator"},":"),(0,p.Uk)(),(0,p._)("span",{class:"token string"},'"vuex测试"'),(0,p.Uk)("\n"),(0,p._)("span",{class:"token punctuation"},"}"),(0,p._)("span",{class:"token punctuation"},")"),(0,p.Uk)("\n")])]),(0,p._)("div",{class:"line-numbers"},[(0,p._)("span",{class:"line-number"},"1"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"2"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"3"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"4"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"5"),(0,p._)("br")])],-1),G=(0,p._)("div",{class:"language-tsx ext-tsx line-numbers-mode"},[(0,p._)("pre",{class:"language-tsx"},[(0,p._)("code",null,[(0,p._)("span",{class:"token keyword"},"import"),(0,p.Uk)(),(0,p._)("span",{class:"token punctuation"},"{"),(0,p.Uk)(" defineRouteMeta"),(0,p._)("span",{class:"token punctuation"},","),(0,p.Uk)(" useRoute "),(0,p._)("span",{class:"token punctuation"},"}"),(0,p.Uk)(),(0,p._)("span",{class:"token keyword"},"from"),(0,p.Uk)(),(0,p._)("span",{class:"token string"},"'@fesjs/fes'"),(0,p._)("span",{class:"token punctuation"},";"),(0,p.Uk)("\n"),(0,p._)("span",{class:"token function"},"defineRouteMeta"),(0,p._)("span",{class:"token punctuation"},"("),(0,p._)("span",{class:"token punctuation"},"{"),(0,p.Uk)("\n name"),(0,p._)("span",{class:"token operator"},":"),(0,p.Uk)(),(0,p._)("span",{class:"token string"},'"store"'),(0,p._)("span",{class:"token punctuation"},","),(0,p.Uk)("\n title"),(0,p._)("span",{class:"token operator"},":"),(0,p.Uk)(),(0,p._)("span",{class:"token string"},'"vuex测试"'),(0,p.Uk)("\n"),(0,p._)("span",{class:"token punctuation"},"}"),(0,p._)("span",{class:"token punctuation"},")"),(0,p.Uk)("\n")])]),(0,p._)("div",{class:"line-numbers"},[(0,p._)("span",{class:"line-number"},"1"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"2"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"3"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"4"),(0,p._)("br"),(0,p._)("span",{class:"line-number"},"5"),(0,p._)("br")])],-1),L=(0,p.uE)('

    则编译后的路由配置为:

    [\n    { \n        path: '/a', \n        component: require('@/pages/a').default, \n        meta: {\n            "name": "store",\n            "title": "vuex测试"\n        }\n    },\n]\n




     
     
     
     


    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    智能路由

    可以看到,编译后路由都会有 count 属性,这是我们根据精准匹配优先算法原则设计出路由排名算法,对匹配到的路由打分:

    • 路由的路径每个子项得到4分
    • 子项为静态细分(/list)再加3分
    • 子项为动态细分(/:orderId)再加2分
    • 根段(/)再1分
    • 通配符(*)匹配到的减去1分

    当我们跳转路由时,如果 URL 匹配到多个路由,则选择分数最高的路由。

    路由跳转

    ',7),O=(0,p.Uk)("想学习更多,可以查看 "),P={href:"https://next.router.vuejs.org/zh/guide/essentials/navigation.html#%E6%9B%BF%E6%8D%A2%E5%BD%93%E5%89%8D%E4%BD%8D%E7%BD%AE",target:"_blank",rel:"noopener noreferrer"},T=(0,p.Uk)("Vue Router 官方文档"),Y=(0,p.Uk)("。"),N=(0,p.uE)('

    声明式

    <template>\n    <router-link to="/home">Home</router-link>\n</template>\n
    1
    2
    3

    命令式

    ',3),J=(0,p.Uk)("页面跳转 API 由 "),K=(0,p._)("code",null,"router",-1),Q=(0,p.Uk)(" 实例提供,查看 "),S={href:"https://next.router.vuejs.org/zh/api/#router-%E6%96%B9%E6%B3%95",target:"_blank",rel:"noopener noreferrer"},X=(0,p.Uk)("Vue Rouer 文档"),$=(0,p.Uk)("了解更多。"),nn=(0,p.uE)('
    import { useRouter } from '@fesjs/fes';\n\nexport default {\n    setup(){\n        const router = useRouter();\n        // 这三种形式是等价的\n        router.push('/users/posva#bio')\n        router.push({ path: '/users/posva', hash: '#bio' })\n        router.push({ name: 'users', params: { username: 'posva' }, hash: '#bio' })\n        // 只改变 hash\n        router.push({ hash: '#bio' })\n        // 只改变 query\n        router.push({ query: { page: '2' } })\n        // 只改变 param\n        router.push({ params: { username: 'jolyne' } })\n\n        // 跳转到上一个路由\n        router.goBack();\n\n        // \b跳转到前一个历史记录\n        router.go(1);\n\n        // 替换历史堆栈中的记录\n        router.replace('/new');\n    }\n}\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    ',1),sn={},an=(0,a(3744).Z)(sn,[["render",function(n,s){const a=(0,p.up)("OutboundLink"),sn=(0,p.up)("CodeGroupItem"),an=(0,p.up)("CodeGroup");return(0,p.wg)(),(0,p.iD)(p.HY,null,[t,(0,p._)("p",null,[e,o,r,(0,p._)("a",l,[c,(0,p.Wm)(a)]),u]),i,(0,p._)("p",null,[k,b,(0,p._)("a",m,[d,(0,p.Wm)(a)]),g]),h,y,(0,p._)("ul",null,[(0,p._)("li",null,[_,v,(0,p._)("a",q,[f,(0,p.Wm)(a)])]),(0,p._)("li",null,[x,U,(0,p._)("a",j,[w,(0,p.Wm)(a)])]),(0,p._)("li",null,[E,R,(0,p._)("a",W,[B,(0,p.Wm)(a)])])]),H,(0,p._)("p",null,[F,z,D,(0,p._)("a",M,[A,(0,p.Wm)(a)]),C]),V,(0,p.Wm)(an,null,{default:(0,p.w5)((()=>[(0,p.Wm)(sn,{title:"vue",active:""},{default:(0,p.w5)((()=>[Z])),_:1}),(0,p.Wm)(sn,{title:"jsx"},{default:(0,p.w5)((()=>[I])),_:1}),(0,p.Wm)(sn,{title:"tsx"},{default:(0,p.w5)((()=>[G])),_:1})])),_:1}),L,(0,p._)("p",null,[O,(0,p._)("a",P,[T,(0,p.Wm)(a)]),Y]),N,(0,p._)("p",null,[J,K,Q,(0,p._)("a",S,[X,(0,p.Wm)(a)]),$]),nn],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-6f2f6a5a.0a028df5.js b/assets/js/v-6f2f6a5a.0a028df5.js new file mode 100644 index 00000000..09abb3f6 --- /dev/null +++ b/assets/js/v-6f2f6a5a.0a028df5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[658],{9465:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-6f2f6a5a",path:"/reference/plugin/plugins/pinia.html",title:"@fesjs/plugin-pinia",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"API",slug:"api",children:[{level:3,title:"pinia",slug:"pinia",children:[]}]},{level:2,title:"使用",slug:"使用",children:[{level:3,title:"定义 store",slug:"定义-store",children:[]},{level:3,title:"setup",slug:"setup",children:[]},{level:3,title:"非setup",slug:"非setup",children:[]}]}],filePathRelative:"reference/plugin/plugins/pinia.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},1437:(n,s,a)=>{a.r(s),a.d(s,{default:()=>r});var e=a(6252);const p=(0,e._)("h1",{id:"fesjs-plugin-pinia",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#fesjs-plugin-pinia","aria-hidden":"true"},"#"),(0,e.Uk)(" @fesjs/plugin-pinia")],-1),t=(0,e._)("h2",{id:"介绍",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),(0,e.Uk)(" 介绍")],-1),o={href:"https://pinia.vuejs.org/",target:"_blank",rel:"noopener noreferrer"},c=(0,e.uE)('

    为了防止 Fes.jspinia 提供的 API 冲突,Fes.js不提供任何 pinia 的API,相关API直接从 pinia 导出:

    import { defineStore } from 'pinia';\n
    1

    约定 plugin 定义放在 stores 目录下,文件名包含plugin被解析为插件,无需额外配置,定义即可用。

    └── src\n    ├── pages\n    │    └── index.vue\n    └── stores \n    │    ├── plugin-logger.js       \n    │    ├── user.js\n    └── app.js\n
    1
    2
    3
    4
    5
    6
    7

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-pinia": "^2.0.0",\n        "pinia": "^2.0.11"\n    }\n}\n
    1
    2
    3
    4
    5
    6
    7

    API

    pinia

    createPinia执行后创建的实例。

    import { pinia } from '@fesjs/fes'\n
    1

    使用

    定义 store

    我们在 src/store/main.js中:

    import { defineStore } from 'pinia'\n\n// useStore could be anything like useUser, useCart\n// the first argument is a unique id of the store across your application\nexport const useStore = defineStore('main', {\n  // other options...\n})\n
    1
    2
    3
    4
    5
    6
    7

    setup

    import { useStore } from '@/store/main'\nexport default {\n    setup(){\n        const store = useStore()\n    }\n}\n
    1
    2
    3
    4
    5
    6

    非setup

    比如在app.js中:

    import { pinia } from '@fesjs/fes'\n\nexport const beforeRender = {\n    loading: <PageLoading />,\n    action() {\n        const { setRole } = accessApi;\n        return new Promise((resolve) => {\n            setTimeout(() => {\n                const store = useStore(pinia);\n                store.$patch({\n                    userName: '李雷',\n                    role: 'admin'\n                });\n                setRole('admin');\n            }, 1000);\n        });\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    ',20),l={},r=(0,a(3744).Z)(l,[["render",function(n,s){const a=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,t,(0,e._)("p",null,[(0,e.Uk)("集成 "),(0,e._)("a",o,[(0,e.Uk)("pinia"),(0,e.Wm)(a)]),(0,e.Uk)(" ,提供状态管理的能力,封装一些胶水代码,可以直接定义store 使用。")]),c],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-6f2f6a5a.e8179be8.js b/assets/js/v-6f2f6a5a.e8179be8.js deleted file mode 100644 index b3468f85..00000000 --- a/assets/js/v-6f2f6a5a.e8179be8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[658],{9465:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-6f2f6a5a",path:"/reference/plugin/plugins/pinia.html",title:"@fesjs/plugin-pinia",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"API",slug:"api",children:[{level:3,title:"pinia",slug:"pinia",children:[]}]},{level:2,title:"使用",slug:"使用",children:[{level:3,title:"定义 store",slug:"定义-store",children:[]},{level:3,title:"setup",slug:"setup",children:[]},{level:3,title:"非setup",slug:"非setup",children:[]}]}],filePathRelative:"reference/plugin/plugins/pinia.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},1437:(n,s,a)=>{a.r(s),a.d(s,{default:()=>k});var e=a(6252);const p=(0,e._)("h1",{id:"fesjs-plugin-pinia",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#fesjs-plugin-pinia","aria-hidden":"true"},"#"),(0,e.Uk)(" @fesjs/plugin-pinia")],-1),t=(0,e._)("h2",{id:"介绍",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),(0,e.Uk)(" 介绍")],-1),o=(0,e.Uk)("集成 "),c={href:"https://pinia.vuejs.org/",target:"_blank",rel:"noopener noreferrer"},l=(0,e.Uk)("pinia"),r=(0,e.Uk)(" ,提供状态管理的能力,封装一些胶水代码,可以直接定义store 使用。"),i=(0,e.uE)('

    为了防止 Fes.jspinia 提供的 API 冲突,Fes.js不提供任何 pinia 的API,相关API直接从 pinia 导出:

    import { defineStore } from 'pinia';\n
    1

    约定 plugin 定义放在 stores 目录下,文件名包含plugin被解析为插件,无需额外配置,定义即可用。

    └── src\n    ├── pages\n    │    └── index.vue\n    └── stores \n    │    ├── plugin-logger.js       \n    │    ├── user.js\n    └── app.js\n
    1
    2
    3
    4
    5
    6
    7

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-pinia": "^2.0.0",\n        "pinia": "^2.0.11"\n    }\n}\n
    1
    2
    3
    4
    5
    6
    7

    API

    pinia

    createPinia执行后创建的实例。

    import { pinia } from '@fesjs/fes'\n
    1

    使用

    定义 store

    我们在 src/store/main.js中:

    import { defineStore } from 'pinia'\n\n// useStore could be anything like useUser, useCart\n// the first argument is a unique id of the store across your application\nexport const useStore = defineStore('main', {\n  // other options...\n})\n
    1
    2
    3
    4
    5
    6
    7

    setup

    import { useStore } from '@/store/main'\nexport default {\n    setup(){\n        const store = useStore()\n    }\n}\n
    1
    2
    3
    4
    5
    6

    非setup

    比如在app.js中:

    import { pinia } from '@fesjs/fes'\n\nexport const beforeRender = {\n    loading: <PageLoading />,\n    action() {\n        const { setRole } = accessApi;\n        return new Promise((resolve) => {\n            setTimeout(() => {\n                const store = useStore(pinia);\n                store.$patch({\n                    userName: '李雷',\n                    role: 'admin'\n                });\n                setRole('admin');\n            }, 1000);\n        });\n    }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    ',20),u={},k=(0,a(3744).Z)(u,[["render",function(n,s){const a=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,t,(0,e._)("p",null,[o,(0,e._)("a",c,[l,(0,e.Wm)(a)]),r]),i],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-76cb52e8.50562b67.js b/assets/js/v-76cb52e8.0f619206.js similarity index 99% rename from assets/js/v-76cb52e8.50562b67.js rename to assets/js/v-76cb52e8.0f619206.js index 4a0410ad..51edde86 100644 --- a/assets/js/v-76cb52e8.50562b67.js +++ b/assets/js/v-76cb52e8.0f619206.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[872],{7937:(e,n,s)=>{s.r(n),s.d(n,{data:()=>a});const a={key:"v-76cb52e8",path:"/reference/cli/",title:"命令行工具",lang:"zh-CN",frontmatter:{sidebar:"auto"},excerpt:"",headers:[{level:2,title:"create-fes-app",slug:"create-fes-app",children:[]},{level:2,title:"fes",slug:"fes",children:[{level:3,title:"fes dev",slug:"fes-dev",children:[]},{level:3,title:"fes build",slug:"fes-build",children:[]},{level:3,title:"fes help",slug:"fes-help",children:[]},{level:3,title:"fes info",slug:"fes-info",children:[]},{level:3,title:"fes webpack",slug:"fes-webpack",children:[]}]}],filePathRelative:"reference/cli/README.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},6761:(e,n,s)=>{s.r(n),s.d(n,{default:()=>d});var a=s(6252);const l=(0,a.uE)('

    命令行工具

    create-fes-app

    通过 create-fes-app 命令创建项目模板,输入create-fes-app -h则可以看到如下信息:

    Usage: create-fes-app <name>\n\nOptions:\n    -v, --version            Output the current version\n    -h, --help               Display help for command   \n    -f, --force              Overwrite target directory if it exists\n    -m, --merge              Merge target directory if it exists\n
    1
    2
    3
    4
    5
    6
    7

    可以在本机安装后使用:

    ',5),r=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 全局安装"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" global "),(0,a._)("span",{class:"token function"},"add"),(0,a.Uk)(" @fesjs/create-fes-app\n\n"),(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\ncreate-fes-app fes-app\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br")])],-1),p=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 全局安装"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" i "),(0,a._)("span",{class:"token parameter variable"},"-g"),(0,a.Uk)(" @fesjs/create-fes-app\n\n"),(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\ncreate-fes-app fes-app\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br")])],-1),i=(0,a._)("p",null,[(0,a.Uk)("推荐使用 "),(0,a._)("code",null,"yarn create"),(0,a.Uk)(" 和 "),(0,a._)("code",null,"npx"),(0,a.Uk)(" 方式创建模板,一直使用最新的模板:")],-1),c=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" create @fesjs/fes-app myapp\n\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" \n\n"),(0,a._)("span",{class:"token comment"},"# 运行"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" dev\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br")])],-1),t=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\nnpx @fesjs/create-fes-app myapp\n\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(),(0,a._)("span",{class:"token function"},"install"),(0,a.Uk)(" \n\n"),(0,a._)("span",{class:"token comment"},"# 运行"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" run dev\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br")])],-1),b=(0,a.uE)('

    fes

    需要在项目根目录执行 fes 命令,输入fes -h则可以看到如下信息:

    Usage: fes <command> [options]\n\n一个好用的前端应用解决方案\n\nOptions:\n  -v, --vers         output the current version\n  -h, --help         display help for command\n\nCommands:\n  build              build application for production\n  dev [options]      start a local http service for development\n  help               show command helps\n  info               print debugging information about your environment\n  webpack [options]  inspect webpack configurations\n\n  Run fes <command> --help for detailed usage of given command.\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    fes dev

    启动本地开发服务器进行项目的开发调试。

    Usage: fes dev [options]\n\nstart a local http service for development\n\nOptions:\n  --port      http service port, like 8080\n  --https     whether to turn on the https service\n  -h, --help  display help for command\n
    1
    2
    3
    4
    5
    6
    7
    8

    比如:

    fes dev --port=8080\n
    1

    fes build

    编译构建 web 产物。

    Usage: fes build [options]\n\nbuild application for production\n\nOptions:\n  -h, --help  display help for command\n
    1
    2
    3
    4
    5
    6

    比如:

    fes build\n
    1

    fes help

    打印帮助文档。 比如:

    fes help\n
    1

    fes info

    打印当前项目的有用的环境信息,用来帮助定位问题。

    Usage: fes info [options]\n\nprint debugging information about your environment\n\nOptions:\n  -h, --help  display help for command\n
    1
    2
    3
    4
    5
    6

    比如:

    fes info\n
    1

    fes webpack

    查看项目使用的 webpack 配置。

    Usage: fes webpack [options]\n\ninspect webpack configurations\n\nOptions:\n  --rule <ruleName>      inspect a specific module rule\n  --plugin <pluginName>  inspect a specific plugin\n  --rules                list all module rule names\n  --plugins              list all plugin names\n  --verbose              show full function definitions in output\n  -h, --help             display help for command\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    比如:

    fes webpack\n
    1
    ',26),u={},d=(0,s(3744).Z)(u,[["render",function(e,n){const s=(0,a.up)("CodeGroupItem"),u=(0,a.up)("CodeGroup");return(0,a.wg)(),(0,a.iD)(a.HY,null,[l,(0,a.Wm)(u,null,{default:(0,a.w5)((()=>[(0,a.Wm)(s,{title:"YARN",active:""},{default:(0,a.w5)((()=>[r])),_:1}),(0,a.Wm)(s,{title:"NPM"},{default:(0,a.w5)((()=>[p])),_:1})])),_:1}),i,(0,a.Wm)(u,null,{default:(0,a.w5)((()=>[(0,a.Wm)(s,{title:"YARN",active:""},{default:(0,a.w5)((()=>[c])),_:1}),(0,a.Wm)(s,{title:"NPM"},{default:(0,a.w5)((()=>[t])),_:1})])),_:1}),b],64)}]])},3744:(e,n)=>{n.Z=(e,n)=>{const s=e.__vccOpts||e;for(const[e,a]of n)s[e]=a;return s}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[872],{7937:(e,n,s)=>{s.r(n),s.d(n,{data:()=>a});const a={key:"v-76cb52e8",path:"/reference/cli/",title:"命令行工具",lang:"zh-CN",frontmatter:{sidebar:"auto"},excerpt:"",headers:[{level:2,title:"create-fes-app",slug:"create-fes-app",children:[]},{level:2,title:"fes",slug:"fes",children:[{level:3,title:"fes dev",slug:"fes-dev",children:[]},{level:3,title:"fes build",slug:"fes-build",children:[]},{level:3,title:"fes help",slug:"fes-help",children:[]},{level:3,title:"fes info",slug:"fes-info",children:[]},{level:3,title:"fes webpack",slug:"fes-webpack",children:[]}]}],filePathRelative:"reference/cli/README.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},6761:(e,n,s)=>{s.r(n),s.d(n,{default:()=>d});var a=s(6252);const l=(0,a.uE)('

    命令行工具

    create-fes-app

    通过 create-fes-app 命令创建项目模板,输入create-fes-app -h则可以看到如下信息:

    Usage: create-fes-app <name>\n\nOptions:\n    -v, --version            Output the current version\n    -h, --help               Display help for command   \n    -f, --force              Overwrite target directory if it exists\n    -m, --merge              Merge target directory if it exists\n
    1
    2
    3
    4
    5
    6
    7

    可以在本机安装后使用:

    ',5),r=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 全局安装"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" global "),(0,a._)("span",{class:"token function"},"add"),(0,a.Uk)(" @fesjs/create-fes-app\n\n"),(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\ncreate-fes-app fes-app\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br")])],-1),p=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 全局安装"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" i "),(0,a._)("span",{class:"token parameter variable"},"-g"),(0,a.Uk)(" @fesjs/create-fes-app\n\n"),(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\ncreate-fes-app fes-app\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br")])],-1),i=(0,a._)("p",null,[(0,a.Uk)("推荐使用 "),(0,a._)("code",null,"yarn create"),(0,a.Uk)(" 和 "),(0,a._)("code",null,"npx"),(0,a.Uk)(" 方式创建模板,一直使用最新的模板:")],-1),c=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" create @fesjs/fes-app myapp\n\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" \n\n"),(0,a._)("span",{class:"token comment"},"# 运行"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" dev\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br")])],-1),t=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\nnpx @fesjs/create-fes-app myapp\n\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(),(0,a._)("span",{class:"token function"},"install"),(0,a.Uk)(" \n\n"),(0,a._)("span",{class:"token comment"},"# 运行"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" run dev\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br")])],-1),b=(0,a.uE)('

    fes

    需要在项目根目录执行 fes 命令,输入fes -h则可以看到如下信息:

    Usage: fes <command> [options]\n\n一个好用的前端应用解决方案\n\nOptions:\n  -v, --vers         output the current version\n  -h, --help         display help for command\n\nCommands:\n  build              build application for production\n  dev [options]      start a local http service for development\n  help               show command helps\n  info               print debugging information about your environment\n  webpack [options]  inspect webpack configurations\n\n  Run fes <command> --help for detailed usage of given command.\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    fes dev

    启动本地开发服务器进行项目的开发调试。

    Usage: fes dev [options]\n\nstart a local http service for development\n\nOptions:\n  --port      http service port, like 8080\n  --https     whether to turn on the https service\n  -h, --help  display help for command\n
    1
    2
    3
    4
    5
    6
    7
    8

    比如:

    fes dev --port=8080\n
    1

    fes build

    编译构建 web 产物。

    Usage: fes build [options]\n\nbuild application for production\n\nOptions:\n  -h, --help  display help for command\n
    1
    2
    3
    4
    5
    6

    比如:

    fes build\n
    1

    fes help

    打印帮助文档。 比如:

    fes help\n
    1

    fes info

    打印当前项目的有用的环境信息,用来帮助定位问题。

    Usage: fes info [options]\n\nprint debugging information about your environment\n\nOptions:\n  -h, --help  display help for command\n
    1
    2
    3
    4
    5
    6

    比如:

    fes info\n
    1

    fes webpack

    查看项目使用的 webpack 配置。

    Usage: fes webpack [options]\n\ninspect webpack configurations\n\nOptions:\n  --rule <ruleName>      inspect a specific module rule\n  --plugin <pluginName>  inspect a specific plugin\n  --rules                list all module rule names\n  --plugins              list all plugin names\n  --verbose              show full function definitions in output\n  -h, --help             display help for command\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    比如:

    fes webpack\n
    1
    ',26),u={},d=(0,s(3744).Z)(u,[["render",function(e,n){const s=(0,a.up)("CodeGroupItem"),u=(0,a.up)("CodeGroup");return(0,a.wg)(),(0,a.iD)(a.HY,null,[l,(0,a.Wm)(u,null,{default:(0,a.w5)((()=>[(0,a.Wm)(s,{title:"YARN",active:""},{default:(0,a.w5)((()=>[r])),_:1}),(0,a.Wm)(s,{title:"NPM"},{default:(0,a.w5)((()=>[p])),_:1})])),_:1}),i,(0,a.Wm)(u,null,{default:(0,a.w5)((()=>[(0,a.Wm)(s,{title:"YARN",active:""},{default:(0,a.w5)((()=>[c])),_:1}),(0,a.Wm)(s,{title:"NPM"},{default:(0,a.w5)((()=>[t])),_:1})])),_:1}),b],64)}]])},3744:(e,n)=>{n.Z=(e,n)=>{const s=e.__vccOpts||e;for(const[e,a]of n)s[e]=a;return s}}}]); \ No newline at end of file diff --git a/assets/js/v-76cd065c.270a37ed.js b/assets/js/v-76cd065c.270a37ed.js new file mode 100644 index 00000000..dae21a9c --- /dev/null +++ b/assets/js/v-76cd065c.270a37ed.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[476],{436:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-76cd065c",path:"/reference/api/",title:"API",lang:"zh-CN",frontmatter:{sidebar:"auto"},excerpt:"",headers:[{level:2,title:"基础API",slug:"基础api",children:[{level:3,title:"plugin",slug:"plugin",children:[]},{level:3,title:"ApplyPluginsType",slug:"applypluginstype",children:[]}]},{level:2,title:"路由API",slug:"路由api",children:[{level:3,title:"getRouter",slug:"getrouter",children:[]},{level:3,title:"useRoute",slug:"useroute",children:[]},{level:3,title:"useRouter",slug:"userouter",children:[]},{level:3,title:"onBeforeRouteUpdate",slug:"onbeforerouteupdate",children:[]},{level:3,title:"onBeforeRouteLeave",slug:"onbeforerouteleave",children:[]},{level:3,title:"createWebHashHistory",slug:"createwebhashhistory",children:[]},{level:3,title:"createWebHistory",slug:"createwebhistory",children:[]},{level:3,title:"createMemoryHistory",slug:"creatememoryhistory",children:[]},{level:3,title:"createRouter",slug:"createrouter",children:[]},{level:3,title:"RouterLink",slug:"routerlink",children:[]},{level:3,title:"useLink",slug:"uselink",children:[]},{level:3,title:"RouterView",slug:"routerview",children:[]},{level:3,title:"Router Methods",slug:"router-methods",children:[]}]}],filePathRelative:"reference/api/README.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5930:(n,s,a)=>{a.r(s),a.d(s,{default:()=>f});var e=a(6252);const p=(0,e.uE)('

    API

    Fes.js 统一了API的出口,所有运行时API(包含Fes.js内置API和插件提供的API)全部通过@fesjs/fes导出。

    import { someApi  } from "@fesjs/fes"\n
    1

    基础API

    plugin

    提示

    主要在插件里面使用,项目代码中一般用不到。

    运行时插件接口,是 Fes.js 内置的跑在浏览器里的一套插件体系。

    import { plugin, ApplyPluginsType } from '@fesjs/fes';\n\n// 注册插件\nplugin.register({\n  apply: { dva: { foo: 1 } },\n  path: 'foo',\n});\nplugin.register({\n  apply: { dva: { bar: 1 } },\n  path: 'bar',\n});\n\n// 执行插件\n// 得到 { foo: 1, bar: 1 }\nplugin.applyPlugins({\n  key: 'dva',\n  type: ApplyPluginsType.modify,\n  initialValue: {},\n  args: {},\n  async: false,\n});\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    plugin.register 参数包含:

    • apply 插件文件导出的内容
    • path 插件文件路径

    plugin.applyPlugins 参数包含:

    • key,坑位的 key
    • type,执行方式类型,详见 ApplyPluginsType
    • initialValue,初始值
    • args,参数
    • async,是否异步执行且返回 Promise

    ApplyPluginsType

    提示

    主要在插件里面使用,项目代码中一般用不到。

    运行时插件执行类型,enum 类型,包含三个属性:

    • compose,用于合并执行多个函数,函数可决定前序函数的执行时机
    • modify,用于修改值
    • event,用于执行事件,前面没有依赖关系

    路由API

    ',17),t={href:"https://next.router.vuejs.org/introduction.html",target:"_blank",rel:"noopener noreferrer"},o=(0,e.uE)('

    getRouter

    返回当前 router 实例。

    import { getRouter } from "@fesjs/fes";\nconst router = getRouter();\nrouter.push();\n
    1
    2
    3

    useRoute

    返回当前 route 实例,相当于在模板内使用 $route。必须在 setup 函数内调用。

    import { useRoute } from "@fesjs/fes";\nexport default {\n    setup(){\n        const route = useRoute()\n    }\n}\n
    1
    2
    3
    4
    5
    6

    useRouter

    返回 router 实例,相当于在模板语法中使用 $router。必须在 setup 函数内调用。

    import { useRouter } from "@fesjs/fes";\nexport default {\n    setup(){\n        const router = useRouter()\n    }\n}\n
    1
    2
    3
    4
    5
    6

    onBeforeRouteUpdate

    添加导航守卫,在当前路由即将更新时触发。类似于之前的beforeRouteUpdate,但是可用于任何组件。卸载组件时,将移除守卫。

    import { onBeforeRouteUpdate } from "@fesjs/fes";\nexport default {\n    setup(){\n        onBeforeRouteUpdate((to, from, next)=>{\n        })\n    }\n}\n
    1
    2
    3
    4
    5
    6
    7

    onBeforeRouteLeave

    添加导航守卫,在当前路由即将离开时触发。类似于之前的beforeRouteLeave,但可用于任何组件。卸载组件时,将移除守卫。

    import { onBeforeRouteLeave } from "@fesjs/fes";\nexport default {\n    setup(){\n        onBeforeRouteLeave((to, from, next)=>{\n        })\n    }\n}\n
    1
    2
    3
    4
    5
    6
    7

    createWebHashHistory

    提示

    在开发插件时可能用上,平时一般用不上

    创建一个 hash 历史记录。对于没有主机的 web 应用程序 (例如 file://),或当配置服务器不能处理任意URL时这非常有用。注意:如果 SEO 对你很重要,你应该使用 createWebHistory

    createWebHistory

    提示

    在开发插件时可能用上,平时一般用不上

    创建HTML5历史记录。单页应用程序最常见的历史记录。必须通过 http 服务打开页面地址 。

    createMemoryHistory

    提示

    在开发插件时可能用上,平时一般用不上

    创建一个基于内存的历史记录。这个历史记录的主要目的是处理 SSR。它在一个特殊的位置开始,这个位置无处不在。如果用户不在浏览器上下文中,它们可以通过调用 router.push() 或 router.replace() 将该位置替换为启动位置。

    createRouter

    ',25),r={href:"https://next.router.vuejs.org/api/#routeroptions",target:"_blank",rel:"noopener noreferrer"},l=(0,e.uE)('

    使用自定义组件路由器链接来创建链接,而不是使用常规标签。这使得 Vue 路由器无需重新加载页面即可更改 URL、处理 URL 生成及其编码。

    <router-link to="/about">Go to About</router-link>\n
    1
    ',3),c={href:"https://next.router.vuejs.org/api/#router-link-props",target:"_blank",rel:"noopener noreferrer"},u={href:"https://next.router.vuejs.org/api/#router-link-s-v-slot",target:"_blank",rel:"noopener noreferrer"},i=(0,e._)("h3",{id:"uselink",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#uselink","aria-hidden":"true"},"#"),(0,e.Uk)(" useLink")],-1),k={href:"https://next.router.vuejs.org/api/#router-link-s-v-slot",target:"_blank",rel:"noopener noreferrer"},d=(0,e.uE)('
    import { RouterLink, useLink } from '@fesjs/fes'\n\nexport default {\n  name: 'AppLink',\n\n  props: {\n    // add @ts-ignore if using TypeScript\n    ...RouterLink.props,\n    inactiveClass: String,\n  },\n\n  setup(props) {\n    // `props` contains `to` and any other prop that can be passed to <router-link>\n    const { navigate, href, route, isActive, isExactActive } = useLink(props)\n\n    // profit!\n\n    return { isExternalLink }\n  },\n}\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

    RouterView

    router-view 将显示当前 URL 的对应的路由组件。你可以把它放在任何地方,以适应你的布局。

    <router-view></router-view>\n<router-view v-slot="{ Component, route }">\n  <component :is="Component" />\n</router-view>\n
    1
    2
    3
    4
    ',4),b={href:"https://next.router.vuejs.org/api/#router-view-props",target:"_blank",rel:"noopener noreferrer"},h={href:"https://next.router.vuejs.org/api/#router-view-s-v-slot",target:"_blank",rel:"noopener noreferrer"},m=(0,e._)("h3",{id:"router-methods",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#router-methods","aria-hidden":"true"},"#"),(0,e.Uk)(" Router Methods")],-1),g={href:"https://next.router.vuejs.org/api/#router-methods",target:"_blank",rel:"noopener noreferrer"},v={},f=(0,a(3744).Z)(v,[["render",function(n,s){const a=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,(0,e._)("p",null,[(0,e.Uk)("Fes.js 路由基于 "),(0,e._)("a",t,[(0,e.Uk)("Vue Router 4.0"),(0,e.Wm)(a)]),(0,e.Uk)(",想了解更多的同学可以看看官方文档。")]),o,(0,e._)("p",null,[(0,e.Uk)("创建一个路由器实例,该实例可用于 Vue 应用程序。查看"),(0,e._)("a",r,[(0,e.Uk)("路由器选项"),(0,e.Wm)(a)]),(0,e.Uk)(",了解可以传递的所有属性的列表。")]),l,(0,e._)("p",null,[(0,e.Uk)("可以查看"),(0,e._)("a",c,[(0,e.Uk)("官方文档"),(0,e.Wm)(a)]),(0,e.Uk)("了解更多 RouterLink 的 Porps。查看"),(0,e._)("a",u,[(0,e.Uk)("官方文档"),(0,e.Wm)(a)]),(0,e.Uk)("了解 RouterLink 的作用域插槽。")]),i,(0,e._)("p",null,[(0,e.Uk)("返回的结果跟 RouterLink 的作用域插槽的属性一致,查看"),(0,e._)("a",k,[(0,e.Uk)("官方API"),(0,e.Wm)(a)]),(0,e.Uk)("了解更多。")]),d,(0,e._)("p",null,[(0,e.Uk)("可以查看"),(0,e._)("a",b,[(0,e.Uk)("官方文档"),(0,e.Wm)(a)]),(0,e.Uk)("了解更多 RouterView 的 Porps。查看"),(0,e._)("a",h,[(0,e.Uk)("官方文档"),(0,e.Wm)(a)]),(0,e.Uk)("了解 RouterView 的作用域插槽。")]),m,(0,e._)("p",null,[(0,e.Uk)("查看"),(0,e._)("a",g,[(0,e.Uk)("官方文档"),(0,e.Wm)(a)]),(0,e.Uk)("了解更多")])],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-76cd065c.fabc8531.js b/assets/js/v-76cd065c.fabc8531.js deleted file mode 100644 index 8bde12f8..00000000 --- a/assets/js/v-76cd065c.fabc8531.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[476],{436:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-76cd065c",path:"/reference/api/",title:"API",lang:"zh-CN",frontmatter:{sidebar:"auto"},excerpt:"",headers:[{level:2,title:"基础API",slug:"基础api",children:[{level:3,title:"plugin",slug:"plugin",children:[]},{level:3,title:"ApplyPluginsType",slug:"applypluginstype",children:[]}]},{level:2,title:"路由API",slug:"路由api",children:[{level:3,title:"getRouter",slug:"getrouter",children:[]},{level:3,title:"useRoute",slug:"useroute",children:[]},{level:3,title:"useRouter",slug:"userouter",children:[]},{level:3,title:"onBeforeRouteUpdate",slug:"onbeforerouteupdate",children:[]},{level:3,title:"onBeforeRouteLeave",slug:"onbeforerouteleave",children:[]},{level:3,title:"createWebHashHistory",slug:"createwebhashhistory",children:[]},{level:3,title:"createWebHistory",slug:"createwebhistory",children:[]},{level:3,title:"createMemoryHistory",slug:"creatememoryhistory",children:[]},{level:3,title:"createRouter",slug:"createrouter",children:[]},{level:3,title:"RouterLink",slug:"routerlink",children:[]},{level:3,title:"useLink",slug:"uselink",children:[]},{level:3,title:"RouterView",slug:"routerview",children:[]},{level:3,title:"Router Methods",slug:"router-methods",children:[]}]}],filePathRelative:"reference/api/README.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5930:(n,s,a)=>{a.r(s),a.d(s,{default:()=>F});var e=a(6252);const p=(0,e.uE)('

    API

    Fes.js 统一了API的出口,所有运行时API(包含Fes.js内置API和插件提供的API)全部通过@fesjs/fes导出。

    import { someApi  } from "@fesjs/fes"\n
    1

    基础API

    plugin

    提示

    主要在插件里面使用,项目代码中一般用不到。

    运行时插件接口,是 Fes.js 内置的跑在浏览器里的一套插件体系。

    import { plugin, ApplyPluginsType } from '@fesjs/fes';\n\n// 注册插件\nplugin.register({\n  apply: { dva: { foo: 1 } },\n  path: 'foo',\n});\nplugin.register({\n  apply: { dva: { bar: 1 } },\n  path: 'bar',\n});\n\n// 执行插件\n// 得到 { foo: 1, bar: 1 }\nplugin.applyPlugins({\n  key: 'dva',\n  type: ApplyPluginsType.modify,\n  initialValue: {},\n  args: {},\n  async: false,\n});\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    plugin.register 参数包含:

    • apply 插件文件导出的内容
    • path 插件文件路径

    plugin.applyPlugins 参数包含:

    • key,坑位的 key
    • type,执行方式类型,详见 ApplyPluginsType
    • initialValue,初始值
    • args,参数
    • async,是否异步执行且返回 Promise

    ApplyPluginsType

    提示

    主要在插件里面使用,项目代码中一般用不到。

    运行时插件执行类型,enum 类型,包含三个属性:

    • compose,用于合并执行多个函数,函数可决定前序函数的执行时机
    • modify,用于修改值
    • event,用于执行事件,前面没有依赖关系

    路由API

    ',17),t=(0,e.Uk)("Fes.js 路由基于 "),o={href:"https://next.router.vuejs.org/introduction.html",target:"_blank",rel:"noopener noreferrer"},r=(0,e.Uk)("Vue Router 4.0"),l=(0,e.Uk)(",想了解更多的同学可以看看官方文档。"),c=(0,e.uE)('

    getRouter

    返回当前 router 实例。

    import { getRouter } from "@fesjs/fes";\nconst router = getRouter();\nrouter.push();\n
    1
    2
    3

    useRoute

    返回当前 route 实例,相当于在模板内使用 $route。必须在 setup 函数内调用。

    import { useRoute } from "@fesjs/fes";\nexport default {\n    setup(){\n        const route = useRoute()\n    }\n}\n
    1
    2
    3
    4
    5
    6

    useRouter

    返回 router 实例,相当于在模板语法中使用 $router。必须在 setup 函数内调用。

    import { useRouter } from "@fesjs/fes";\nexport default {\n    setup(){\n        const router = useRouter()\n    }\n}\n
    1
    2
    3
    4
    5
    6

    onBeforeRouteUpdate

    添加导航守卫,在当前路由即将更新时触发。类似于之前的beforeRouteUpdate,但是可用于任何组件。卸载组件时,将移除守卫。

    import { onBeforeRouteUpdate } from "@fesjs/fes";\nexport default {\n    setup(){\n        onBeforeRouteUpdate((to, from, next)=>{\n        })\n    }\n}\n
    1
    2
    3
    4
    5
    6
    7

    onBeforeRouteLeave

    添加导航守卫,在当前路由即将离开时触发。类似于之前的beforeRouteLeave,但可用于任何组件。卸载组件时,将移除守卫。

    import { onBeforeRouteLeave } from "@fesjs/fes";\nexport default {\n    setup(){\n        onBeforeRouteLeave((to, from, next)=>{\n        })\n    }\n}\n
    1
    2
    3
    4
    5
    6
    7

    createWebHashHistory

    提示

    在开发插件时可能用上,平时一般用不上

    创建一个 hash 历史记录。对于没有主机的 web 应用程序 (例如 file://),或当配置服务器不能处理任意URL时这非常有用。注意:如果 SEO 对你很重要,你应该使用 createWebHistory

    createWebHistory

    提示

    在开发插件时可能用上,平时一般用不上

    创建HTML5历史记录。单页应用程序最常见的历史记录。必须通过 http 服务打开页面地址 。

    createMemoryHistory

    提示

    在开发插件时可能用上,平时一般用不上

    创建一个基于内存的历史记录。这个历史记录的主要目的是处理 SSR。它在一个特殊的位置开始,这个位置无处不在。如果用户不在浏览器上下文中,它们可以通过调用 router.push() 或 router.replace() 将该位置替换为启动位置。

    createRouter

    ',25),u=(0,e.Uk)("创建一个路由器实例,该实例可用于 Vue 应用程序。查看"),i={href:"https://next.router.vuejs.org/api/#routeroptions",target:"_blank",rel:"noopener noreferrer"},k=(0,e.Uk)("路由器选项"),d=(0,e.Uk)(",了解可以传递的所有属性的列表。"),b=(0,e.uE)('

    使用自定义组件路由器链接来创建链接,而不是使用常规标签。这使得 Vue 路由器无需重新加载页面即可更改 URL、处理 URL 生成及其编码。

    <router-link to="/about">Go to About</router-link>\n
    1
    ',3),h=(0,e.Uk)("可以查看"),m={href:"https://next.router.vuejs.org/api/#router-link-props",target:"_blank",rel:"noopener noreferrer"},g=(0,e.Uk)("官方文档"),v=(0,e.Uk)("了解更多 RouterLink 的 Porps。查看"),f={href:"https://next.router.vuejs.org/api/#router-link-s-v-slot",target:"_blank",rel:"noopener noreferrer"},y=(0,e.Uk)("官方文档"),w=(0,e.Uk)("了解 RouterLink 的作用域插槽。"),x=(0,e._)("h3",{id:"uselink",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#uselink","aria-hidden":"true"},"#"),(0,e.Uk)(" useLink")],-1),j=(0,e.Uk)("返回的结果跟 RouterLink 的作用域插槽的属性一致,查看"),R={href:"https://next.router.vuejs.org/api/#router-link-s-v-slot",target:"_blank",rel:"noopener noreferrer"},U=(0,e.Uk)("官方API"),_=(0,e.Uk)("了解更多。"),L=(0,e.uE)('
    import { RouterLink, useLink } from '@fesjs/fes'\n\nexport default {\n  name: 'AppLink',\n\n  props: {\n    // add @ts-ignore if using TypeScript\n    ...RouterLink.props,\n    inactiveClass: String,\n  },\n\n  setup(props) {\n    // `props` contains `to` and any other prop that can be passed to <router-link>\n    const { navigate, href, route, isActive, isExactActive } = useLink(props)\n\n    // profit!\n\n    return { isExternalLink }\n  },\n}\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

    RouterView

    router-view 将显示当前 URL 的对应的路由组件。你可以把它放在任何地方,以适应你的布局。

    <router-view></router-view>\n<router-view v-slot="{ Component, route }">\n  <component :is="Component" />\n</router-view>\n
    1
    2
    3
    4
    ',4),q=(0,e.Uk)("可以查看"),A={href:"https://next.router.vuejs.org/api/#router-view-props",target:"_blank",rel:"noopener noreferrer"},P=(0,e.Uk)("官方文档"),W=(0,e.Uk)("了解更多 RouterView 的 Porps。查看"),H={href:"https://next.router.vuejs.org/api/#router-view-s-v-slot",target:"_blank",rel:"noopener noreferrer"},I=(0,e.Uk)("官方文档"),E=(0,e.Uk)("了解 RouterView 的作用域插槽。"),V=(0,e._)("h3",{id:"router-methods",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#router-methods","aria-hidden":"true"},"#"),(0,e.Uk)(" Router Methods")],-1),B=(0,e.Uk)("查看"),T={href:"https://next.router.vuejs.org/api/#router-methods",target:"_blank",rel:"noopener noreferrer"},C=(0,e.Uk)("官方文档"),M=(0,e.Uk)("了解更多"),S={},F=(0,a(3744).Z)(S,[["render",function(n,s){const a=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,(0,e._)("p",null,[t,(0,e._)("a",o,[r,(0,e.Wm)(a)]),l]),c,(0,e._)("p",null,[u,(0,e._)("a",i,[k,(0,e.Wm)(a)]),d]),b,(0,e._)("p",null,[h,(0,e._)("a",m,[g,(0,e.Wm)(a)]),v,(0,e._)("a",f,[y,(0,e.Wm)(a)]),w]),x,(0,e._)("p",null,[j,(0,e._)("a",R,[U,(0,e.Wm)(a)]),_]),L,(0,e._)("p",null,[q,(0,e._)("a",A,[P,(0,e.Wm)(a)]),W,(0,e._)("a",H,[I,(0,e.Wm)(a)]),E]),V,(0,e._)("p",null,[B,(0,e._)("a",T,[C,(0,e.Wm)(a)]),M])],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,e]of s)a[n]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-7b48519a.56bce568.js b/assets/js/v-7b48519a.56bce568.js deleted file mode 100644 index 6d25f630..00000000 --- a/assets/js/v-7b48519a.56bce568.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[938],{1362:(n,a,s)=>{s.r(a),s.d(a,{data:()=>t});const t={key:"v-7b48519a",path:"/guide/template.html",title:"HTML 模板",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"自定义模板",slug:"自定义模板",children:[]},{level:2,title:"模板配置",slug:"模板配置",children:[]},{level:2,title:"模板变量",slug:"模板变量",children:[]}],filePathRelative:"guide/template.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5213:(n,a,s)=>{s.r(a),s.d(a,{default:()=>w});var t=s(6252);const p=(0,t._)("h1",{id:"html-模板",tabindex:"-1"},[(0,t._)("a",{class:"header-anchor",href:"#html-模板","aria-hidden":"true"},"#"),(0,t.Uk)(" HTML 模板")],-1),e=(0,t.Uk)("Fes.js 基于 "),l={href:"https://github.com/jantimon/html-webpack-plugin",target:"_blank",rel:"noopener noreferrer"},o=(0,t.Uk)("html-webpack-plugin"),c=(0,t.Uk)(" 实现的模板功能,默认模板内容是:"),u=(0,t.uE)('
    <!DOCTYPE html>\n<html>\n  <head>\n    <meta charset="utf-8">\n    <meta http-equiv="X-UA-Compatible" content="IE=edge">\n    <meta name="viewport" content="width=device-width,initial-scale=1.0">\n    <title><%= htmlWebpackPlugin.options.title %></title>\n  </head>\n  <body>\n    <div id="app"></div>\n  </body>\n</html>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    自定义模板

    src/public 文件夹中创建index.html,Fes.js 约定如果这个文件存在,则会替换默认模板。

    模板配置

    ',4),i=(0,t.Uk)("在配置文件("),r=(0,t._)("code",null,".fes.js",-1),k=(0,t.Uk)(")中配置 "),d=(0,t._)("code",null,"html",-1),g=(0,t.Uk)(",把"),m={href:"https://github.com/jantimon/html-webpack-plugin#options",target:"_blank",rel:"noopener noreferrer"},b=(0,t.Uk)("配置"),h=(0,t.Uk)("的对象作为参数传入 "),v=(0,t._)("code",null,"html-webpack-plugin",-1),q=(0,t.Uk)(" 实例。"),f=(0,t.uE)('

    举个 🌰 :

    export default {\n    html: {\n        title: '海贼王'\n    }\n}\n
    1
    2
    3
    4
    5

    页面的标题会设置成'海贼王'。

    模板变量

    当然我们也可以手动编写模板,在模板中添加linklinkmeta等标签。在我们手动配置模板时,有时候需要用到一些环境变量,模板里可以获取到的变量如下:

    • htmlWebpackPlugin,特定于此插件的数据
    • webpackConfig,用于此编译的webpack配置。例如,它可用于获取publicPath(webpackConfig.output.publicPath)。
    • compilation,webpack编译对象。例如,可以使用它来获取已处理资产的内容,并将其直接内联到页面中compilation.assets[...].source()

    举个 🌰 :

    <link rel="icon" type="image/x-icon" href="<%= webpackConfig.output.publicPath %>favicon.png" />\n
    1

    除上述 html-webpack-plugin 插件提供的变量外,Fes.js 还把 process.env 中的环境变量添加到模板作用域内:

    • NODE_ENV
    • FES_ENV
    • .env 文件中以 FES_APP_ 开头的变量

    举个 🌰 :

    <link rel="icon" href="<%= BASE_URL %>favicon.ico">\n
    1
    ',12),_={},w=(0,s(3744).Z)(_,[["render",function(n,a){const s=(0,t.up)("OutboundLink");return(0,t.wg)(),(0,t.iD)(t.HY,null,[p,(0,t._)("p",null,[e,(0,t._)("a",l,[o,(0,t.Wm)(s)]),c]),u,(0,t._)("p",null,[i,r,k,d,g,(0,t._)("a",m,[b,(0,t.Wm)(s)]),h,v,q]),f],64)}]])},3744:(n,a)=>{a.Z=(n,a)=>{const s=n.__vccOpts||n;for(const[n,t]of a)s[n]=t;return s}}}]); \ No newline at end of file diff --git a/assets/js/v-7b48519a.741c8475.js b/assets/js/v-7b48519a.741c8475.js new file mode 100644 index 00000000..c72f1b8c --- /dev/null +++ b/assets/js/v-7b48519a.741c8475.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[938],{1362:(n,a,s)=>{s.r(a),s.d(a,{data:()=>t});const t={key:"v-7b48519a",path:"/guide/template.html",title:"HTML 模板",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"自定义模板",slug:"自定义模板",children:[]},{level:2,title:"模板配置",slug:"模板配置",children:[]},{level:2,title:"模板变量",slug:"模板变量",children:[]}],filePathRelative:"guide/template.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5213:(n,a,s)=>{s.r(a),s.d(a,{default:()=>d});var t=s(6252);const p=(0,t._)("h1",{id:"html-模板",tabindex:"-1"},[(0,t._)("a",{class:"header-anchor",href:"#html-模板","aria-hidden":"true"},"#"),(0,t.Uk)(" HTML 模板")],-1),e={href:"https://github.com/jantimon/html-webpack-plugin",target:"_blank",rel:"noopener noreferrer"},l=(0,t.uE)('
    <!DOCTYPE html>\n<html>\n  <head>\n    <meta charset="utf-8">\n    <meta http-equiv="X-UA-Compatible" content="IE=edge">\n    <meta name="viewport" content="width=device-width,initial-scale=1.0">\n    <title><%= htmlWebpackPlugin.options.title %></title>\n  </head>\n  <body>\n    <div id="app"></div>\n  </body>\n</html>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    自定义模板

    src/public 文件夹中创建index.html,Fes.js 约定如果这个文件存在,则会替换默认模板。

    模板配置

    ',4),o=(0,t._)("code",null,".fes.js",-1),c=(0,t._)("code",null,"html",-1),u={href:"https://github.com/jantimon/html-webpack-plugin#options",target:"_blank",rel:"noopener noreferrer"},i=(0,t._)("code",null,"html-webpack-plugin",-1),r=(0,t.uE)('

    举个 🌰 :

    export default {\n    html: {\n        title: '海贼王'\n    }\n}\n
    1
    2
    3
    4
    5

    页面的标题会设置成'海贼王'。

    模板变量

    当然我们也可以手动编写模板,在模板中添加linklinkmeta等标签。在我们手动配置模板时,有时候需要用到一些环境变量,模板里可以获取到的变量如下:

    • htmlWebpackPlugin,特定于此插件的数据
    • webpackConfig,用于此编译的webpack配置。例如,它可用于获取publicPath(webpackConfig.output.publicPath)。
    • compilation,webpack编译对象。例如,可以使用它来获取已处理资产的内容,并将其直接内联到页面中compilation.assets[...].source()

    举个 🌰 :

    <link rel="icon" type="image/x-icon" href="<%= webpackConfig.output.publicPath %>favicon.png" />\n
    1

    除上述 html-webpack-plugin 插件提供的变量外,Fes.js 还把 process.env 中的环境变量添加到模板作用域内:

    • NODE_ENV
    • FES_ENV
    • .env 文件中以 FES_APP_ 开头的变量

    举个 🌰 :

    <link rel="icon" href="<%= BASE_URL %>favicon.ico">\n
    1
    ',12),k={},d=(0,s(3744).Z)(k,[["render",function(n,a){const s=(0,t.up)("OutboundLink");return(0,t.wg)(),(0,t.iD)(t.HY,null,[p,(0,t._)("p",null,[(0,t.Uk)("Fes.js 基于 "),(0,t._)("a",e,[(0,t.Uk)("html-webpack-plugin"),(0,t.Wm)(s)]),(0,t.Uk)(" 实现的模板功能,默认模板内容是:")]),l,(0,t._)("p",null,[(0,t.Uk)("在配置文件("),o,(0,t.Uk)(")中配置 "),c,(0,t.Uk)(",把"),(0,t._)("a",u,[(0,t.Uk)("配置"),(0,t.Wm)(s)]),(0,t.Uk)("的对象作为参数传入 "),i,(0,t.Uk)(" 实例。")]),r],64)}]])},3744:(n,a)=>{a.Z=(n,a)=>{const s=n.__vccOpts||n;for(const[n,t]of a)s[n]=t;return s}}}]); \ No newline at end of file diff --git a/assets/js/v-7b96e3a4.3306cbb7.js b/assets/js/v-7b96e3a4.033eb852.js similarity index 98% rename from assets/js/v-7b96e3a4.3306cbb7.js rename to assets/js/v-7b96e3a4.033eb852.js index 7b99fd19..2c0fe076 100644 --- a/assets/js/v-7b96e3a4.3306cbb7.js +++ b/assets/js/v-7b96e3a4.033eb852.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[278],{4731:(n,a,s)=>{s.r(a),s.d(a,{data:()=>t});const t={key:"v-7b96e3a4",path:"/guide/public.html",title:"静态资源",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:3,title:"在HTML模板中使用",slug:"在html模板中使用",children:[]},{level:3,title:"在.vue 和 js 文件中使用",slug:"在-vue-和-js-文件中使用",children:[]}],filePathRelative:"guide/public.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},6430:(n,a,s)=>{s.r(a),s.d(a,{default:()=>p});const t=(0,s(6252).uE)('

    静态资源

    有些内容不需要经过 webpack 模块化处理,则可以将这些内容放在 public 文件夹,构建后会直接复制到 dist 目录,所以你需要通过BASE_URL来引入它们。

    在HTML模板中使用

    public/index.html 中需要设置:

    <link rel="icon" href="<%= BASE_URL %>favicon.ico">\n
    1

    在.vue 和 js 文件中使用

    <template>\n  <img :src="`${publicPath}my-image.png`">\n</template>\n<script>\nexport default {\n  setup() {\n    return {\n      publicPath: process.env.BASE_URL\n    }\n  }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ',7),e={},p=(0,s(3744).Z)(e,[["render",function(n,a){return t}]])},3744:(n,a)=>{a.Z=(n,a)=>{const s=n.__vccOpts||n;for(const[n,t]of a)s[n]=t;return s}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[278],{4731:(n,a,s)=>{s.r(a),s.d(a,{data:()=>t});const t={key:"v-7b96e3a4",path:"/guide/public.html",title:"静态资源",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:3,title:"在HTML模板中使用",slug:"在html模板中使用",children:[]},{level:3,title:"在.vue 和 js 文件中使用",slug:"在-vue-和-js-文件中使用",children:[]}],filePathRelative:"guide/public.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},6430:(n,a,s)=>{s.r(a),s.d(a,{default:()=>p});const t=(0,s(6252).uE)('

    静态资源

    有些内容不需要经过 webpack 模块化处理,则可以将这些内容放在 public 文件夹,构建后会直接复制到 dist 目录,所以你需要通过BASE_URL来引入它们。

    在HTML模板中使用

    public/index.html 中需要设置:

    <link rel="icon" href="<%= BASE_URL %>favicon.ico">\n
    1

    在.vue 和 js 文件中使用

    <template>\n  <img :src="`${publicPath}my-image.png`">\n</template>\n<script>\nexport default {\n  setup() {\n    return {\n      publicPath: process.env.BASE_URL\n    }\n  }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ',7),e={},p=(0,s(3744).Z)(e,[["render",function(n,a){return t}]])},3744:(n,a)=>{a.Z=(n,a)=>{const s=n.__vccOpts||n;for(const[n,t]of a)s[n]=t;return s}}}]); \ No newline at end of file diff --git a/assets/js/v-85fa9b2a.ec3ca3c5.js b/assets/js/v-85fa9b2a.3f03d054.js similarity index 99% rename from assets/js/v-85fa9b2a.ec3ca3c5.js rename to assets/js/v-85fa9b2a.3f03d054.js index ac4d4d79..99a72dd9 100644 --- a/assets/js/v-85fa9b2a.ec3ca3c5.js +++ b/assets/js/v-85fa9b2a.3f03d054.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[445],{1759:(s,n,a)=>{a.r(n),a.d(n,{data:()=>p});const p={key:"v-85fa9b2a",path:"/guide/config.html",title:"配置",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"本地临时配置文件",slug:"本地临时配置文件",children:[]},{level:2,title:"多环境多份配置",slug:"多环境多份配置",children:[]},{level:2,title:"优先级",slug:"优先级",children:[]}],filePathRelative:"guide/config.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5942:(s,n,a)=>{a.r(n),a.d(n,{default:()=>t});const p=(0,a(6252).uE)('

    配置

    Fes.js 约定 .fes.js 文件为项目编译需要配置文件,可以引入 node 端依赖项,不要引入浏览器端依赖项。

    一份常见的配置示例如下:

    export default {\n    base: '/foo/',\n    publicPath: '/',\n    devServer: {\n        port: 8080\n    },\n    mock: {\n        prefix: '/v2'\n    },\n    proxy: {\n        '/v2': {\n            'target': 'https://api.douban.com/',\n            'changeOrigin': true, \n        },\n    },\n    layout: {\n        title: "Fes.js",\n        footer: 'Created by MumbelFe',\n        multiTabs: false,\n        menus: [{\n            name: 'index'\n        }, {\n            name: 'onepiece'\n        }, {\n            name: 'store'\n        }, {\n            name: 'simpleList'\n        }]\n    }\n}\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30

    本地临时配置文件

    可以新建 .fes.local.js 作为本地临时配置文件。这份配置会和 .fes.jsdeep merge 后形成最终配置。

    // .fes.js\nexport default { mock: false };\n\n// .fes.local.js\nexport default { \n    mock: true,\n    devServer: { port: 8080 }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8

    最终的配置是:

    { \n    mock: true,\n    devServer: { port: 8080 }\n};\n
    1
    2
    3
    4

    注意

    .fes.local.js 是本地验证使用的临时配置,仅在 fes dev 时有效,请将其添加到 .gitignore,务必不要提交到 git 仓库中。

    多环境多份配置

    可以通过环境变量 FES_ENV 区分不同环境,来指定当前环境的配置文件,这份配置会和 .fes.jsdeep merge 后形成最终配。

    比如配置如下:

    // .fes.js\nexport default { mock: false };\n\n// .fes.uat.js\nexport default { \n    mock: true,\n    devServer: { port: 8080 }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8

    当我们运行:

    FES_ENV=uat fes dev\n
    1

    这时候会命中 .fes.uat.js 这份环境配置,最终配置是:

    { \n    mock: true,\n    devServer: { port: 8080 }\n};\n
    1
    2
    3
    4

    优先级

    本地临时配置 > 环境配置 > 基础配置

    提示

    如果多份配置中存在相同的配置项,则优先级高的会覆盖优先级低的

    ',21),e={},t=(0,a(3744).Z)(e,[["render",function(s,n){return p}]])},3744:(s,n)=>{n.Z=(s,n)=>{const a=s.__vccOpts||s;for(const[s,p]of n)a[s]=p;return a}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[445],{1759:(s,n,a)=>{a.r(n),a.d(n,{data:()=>p});const p={key:"v-85fa9b2a",path:"/guide/config.html",title:"配置",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"本地临时配置文件",slug:"本地临时配置文件",children:[]},{level:2,title:"多环境多份配置",slug:"多环境多份配置",children:[]},{level:2,title:"优先级",slug:"优先级",children:[]}],filePathRelative:"guide/config.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5942:(s,n,a)=>{a.r(n),a.d(n,{default:()=>t});const p=(0,a(6252).uE)('

    配置

    Fes.js 约定 .fes.js 文件为项目编译需要配置文件,可以引入 node 端依赖项,不要引入浏览器端依赖项。

    一份常见的配置示例如下:

    export default {\n    base: '/foo/',\n    publicPath: '/',\n    devServer: {\n        port: 8080\n    },\n    mock: {\n        prefix: '/v2'\n    },\n    proxy: {\n        '/v2': {\n            'target': 'https://api.douban.com/',\n            'changeOrigin': true, \n        },\n    },\n    layout: {\n        title: "Fes.js",\n        footer: 'Created by MumbelFe',\n        multiTabs: false,\n        menus: [{\n            name: 'index'\n        }, {\n            name: 'onepiece'\n        }, {\n            name: 'store'\n        }, {\n            name: 'simpleList'\n        }]\n    }\n}\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30

    本地临时配置文件

    可以新建 .fes.local.js 作为本地临时配置文件。这份配置会和 .fes.jsdeep merge 后形成最终配置。

    // .fes.js\nexport default { mock: false };\n\n// .fes.local.js\nexport default { \n    mock: true,\n    devServer: { port: 8080 }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8

    最终的配置是:

    { \n    mock: true,\n    devServer: { port: 8080 }\n};\n
    1
    2
    3
    4

    注意

    .fes.local.js 是本地验证使用的临时配置,仅在 fes dev 时有效,请将其添加到 .gitignore,务必不要提交到 git 仓库中。

    多环境多份配置

    可以通过环境变量 FES_ENV 区分不同环境,来指定当前环境的配置文件,这份配置会和 .fes.jsdeep merge 后形成最终配。

    比如配置如下:

    // .fes.js\nexport default { mock: false };\n\n// .fes.uat.js\nexport default { \n    mock: true,\n    devServer: { port: 8080 }\n};\n
    1
    2
    3
    4
    5
    6
    7
    8

    当我们运行:

    FES_ENV=uat fes dev\n
    1

    这时候会命中 .fes.uat.js 这份环境配置,最终配置是:

    { \n    mock: true,\n    devServer: { port: 8080 }\n};\n
    1
    2
    3
    4

    优先级

    本地临时配置 > 环境配置 > 基础配置

    提示

    如果多份配置中存在相同的配置项,则优先级高的会覆盖优先级低的

    ',21),e={},t=(0,a(3744).Z)(e,[["render",function(s,n){return p}]])},3744:(s,n)=>{n.Z=(s,n)=>{const a=s.__vccOpts||s;for(const[s,p]of n)a[s]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-884fd4bc.85ac18fd.js b/assets/js/v-884fd4bc.36a95eba.js similarity index 60% rename from assets/js/v-884fd4bc.85ac18fd.js rename to assets/js/v-884fd4bc.36a95eba.js index abf48817..2e718b4b 100644 --- a/assets/js/v-884fd4bc.85ac18fd.js +++ b/assets/js/v-884fd4bc.36a95eba.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[229],{7657:(s,n,a)=>{a.r(n),a.d(n,{data:()=>e});const e={key:"v-884fd4bc",path:"/guide/css.html",title:"使用 css",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"全局样式",slug:"全局样式",children:[]},{level:2,title:"组件内样式",slug:"组件内样式",children:[]},{level:2,title:"引入第三方样式",slug:"引入第三方样式",children:[]},{level:2,title:"CSS Modules",slug:"css-modules",children:[]},{level:2,title:"CSS 预处理器",slug:"css-预处理器",children:[]}],filePathRelative:"guide/css.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},8568:(s,n,a)=>{a.r(n),a.d(n,{default:()=>m});var e=a(6252);const c=(0,e.uE)('

    使用 css

    提示

    本文档以 css 为示例,把后缀换成 .less 同样适用。

    全局样式

    Fes.js 中约定 src/global.css 为全局样式,如果存在此文件,会被自动引入到入口文件最前面。

    比如用于覆盖样式,

    .layout-content {\n  max-width: 1000px;\n}\n
    1
    2
    3

    组件内样式

    <style>\n.layout-content {\n  max-width: 1000px;\n}\n</style>\n
    1
    2
    3
    4
    5

    引入第三方样式

    可以直接通过 import 引入第三方组件,当然最好在入口文件app.js中引入

    // src/app.js\nimport 'bootstrap/dist/css/bootstrap.css'\n
    1
    2

    CSS Modules

    ',12),t=(0,e.Uk)("支持 "),l=(0,e._)("code",null,"Vue",-1),p=(0,e.Uk)(" 的 "),o={href:"https://vue-loader.vuejs.org/zh/guide/css-modules.html#%E7%94%A8%E6%B3%95",target:"_blank",rel:"noopener noreferrer"},r=(0,e.Uk)("CSS Modules"),i=(0,e.Uk)(" 用法,可以直接使用:"),u=(0,e.uE)('
    <style module>\n.layout-content {\n  max-width: 1000px;\n}\n
    1
    2
    3
    4

    如果想直接引入CSS文件的话,则CSS文件名需要包含.module,比如:

    import style from '@/styles/index.module.css'\nconsole.log(style)\n
    1
    2

    CSS 预处理器

    Fes.js 内置支持 less,不支持 sassstylus,但如果有需求,可以通过 chainWebpack 配置或者 fes-plugin 插件的形式支持。

    ',5),d={},m=(0,a(3744).Z)(d,[["render",function(s,n){const a=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[c,(0,e._)("p",null,[t,l,p,(0,e._)("a",o,[r,(0,e.Wm)(a)]),i]),u],64)}]])},3744:(s,n)=>{n.Z=(s,n)=>{const a=s.__vccOpts||s;for(const[s,e]of n)a[s]=e;return a}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[229],{7657:(s,n,a)=>{a.r(n),a.d(n,{data:()=>e});const e={key:"v-884fd4bc",path:"/guide/css.html",title:"使用 css",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"全局样式",slug:"全局样式",children:[]},{level:2,title:"组件内样式",slug:"组件内样式",children:[]},{level:2,title:"引入第三方样式",slug:"引入第三方样式",children:[]},{level:2,title:"CSS Modules",slug:"css-modules",children:[]},{level:2,title:"CSS 预处理器",slug:"css-预处理器",children:[]}],filePathRelative:"guide/css.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},8568:(s,n,a)=>{a.r(n),a.d(n,{default:()=>r});var e=a(6252);const c=(0,e.uE)('

    使用 css

    提示

    本文档以 css 为示例,把后缀换成 .less 同样适用。

    全局样式

    Fes.js 中约定 src/global.css 为全局样式,如果存在此文件,会被自动引入到入口文件最前面。

    比如用于覆盖样式,

    .layout-content {\n  max-width: 1000px;\n}\n
    1
    2
    3

    组件内样式

    <style>\n.layout-content {\n  max-width: 1000px;\n}\n</style>\n
    1
    2
    3
    4
    5

    引入第三方样式

    可以直接通过 import 引入第三方组件,当然最好在入口文件app.js中引入

    // src/app.js\nimport 'bootstrap/dist/css/bootstrap.css'\n
    1
    2

    CSS Modules

    ',12),t=(0,e._)("code",null,"Vue",-1),l={href:"https://vue-loader.vuejs.org/zh/guide/css-modules.html#%E7%94%A8%E6%B3%95",target:"_blank",rel:"noopener noreferrer"},p=(0,e.uE)('
    <style module>\n.layout-content {\n  max-width: 1000px;\n}\n
    1
    2
    3
    4

    如果想直接引入CSS文件的话,则CSS文件名需要包含.module,比如:

    import style from '@/styles/index.module.css'\nconsole.log(style)\n
    1
    2

    CSS 预处理器

    Fes.js 内置支持 less,不支持 sassstylus,但如果有需求,可以通过 chainWebpack 配置或者 fes-plugin 插件的形式支持。

    ',5),o={},r=(0,a(3744).Z)(o,[["render",function(s,n){const a=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[c,(0,e._)("p",null,[(0,e.Uk)("支持 "),t,(0,e.Uk)(" 的 "),(0,e._)("a",l,[(0,e.Uk)("CSS Modules"),(0,e.Wm)(a)]),(0,e.Uk)(" 用法,可以直接使用:")]),p],64)}]])},3744:(s,n)=>{n.Z=(s,n)=>{const a=s.__vccOpts||s;for(const[s,e]of n)a[s]=e;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-8daa1a0e.531dc54a.js b/assets/js/v-8daa1a0e.97e78117.js similarity index 82% rename from assets/js/v-8daa1a0e.531dc54a.js rename to assets/js/v-8daa1a0e.97e78117.js index 75f94b15..ddcaa234 100644 --- a/assets/js/v-8daa1a0e.531dc54a.js +++ b/assets/js/v-8daa1a0e.97e78117.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[509],{6464:(e,n,s)=>{s.r(n),s.d(n,{data:()=>a});const a={key:"v-8daa1a0e",path:"/",title:"首页",lang:"zh-CN",frontmatter:{home:!0,title:"首页",heroImage:"/logo.png",actions:[{text:"快速上手",link:"/guide/getting-started.html",type:"primary"},{text:"项目简介",link:"/guide/",type:"secondary"}],features:[{title:"Fast",details:"Fes.js 内置路由、构建、插件管理,提供测试、布局、权限、国际化、状态管理、请求、数据字典、Svg等插件,可以满足大部分日常开发需求。"},{title:"Easy",details:"基于Vue.js 3.0,上手非常简单。贯彻 “约定优于配置” 思想,在设计插件上尽可能用约定替代配置,依然提供统一的插件配置入口,简单简洁又不失灵活。提供一致性的API入口,一致化的体验,学习起来更轻松。"},{title:"Strong",details:"仅仅需要关心页面内容,减少犯错的机会!提供单元测试、覆盖测试的能力保障项目质量。"},{title:"可扩展",details:"借鉴 UMI 实现完整的生命周期和插件化机制,插件可以管理项目的编译时和运行时,能力均可以通过插件封装进来,在 Fes.js 中协调有序的运行。"},{title:"面向未来",details:"在满足需求的同时,我们也不会停止对新技术的探索。已使用Vue3.0来提升应用性能,已使用webpack5提升构建性能和实现微服务,未来会探索vite等新技术。"},{title:"令人愉悦",details:"我们的主要重点是开发人员体验。我们喜欢 Fes.js,并且会不断改进框架,所以您也喜欢它!期待有吸引力的解决方案,描述性的错误消息,强大的默认值和详细的文档。如果有问题或疑问,我们有用的社区将为您提供帮助。"}],footer:"MIT Licensed | Copyright © 2020-present Webank"},excerpt:"",headers:[{level:2,title:"像数 1, 2, 3 一样容易",slug:"像数-1-2-3-一样容易",children:[]},{level:2,title:"反馈",slug:"反馈",children:[]}],filePathRelative:"README.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},8104:(e,n,s)=>{s.r(n),s.d(n,{default:()=>m});var a=s(6252);const l=(0,a._)("h2",{id:"像数-1-2-3-一样容易",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#像数-1-2-3-一样容易","aria-hidden":"true"},"#"),(0,a.Uk)(" 像数 1, 2, 3 一样容易")],-1),t=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" create @fesjs/fes-app myapp\n\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" \n\n"),(0,a._)("span",{class:"token comment"},"# 运行"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" dev\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br")])],-1),r=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\nnpx @fesjs/create-fes-app myapp\n\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(),(0,a._)("span",{class:"token function"},"install"),(0,a.Uk)(" \n\n"),(0,a._)("span",{class:"token comment"},"# 运行"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" run dev\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br")])],-1),i=(0,a._)("h2",{id:"反馈",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#反馈","aria-hidden":"true"},"#"),(0,a.Uk)(" 反馈")],-1),c=(0,a._)("thead",null,[(0,a._)("tr",null,[(0,a._)("th",null,"Github Issue"),(0,a._)("th",null,"Fes.js开源运营小助手")])],-1),u={href:"https://github.com/WeBankFinTech/fes.js/issues",target:"_blank",rel:"noopener noreferrer"},_=(0,a.Uk)("@fesjs/fes.js/issues"),o=(0,a._)("td",null,[(0,a._)("img",{src:"https://cos-1254145788.cos.ap-guangzhou.myqcloud.com/WechatIMG104.jpeg",height:"250"})],-1),p={},m=(0,s(3744).Z)(p,[["render",function(e,n){const s=(0,a.up)("CodeGroupItem"),p=(0,a.up)("CodeGroup"),m=(0,a.up)("OutboundLink");return(0,a.wg)(),(0,a.iD)(a.HY,null,[l,(0,a.Wm)(p,null,{default:(0,a.w5)((()=>[(0,a.Wm)(s,{title:"YARN",active:""},{default:(0,a.w5)((()=>[t])),_:1}),(0,a.Wm)(s,{title:"NPM"},{default:(0,a.w5)((()=>[r])),_:1})])),_:1}),i,(0,a._)("table",null,[c,(0,a._)("tbody",null,[(0,a._)("tr",null,[(0,a._)("td",null,[(0,a._)("a",u,[_,(0,a.Wm)(m)])]),o])])])],64)}]])},3744:(e,n)=>{n.Z=(e,n)=>{const s=e.__vccOpts||e;for(const[e,a]of n)s[e]=a;return s}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[509],{6464:(e,n,s)=>{s.r(n),s.d(n,{data:()=>a});const a={key:"v-8daa1a0e",path:"/",title:"首页",lang:"zh-CN",frontmatter:{home:!0,title:"首页",heroImage:"/logo.png",actions:[{text:"快速上手",link:"/guide/getting-started.html",type:"primary"},{text:"项目简介",link:"/guide/",type:"secondary"}],features:[{title:"Fast",details:"Fes.js 内置路由、构建、插件管理,提供测试、布局、权限、国际化、状态管理、请求、数据字典、Svg等插件,可以满足大部分日常开发需求。"},{title:"Easy",details:"基于Vue.js 3.0,上手非常简单。贯彻 “约定优于配置” 思想,在设计插件上尽可能用约定替代配置,依然提供统一的插件配置入口,简单简洁又不失灵活。提供一致性的API入口,一致化的体验,学习起来更轻松。"},{title:"Strong",details:"仅仅需要关心页面内容,减少犯错的机会!提供单元测试、覆盖测试的能力保障项目质量。"},{title:"可扩展",details:"借鉴 UMI 实现完整的生命周期和插件化机制,插件可以管理项目的编译时和运行时,能力均可以通过插件封装进来,在 Fes.js 中协调有序的运行。"},{title:"面向未来",details:"在满足需求的同时,我们也不会停止对新技术的探索。已使用Vue3.0来提升应用性能,已使用webpack5提升构建性能和实现微服务,未来会探索vite等新技术。"},{title:"令人愉悦",details:"我们的主要重点是开发人员体验。我们喜欢 Fes.js,并且会不断改进框架,所以您也喜欢它!期待有吸引力的解决方案,描述性的错误消息,强大的默认值和详细的文档。如果有问题或疑问,我们有用的社区将为您提供帮助。"}],footer:"MIT Licensed | Copyright © 2020-present Webank"},excerpt:"",headers:[{level:2,title:"像数 1, 2, 3 一样容易",slug:"像数-1-2-3-一样容易",children:[]},{level:2,title:"反馈",slug:"反馈",children:[]}],filePathRelative:"README.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},8104:(e,n,s)=>{s.r(n),s.d(n,{default:()=>p});var a=s(6252);const l=(0,a._)("h2",{id:"像数-1-2-3-一样容易",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#像数-1-2-3-一样容易","aria-hidden":"true"},"#"),(0,a.Uk)(" 像数 1, 2, 3 一样容易")],-1),t=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" create @fesjs/fes-app myapp\n\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" \n\n"),(0,a._)("span",{class:"token comment"},"# 运行"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" dev\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br")])],-1),r=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\nnpx @fesjs/create-fes-app myapp\n\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(),(0,a._)("span",{class:"token function"},"install"),(0,a.Uk)(" \n\n"),(0,a._)("span",{class:"token comment"},"# 运行"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" run dev\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br")])],-1),i=(0,a._)("h2",{id:"反馈",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#反馈","aria-hidden":"true"},"#"),(0,a.Uk)(" 反馈")],-1),c=(0,a._)("thead",null,[(0,a._)("tr",null,[(0,a._)("th",null,"Github Issue"),(0,a._)("th",null,"Fes.js开源运营小助手")])],-1),u={href:"https://github.com/WeBankFinTech/fes.js/issues",target:"_blank",rel:"noopener noreferrer"},_=(0,a._)("td",null,[(0,a._)("img",{src:"https://cos-1254145788.cos.ap-guangzhou.myqcloud.com/WechatIMG104.jpeg",height:"250"})],-1),o={},p=(0,s(3744).Z)(o,[["render",function(e,n){const s=(0,a.up)("CodeGroupItem"),o=(0,a.up)("CodeGroup"),p=(0,a.up)("OutboundLink");return(0,a.wg)(),(0,a.iD)(a.HY,null,[l,(0,a.Wm)(o,null,{default:(0,a.w5)((()=>[(0,a.Wm)(s,{title:"YARN",active:""},{default:(0,a.w5)((()=>[t])),_:1}),(0,a.Wm)(s,{title:"NPM"},{default:(0,a.w5)((()=>[r])),_:1})])),_:1}),i,(0,a._)("table",null,[c,(0,a._)("tbody",null,[(0,a._)("tr",null,[(0,a._)("td",null,[(0,a._)("a",u,[(0,a.Uk)("@fesjs/fes.js/issues"),(0,a.Wm)(p)])]),_])])])],64)}]])},3744:(e,n)=>{n.Z=(e,n)=>{const s=e.__vccOpts||e;for(const[e,a]of n)s[e]=a;return s}}}]); \ No newline at end of file diff --git a/assets/js/v-a1a49808.55d17752.js b/assets/js/v-a1a49808.5aa9c148.js similarity index 56% rename from assets/js/v-a1a49808.55d17752.js rename to assets/js/v-a1a49808.5aa9c148.js index 450dc466..d0b5bfb8 100644 --- a/assets/js/v-a1a49808.55d17752.js +++ b/assets/js/v-a1a49808.5aa9c148.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[943],{5710:(e,a,t)=>{t.r(a),t.d(a,{data:()=>r});const r={key:"v-a1a49808",path:"/reference/api.html",title:"API",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[],filePathRelative:"reference/api.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},3364:(e,a,t)=>{t.r(a),t.d(a,{default:()=>s});var r=t(6252);const n={id:"api",tabindex:"-1"},c=[(0,r._)("a",{class:"header-anchor",href:"#api","aria-hidden":"true"},"#",-1),(0,r.Uk)(" API")],i={},s=(0,t(3744).Z)(i,[["render",function(e,a){return(0,r.wg)(),(0,r.iD)("h1",n,c)}]])},3744:(e,a)=>{a.Z=(e,a)=>{const t=e.__vccOpts||e;for(const[e,r]of a)t[e]=r;return t}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[943],{5710:(e,a,t)=>{t.r(a),t.d(a,{data:()=>r});const r={key:"v-a1a49808",path:"/reference/api.html",title:"API",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[],filePathRelative:"reference/api.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},3364:(e,a,t)=>{t.r(a),t.d(a,{default:()=>s});var r=t(6252);const n={id:"api",tabindex:"-1"},c=(0,r._)("a",{class:"header-anchor",href:"#api","aria-hidden":"true"},"#",-1),i={},s=(0,t(3744).Z)(i,[["render",function(e,a){return(0,r.wg)(),(0,r.iD)("h1",n,[c,(0,r.Uk)(" API")])}]])},3744:(e,a)=>{a.Z=(e,a)=>{const t=e.__vccOpts||e;for(const[e,r]of a)t[e]=r;return t}}}]); \ No newline at end of file diff --git a/assets/js/v-a951be94.9550ef17.js b/assets/js/v-a951be94.9550ef17.js new file mode 100644 index 00000000..50874fe7 --- /dev/null +++ b/assets/js/v-a951be94.9550ef17.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[65],{8007:(a,s,n)=>{n.r(s),n.d(s,{data:()=>e});const e={key:"v-a951be94",path:"/reference/cli.html",title:"命令行接口",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"dev",slug:"dev",children:[]},{level:2,title:"build",slug:"build",children:[]},{level:2,title:"info",slug:"info",children:[]}],filePathRelative:"reference/cli.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},1933:(a,s,n)=>{n.r(s),n.d(s,{default:()=>i});var e=n(6252);const p=(0,e._)("h1",{id:"命令行接口",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#命令行接口","aria-hidden":"true"},"#"),(0,e.Uk)(" 命令行接口")],-1),r={href:"https://www.npmjs.com/package/@vuepress/cli",target:"_blank",rel:"noopener noreferrer"},l={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},t=(0,e.uE)('

    执行 vuepress --help 来获取下列帮助信息:

    Usage:\n  $ vuepress <command> [options]\n\nCommands:\n  dev [sourceDir]    Start development server\n  build [sourceDir]  Build to static site\n  info               Display environment information\n\nFor more info, run any command with the `--help` flag:\n  $ vuepress dev --help\n  $ vuepress build --help\n  $ vuepress info --help\n\nOptions:\n  -v, --version  Display version number \n  -h, --help     Display this message \n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    dev

    启动一个开发服务器,在本地开发你的 VuePress 站点。

    Usage:\n  $ vuepress dev [sourceDir]\n\nOptions:\n  -c, --config <config>  Set path to config file \n  -p, --port <port>      Use specified port (default: 8080) \n  -t, --temp <temp>      Set the directory of the temporary files \n  --host <host>          Use specified host (default: 0.0.0.0) \n  --cache <cache>        Set the directory of the cache files \n  --clean-temp           Clean the temporary files before dev \n  --clean-cache          Clean the cache files before dev \n  --open                 Open browser when ready \n  --debug                Enable debug mode \n  --no-watch             Disable watching page and config files (default: true)\n  -v, --version          Display version number \n  -h, --help             Display this message\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    提示

    通过命令行设置的配置项,会覆盖你配置文件中的同名配置项。

    build

    ',7),c=(0,e.uE)('
    Usage:\n  $ vuepress build [sourceDir]\n\nOptions:\n  -c, --config <config>  Set path to config file \n  -d, --dest <dest>      Set the directory build output (default: .vuepress/dist) \n  -t, --temp <temp>      Set the directory of the temporary files \n  --cache <cache>        Set the directory of the cache files \n  --clean-temp           Clean the temporary files before build \n  --clean-cache          Clean the cache files before build \n  --debug                Enable debug mode \n  -v, --version          Display version number \n  -h, --help             Display this message\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    提示

    通过命令行设置的配置项,会覆盖你配置文件中的同名配置项。

    info

    输出当前系统和依赖相关的信息。

    在你想要检查你的环境,或者提交 Issue 时候,可以使用该命令。

    ',5),o={},i=(0,n(3744).Z)(o,[["render",function(a,s){const n=(0,e.up)("OutboundLink"),o=(0,e.up)("RouterLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,(0,e._)("p",null,[(0,e.Uk)("VuePress 命令行接口是由 "),(0,e._)("a",r,[(0,e.Uk)("@vuepress/cli"),(0,e.Wm)(n)]),(0,e.Uk)(" 包提供的。它是 "),(0,e._)("a",l,[(0,e.Uk)("vuepress"),(0,e.Wm)(n)]),(0,e.Uk)(" 包的依赖之一,当然你也可以单独安装它。")]),t,(0,e._)("p",null,[(0,e.Uk)("将你的 VuePress 站点构建成静态文件,以便你进行后续"),(0,e.Wm)(o,{to:"/guide/deployment.html"},{default:(0,e.w5)((()=>[(0,e.Uk)("部署")])),_:1}),(0,e.Uk)("。")]),c],64)}]])},3744:(a,s)=>{s.Z=(a,s)=>{const n=a.__vccOpts||a;for(const[a,e]of s)n[a]=e;return n}}}]); \ No newline at end of file diff --git a/assets/js/v-a951be94.d6df9191.js b/assets/js/v-a951be94.d6df9191.js deleted file mode 100644 index ab9eea45..00000000 --- a/assets/js/v-a951be94.d6df9191.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[65],{8007:(a,s,n)=>{n.r(s),n.d(s,{data:()=>e});const e={key:"v-a951be94",path:"/reference/cli.html",title:"命令行接口",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"dev",slug:"dev",children:[]},{level:2,title:"build",slug:"build",children:[]},{level:2,title:"info",slug:"info",children:[]}],filePathRelative:"reference/cli.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},1933:(a,s,n)=>{n.r(s),n.d(s,{default:()=>f});var e=n(6252);const p=(0,e._)("h1",{id:"命令行接口",tabindex:"-1"},[(0,e._)("a",{class:"header-anchor",href:"#命令行接口","aria-hidden":"true"},"#"),(0,e.Uk)(" 命令行接口")],-1),r=(0,e.Uk)("VuePress 命令行接口是由 "),l={href:"https://www.npmjs.com/package/@vuepress/cli",target:"_blank",rel:"noopener noreferrer"},t=(0,e.Uk)("@vuepress/cli"),c=(0,e.Uk)(" 包提供的。它是 "),o={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},i=(0,e.Uk)("vuepress"),u=(0,e.Uk)(" 包的依赖之一,当然你也可以单独安装它。"),b=(0,e.uE)('

    执行 vuepress --help 来获取下列帮助信息:

    Usage:\n  $ vuepress <command> [options]\n\nCommands:\n  dev [sourceDir]    Start development server\n  build [sourceDir]  Build to static site\n  info               Display environment information\n\nFor more info, run any command with the `--help` flag:\n  $ vuepress dev --help\n  $ vuepress build --help\n  $ vuepress info --help\n\nOptions:\n  -v, --version  Display version number \n  -h, --help     Display this message \n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    dev

    启动一个开发服务器,在本地开发你的 VuePress 站点。

    Usage:\n  $ vuepress dev [sourceDir]\n\nOptions:\n  -c, --config <config>  Set path to config file \n  -p, --port <port>      Use specified port (default: 8080) \n  -t, --temp <temp>      Set the directory of the temporary files \n  --host <host>          Use specified host (default: 0.0.0.0) \n  --cache <cache>        Set the directory of the cache files \n  --clean-temp           Clean the temporary files before dev \n  --clean-cache          Clean the cache files before dev \n  --open                 Open browser when ready \n  --debug                Enable debug mode \n  --no-watch             Disable watching page and config files (default: true)\n  -v, --version          Display version number \n  -h, --help             Display this message\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    提示

    通过命令行设置的配置项,会覆盖你配置文件中的同名配置项。

    build

    ',7),m=(0,e.Uk)("将你的 VuePress 站点构建成静态文件,以便你进行后续"),d=(0,e.Uk)("部署"),h=(0,e.Uk)("。"),k=(0,e.uE)('
    Usage:\n  $ vuepress build [sourceDir]\n\nOptions:\n  -c, --config <config>  Set path to config file \n  -d, --dest <dest>      Set the directory build output (default: .vuepress/dist) \n  -t, --temp <temp>      Set the directory of the temporary files \n  --cache <cache>        Set the directory of the cache files \n  --clean-temp           Clean the temporary files before build \n  --clean-cache          Clean the cache files before build \n  --debug                Enable debug mode \n  -v, --version          Display version number \n  -h, --help             Display this message\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    提示

    通过命令行设置的配置项,会覆盖你配置文件中的同名配置项。

    info

    输出当前系统和依赖相关的信息。

    在你想要检查你的环境,或者提交 Issue 时候,可以使用该命令。

    ',5),v={},f=(0,n(3744).Z)(v,[["render",function(a,s){const n=(0,e.up)("OutboundLink"),v=(0,e.up)("RouterLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,(0,e._)("p",null,[r,(0,e._)("a",l,[t,(0,e.Wm)(n)]),c,(0,e._)("a",o,[i,(0,e.Wm)(n)]),u]),b,(0,e._)("p",null,[m,(0,e.Wm)(v,{to:"/guide/deployment.html"},{default:(0,e.w5)((()=>[d])),_:1}),h]),k],64)}]])},3744:(a,s)=>{s.Z=(a,s)=>{const n=a.__vccOpts||a;for(const[a,e]of s)n[a]=e;return n}}}]); \ No newline at end of file diff --git a/assets/js/v-b15becb0.9810a63f.js b/assets/js/v-b15becb0.9810a63f.js new file mode 100644 index 00000000..9d6b7107 --- /dev/null +++ b/assets/js/v-b15becb0.9810a63f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[172],{8504:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-b15becb0",path:"/reference/plugin/plugins/qiankun.html",title:"@fesjs/plugin-qiankun",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"主应用配置",slug:"主应用配置",children:[{level:3,title:"第一步:注册子应用",slug:"第一步-注册子应用",children:[]},{level:3,title:"第二步:装载子应用",slug:"第二步-装载子应用",children:[]}]},{level:2,title:"子应用配置",slug:"子应用配置",children:[{level:3,title:"第一步:插件注册",slug:"第一步-插件注册",children:[]},{level:3,title:"第二步:配置运行时生命周期钩子(可选)",slug:"第二步-配置运行时生命周期钩子-可选",children:[]}]},{level:2,title:"父子应用通讯",slug:"父子应用通讯",children:[{level:3,title:"配合 useModel 使用",slug:"配合-usemodel-使用",children:[]},{level:3,title:"基于 props 传递",slug:"基于-props-传递",children:[]},{level:3,title:"MicroApp",slug:"microapp",children:[]},{level:3,title:"MicroAppWithMemoHistory",slug:"microappwithmemohistory",children:[]}]}],filePathRelative:"reference/plugin/plugins/qiankun.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5574:(n,s,a)=>{a.r(s),a.d(s,{default:()=>k});var p=a(6252);const t=(0,p._)("h1",{id:"fesjs-plugin-qiankun",tabindex:"-1"},[(0,p._)("a",{class:"header-anchor",href:"#fesjs-plugin-qiankun","aria-hidden":"true"},"#"),(0,p.Uk)(" @fesjs/plugin-qiankun")],-1),e={href:"https://qiankun.umijs.org/",target:"_blank",rel:"noopener noreferrer"},o={href:"https://umijs.org/zh-CN/plugins/plugin-qiankun#MicroApp",target:"_blank",rel:"noopener noreferrer"},c=(0,p.uE)('

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-qiankun": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    介绍

    有一种痛叫接手老项目,技术栈老旧,内容多,还要继续维护~

    可能目前迁移、升级老项目最好的解决方案就是微前端。plugin-qiankun 是基于 qiankun 实现的 Fes.js 微前端解决方案。

    主应用配置

    第一步:注册子应用

    export default {\n    qiankun: {\n        main: {\n            // 注册子应用信息\n            apps: [\n                {\n                    name: 'app1', // 唯一 id\n                    entry: '//localhost:8001', // html entry\n                    props: {}  // 传递给子应用的数据\n                },\n                {\n                    name: 'app2', // 唯一 id\n                    entry: '//localhost:8002', // html entry\n                },\n            ],\n        },\n    },\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18

    第二步:装载子应用

    使用路由绑定的方式

    注意

    主应用和子应用需要自行适配路由路径!!!待完善...

    假设我们的系统之前有这样的一些路由:

    export default {\n    router: {\n        routes: [{\n            "path": "/",\n            "component": () => import('@/src/.fes/plugin-layout/index.js'),\n            "children": [\n                {\n                    "path": "/onepiece",\n                    "component": () => import('@/pages/onepiece'),\n                    "name": "onepiece",\n                    "meta": {\n                        "name": "onepiece",\n                        "title": "onepiece"\n                    }\n                }\n            ]\n        }]\n    }\n}\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19

    我们现在想在 /son 加载子应用 app1,只需要增加这样一些配置即可:

    export default {\n    router: {\n        routes: [{\n            "path": "/",\n            "component": () => import('@/src/.fes/plugin-layout/index.js'),\n            "children": [\n                {\n                    "path": "/onepiece",\n                    "component": () => import('@/pages/onepiece'),\n                    "name": "onepiece",\n                    "meta": {\n                        "name": "onepiece",\n                        "title": "onepiece"\n                    }\n                },\n                {\n                    "path": "/son",\n                    "meta": {\n                        "name": "son",\n                        "title": "子应用",\n                        "microApp": "app1"\n                    }\n                }\n            ]\n        }]\n    }\n}\n















     
     
     
     
     
     
     
     




    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27

    当前我们依然提倡约定路由的方式,在src/pages 目录新建 son.vue

    <config>\n{\n    "name": "son",\n    "title": "子应用",\n    "microApp": "app1"\n}\n</config>\n
    1
    2
    3
    4
    5
    6
    7

    使用 <MicroApp /> 组件的方式

    提示

    建议使用这种方式来引入不带路由的子应用。 否则请自行关注子应用依赖的路由跟当前浏览器 url 是否能正确匹配上,否则很容易出现子应用加载了,但是页面没有渲染出来的情况。

    <template>\n    <MicroApp :name="name" />\n</template>\n<script>\nimport { MicroApp } from '@fesjs/fes';\n\nexport default {\n    components: { MicroApp },\n    setup(){\n        const name = "app1"\n        return {\n            name\n        }\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    使用 <MicroAppWithMemoHistory /> 组件的方式

    如果我们的路由使用 history 模式,那么在使用乾坤时还算方便,主应用和子应用的路由根据base可以很方便的匹配起来,而且不存在冲突。但是当我们使用 hash 模式时,就问题很大,主应用和子应用的路由必须一样才可以匹配上,用起来贼不方便。而且不能在一个页面上同时加载多个子应用,路由存在冲突!这时候,<MicroAppWithMemoHistory /> 出现了,完美解决上面的问题。

    <MicroAppWithMemoHistory /> 相比 <MicroApp /> ,需要多传入 url 参数,用于指定加载子应用什么路由页面。

    <template>\n   <MicroApp :name="name" url="/" />\n</template>\n<script>\nimport { MicroApp } from '@fesjs/fes';\n\nexport default {\n   components: { MicroApp },\n   setup(){\n       const name = "app1"\n       return {\n           name\n       }\n   }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    子应用配置

    第一步:插件注册

    export default {\n    qiankun: {\n        micro: {},\n    }\n};\n
    1
    2
    3
    4
    5

    第二步:配置运行时生命周期钩子(可选)

    插件会自动为你创建好 qiankun 子应用需要的生命周期钩子,但是如果你想在生命周期期间加一些自定义逻辑,可以在子应用的 src/app.js 里导出 qiankun 对象,并实现每一个生命周期钩子,其中钩子函数的入参 props 由主应用自动注入。

    export const qiankun = {\n    // 应用加载之前\n    async bootstrap(props) {\n        console.log('app1 bootstrap', props);\n    },\n    // 应用 render 之前触发\n    async mount(props) {\n        console.log('app1 mount', props);\n    },\n    // 当 props 更新时触发\n    async update(props){\n        console.log('app1 update', props);\n    },\n    // 应用卸载之后触发\n    async unmount(props) {\n        console.log('app1 unmount', props);\n    },\n};\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19

    父子应用通讯

    有两种方式实现

    ',33),l={id:"配合-usemodel-使用",tabindex:"-1"},r=(0,p._)("a",{class:"header-anchor",href:"#配合-usemodel-使用","aria-hidden":"true"},"#",-1),u=(0,p.uE)('

    确保已经安装了 @fesjs/plugin-model

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-model": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    主应用传递 props

    • 如果使用 MicroApp 组件模式消费子应用,直接通过 props 传递即可:
    <template>\n    <MicroApp :name="name" :user="user" />\n</template>\n<script>\nimport { MicroApp } from '@fesjs/fes';\n\nexport default {\n    components: { MicroApp },\n    setup(){\n        const name = "app1"\n        const user = ref("")\n        return {\n            name,\n            user\n        }\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    • 如果使用路由绑定式消费子应用,那么约定src/models/qiankunStateForMicro.js 的模型数据将作为 props 船体给子应用,如:
    import { reactive } from 'vue';\n\nexport default () => {\n    const state = reactive({ c: 1 });\n    return {\n        state\n    };\n};\n
    1
    2
    3
    4
    5
    6
    7
    8

    子应用消费 props

    子应用中会自动生成一个全局名为 qiankunStateFromMainmodel, 可以在任意组件中获取主应用透传的 props 的值。

    <script>\nexport default {\n    setup(){\n        const mainState = useModel('qiankunStateFromMain');\n        return {\n            mainState\n        };\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    基于 props 传递

    • 主应用使用 props 的模式传递数据(参考主应用装载子应用配置一节)
    • 子应用在生命周期钩子中获取 props 消费数据(参考子应用运行时配置一节)

    MicroApp

    属性说明类型默认值
    name子应用名称,传入qiankun.main.apps配置中的nameString-
    settings子应用配置信息Object{}
    props传入子应用的参数Object{}
    lifeCycles子应用生命周期钩子Object{}
    cacheName子应用缓存名称,配置后根据name+cacheName缓存子应用实例Object-

    MicroAppWithMemoHistory

    属性说明类型默认值
    name子应用名称,传入qiankun.main.apps配置中的nameString-
    settings子应用配置信息Object{}
    props传入子应用的参数Object{}
    lifeCycles子应用生命周期钩子Object{}
    cacheName子应用缓存名称,配置后根据name+cacheName缓存子应用实例Object-
    url子应用的路由地址String-
    ',16),i={},k=(0,a(3744).Z)(i,[["render",function(n,s){const a=(0,p.up)("OutboundLink"),i=(0,p.up)("RouterLink");return(0,p.wg)(),(0,p.iD)(p.HY,null,[t,(0,p._)("p",null,[(0,p.Uk)("Fes.js plugin for "),(0,p._)("a",e,[(0,p.Uk)("qiankun"),(0,p.Wm)(a)]),(0,p.Uk)(",参考"),(0,p._)("a",o,[(0,p.Uk)("@umijs/plugin-qiankun"),(0,p.Wm)(a)]),(0,p.Uk)(" 实现,喜欢 React 的同学推荐直接用 Umi。")]),c,(0,p._)("h3",l,[r,(0,p.Uk)(" 配合 "),(0,p.Wm)(i,{to:"/reference/plugin/plugins/model.html"},{default:(0,p.w5)((()=>[(0,p.Uk)("useModel")])),_:1}),(0,p.Uk)(" 使用")]),u],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-b15becb0.e6d203bb.js b/assets/js/v-b15becb0.e6d203bb.js deleted file mode 100644 index e7b92700..00000000 --- a/assets/js/v-b15becb0.e6d203bb.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[172],{8504:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-b15becb0",path:"/reference/plugin/plugins/qiankun.html",title:"@fesjs/plugin-qiankun",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"主应用配置",slug:"主应用配置",children:[{level:3,title:"第一步:注册子应用",slug:"第一步-注册子应用",children:[]},{level:3,title:"第二步:装载子应用",slug:"第二步-装载子应用",children:[]}]},{level:2,title:"子应用配置",slug:"子应用配置",children:[{level:3,title:"第一步:插件注册",slug:"第一步-插件注册",children:[]},{level:3,title:"第二步:配置运行时生命周期钩子(可选)",slug:"第二步-配置运行时生命周期钩子-可选",children:[]}]},{level:2,title:"父子应用通讯",slug:"父子应用通讯",children:[{level:3,title:"配合 useModel 使用",slug:"配合-usemodel-使用",children:[]},{level:3,title:"基于 props 传递",slug:"基于-props-传递",children:[]},{level:3,title:"MicroApp",slug:"microapp",children:[]},{level:3,title:"MicroAppWithMemoHistory",slug:"microappwithmemohistory",children:[]}]}],filePathRelative:"reference/plugin/plugins/qiankun.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5574:(n,s,a)=>{a.r(s),a.d(s,{default:()=>v});var p=a(6252);const t=(0,p._)("h1",{id:"fesjs-plugin-qiankun",tabindex:"-1"},[(0,p._)("a",{class:"header-anchor",href:"#fesjs-plugin-qiankun","aria-hidden":"true"},"#"),(0,p.Uk)(" @fesjs/plugin-qiankun")],-1),e=(0,p.Uk)("Fes.js plugin for "),o={href:"https://qiankun.umijs.org/",target:"_blank",rel:"noopener noreferrer"},c=(0,p.Uk)("qiankun"),l=(0,p.Uk)(",参考"),r={href:"https://umijs.org/zh-CN/plugins/plugin-qiankun#MicroApp",target:"_blank",rel:"noopener noreferrer"},u=(0,p.Uk)("@umijs/plugin-qiankun"),i=(0,p.Uk)(" 实现,喜欢 React 的同学推荐直接用 Umi。"),k=(0,p.uE)('

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-qiankun": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    介绍

    有一种痛叫接手老项目,技术栈老旧,内容多,还要继续维护~

    可能目前迁移、升级老项目最好的解决方案就是微前端。plugin-qiankun 是基于 qiankun 实现的 Fes.js 微前端解决方案。

    主应用配置

    第一步:注册子应用

    export default {\n    qiankun: {\n        main: {\n            // 注册子应用信息\n            apps: [\n                {\n                    name: 'app1', // 唯一 id\n                    entry: '//localhost:8001', // html entry\n                    props: {}  // 传递给子应用的数据\n                },\n                {\n                    name: 'app2', // 唯一 id\n                    entry: '//localhost:8002', // html entry\n                },\n            ],\n        },\n    },\n};\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18

    第二步:装载子应用

    使用路由绑定的方式

    注意

    主应用和子应用需要自行适配路由路径!!!待完善...

    假设我们的系统之前有这样的一些路由:

    export default {\n    router: {\n        routes: [{\n            "path": "/",\n            "component": () => import('@/src/.fes/plugin-layout/index.js'),\n            "children": [\n                {\n                    "path": "/onepiece",\n                    "component": () => import('@/pages/onepiece'),\n                    "name": "onepiece",\n                    "meta": {\n                        "name": "onepiece",\n                        "title": "onepiece"\n                    }\n                }\n            ]\n        }]\n    }\n}\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19

    我们现在想在 /son 加载子应用 app1,只需要增加这样一些配置即可:

    export default {\n    router: {\n        routes: [{\n            "path": "/",\n            "component": () => import('@/src/.fes/plugin-layout/index.js'),\n            "children": [\n                {\n                    "path": "/onepiece",\n                    "component": () => import('@/pages/onepiece'),\n                    "name": "onepiece",\n                    "meta": {\n                        "name": "onepiece",\n                        "title": "onepiece"\n                    }\n                },\n                {\n                    "path": "/son",\n                    "meta": {\n                        "name": "son",\n                        "title": "子应用",\n                        "microApp": "app1"\n                    }\n                }\n            ]\n        }]\n    }\n}\n















     
     
     
     
     
     
     
     




    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27

    当前我们依然提倡约定路由的方式,在src/pages 目录新建 son.vue

    <config>\n{\n    "name": "son",\n    "title": "子应用",\n    "microApp": "app1"\n}\n</config>\n
    1
    2
    3
    4
    5
    6
    7

    使用 <MicroApp /> 组件的方式

    提示

    建议使用这种方式来引入不带路由的子应用。 否则请自行关注子应用依赖的路由跟当前浏览器 url 是否能正确匹配上,否则很容易出现子应用加载了,但是页面没有渲染出来的情况。

    <template>\n    <MicroApp :name="name" />\n</template>\n<script>\nimport { MicroApp } from '@fesjs/fes';\n\nexport default {\n    components: { MicroApp },\n    setup(){\n        const name = "app1"\n        return {\n            name\n        }\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    使用 <MicroAppWithMemoHistory /> 组件的方式

    如果我们的路由使用 history 模式,那么在使用乾坤时还算方便,主应用和子应用的路由根据base可以很方便的匹配起来,而且不存在冲突。但是当我们使用 hash 模式时,就问题很大,主应用和子应用的路由必须一样才可以匹配上,用起来贼不方便。而且不能在一个页面上同时加载多个子应用,路由存在冲突!这时候,<MicroAppWithMemoHistory /> 出现了,完美解决上面的问题。

    <MicroAppWithMemoHistory /> 相比 <MicroApp /> ,需要多传入 url 参数,用于指定加载子应用什么路由页面。

    <template>\n   <MicroApp :name="name" url="/" />\n</template>\n<script>\nimport { MicroApp } from '@fesjs/fes';\n\nexport default {\n   components: { MicroApp },\n   setup(){\n       const name = "app1"\n       return {\n           name\n       }\n   }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    子应用配置

    第一步:插件注册

    export default {\n    qiankun: {\n        micro: {},\n    }\n};\n
    1
    2
    3
    4
    5

    第二步:配置运行时生命周期钩子(可选)

    插件会自动为你创建好 qiankun 子应用需要的生命周期钩子,但是如果你想在生命周期期间加一些自定义逻辑,可以在子应用的 src/app.js 里导出 qiankun 对象,并实现每一个生命周期钩子,其中钩子函数的入参 props 由主应用自动注入。

    export const qiankun = {\n    // 应用加载之前\n    async bootstrap(props) {\n        console.log('app1 bootstrap', props);\n    },\n    // 应用 render 之前触发\n    async mount(props) {\n        console.log('app1 mount', props);\n    },\n    // 当 props 更新时触发\n    async update(props){\n        console.log('app1 update', props);\n    },\n    // 应用卸载之后触发\n    async unmount(props) {\n        console.log('app1 unmount', props);\n    },\n};\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19

    父子应用通讯

    有两种方式实现

    ',33),d={id:"配合-usemodel-使用",tabindex:"-1"},b=(0,p._)("a",{class:"header-anchor",href:"#配合-usemodel-使用","aria-hidden":"true"},"#",-1),m=(0,p.Uk)(" 配合 "),g=(0,p.Uk)("useModel"),h=(0,p.Uk)(" 使用"),y=(0,p.uE)('

    确保已经安装了 @fesjs/plugin-model

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-model": "^2.0.0"\n    },\n}\n
    1
    2
    3
    4
    5
    6

    主应用传递 props

    • 如果使用 MicroApp 组件模式消费子应用,直接通过 props 传递即可:
    <template>\n    <MicroApp :name="name" :user="user" />\n</template>\n<script>\nimport { MicroApp } from '@fesjs/fes';\n\nexport default {\n    components: { MicroApp },\n    setup(){\n        const name = "app1"\n        const user = ref("")\n        return {\n            name,\n            user\n        }\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    • 如果使用路由绑定式消费子应用,那么约定src/models/qiankunStateForMicro.js 的模型数据将作为 props 船体给子应用,如:
    import { reactive } from 'vue';\n\nexport default () => {\n    const state = reactive({ c: 1 });\n    return {\n        state\n    };\n};\n
    1
    2
    3
    4
    5
    6
    7
    8

    子应用消费 props

    子应用中会自动生成一个全局名为 qiankunStateFromMainmodel, 可以在任意组件中获取主应用透传的 props 的值。

    <script>\nexport default {\n    setup(){\n        const mainState = useModel('qiankunStateFromMain');\n        return {\n            mainState\n        };\n    }\n}\n</script>\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    基于 props 传递

    • 主应用使用 props 的模式传递数据(参考主应用装载子应用配置一节)
    • 子应用在生命周期钩子中获取 props 消费数据(参考子应用运行时配置一节)

    MicroApp

    属性说明类型默认值
    name子应用名称,传入qiankun.main.apps配置中的nameString-
    settings子应用配置信息Object{}
    props传入子应用的参数Object{}
    lifeCycles子应用生命周期钩子Object{}
    cacheName子应用缓存名称,配置后根据name+cacheName缓存子应用实例Object-

    MicroAppWithMemoHistory

    属性说明类型默认值
    name子应用名称,传入qiankun.main.apps配置中的nameString-
    settings子应用配置信息Object{}
    props传入子应用的参数Object{}
    lifeCycles子应用生命周期钩子Object{}
    cacheName子应用缓存名称,配置后根据name+cacheName缓存子应用实例Object-
    url子应用的路由地址String-
    ',16),q={},v=(0,a(3744).Z)(q,[["render",function(n,s){const a=(0,p.up)("OutboundLink"),q=(0,p.up)("RouterLink");return(0,p.wg)(),(0,p.iD)(p.HY,null,[t,(0,p._)("p",null,[e,(0,p._)("a",o,[c,(0,p.Wm)(a)]),l,(0,p._)("a",r,[u,(0,p.Wm)(a)]),i]),k,(0,p._)("h3",d,[b,m,(0,p.Wm)(q,{to:"/reference/plugin/plugins/model.html"},{default:(0,p.w5)((()=>[g])),_:1}),h]),y],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-c253c956.95173f2d.js b/assets/js/v-c253c956.71cde0f0.js similarity index 99% rename from assets/js/v-c253c956.95173f2d.js rename to assets/js/v-c253c956.71cde0f0.js index e2ca559d..598c77f5 100644 --- a/assets/js/v-c253c956.95173f2d.js +++ b/assets/js/v-c253c956.71cde0f0.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[673],{9073:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-c253c956",path:"/reference/plugin/plugins/enums.html",title:"@fesjs/plugin-enums",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"配置",slug:"配置",children:[{level:3,title:"静态配置",slug:"静态配置",children:[]},{level:3,title:"动态配置",slug:"动态配置",children:[]}]},{level:2,title:"场景使用",slug:"场景使用",children:[]},{level:2,title:"API",slug:"api",children:[{level:3,title:"get",slug:"get",children:[]},{level:3,title:"push",slug:"push",children:[]},{level:3,title:"remove",slug:"remove",children:[]},{level:3,title:"concat",slug:"concat",children:[]},{level:3,title:"convert",slug:"convert",children:[]},{level:3,title:"extend配置",slug:"extend配置",children:[]},{level:3,title:"dir规则",slug:"dir规则",children:[]}]}],filePathRelative:"reference/plugin/plugins/enums.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},9339:(n,s,a)=>{a.r(s),a.d(s,{default:()=>t});const p=(0,a(6252).uE)('

    @fesjs/plugin-enums

    介绍

    日常业务开发中,有很多场景会使用到枚举值,比如select-options、table-column。

    该插件提供统一的枚举存取及丰富的函数来处理枚举。

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-enums": "^2.0.0"\n    }\n}\n
    1
    2
    3
    4
    5
    6

    配置

    静态配置

    .fes.js 中配置:

    // 配置格式:[[key, value], ...]\nexport default {\n    enums: {\n        status: [['0', '无效的'], ['1', '有效的']]\n    }\n}\n
    1
    2
    3
    4
    5
    6

    动态配置

    在业务代码中

    import { enums } from '@fesjs/fes';\n// 动态添加\nenums.push('status', [['0', '无效的'], ['1', '有效的']]\nenums.get('status', '1') // 有效的\n
    1
    2
    3
    4

    场景使用

    • 动态添加的枚举项支持数组和对象

    • 枚举项为对象时,可以指定keyName和valueName属性名

    • 导出枚举值,可指定取值的路径

    • 导出枚举可扩展属性

    <template>\n    <div>\n        <!-- 遍历枚举status -->\n        <div v-for="item in enumsGet('status')" :key="item.key">\n            {{item.value}}:{{item.key}}\n        </div>\n        <!-- 遍历枚举扩展后的roles -->\n        <div v-for="item in roles" :key="item.key">\n            {{item.name}}:{{item.disabled}}\n        </div>\n        <!-- 获取枚举roles为2的英文名 -->\n        <div>{{enumsGet('roles', '2', { dir: 'eName' })}}</div>\n    </div>\n</template>\n<script>\nimport { enums } from '@fesjs/fes';\n\nexport default {\n    setup() {\n        // 动态添加枚举,枚举项是对象,并指定key的属性名为id\n        enums.push('roles', [\n            {\n                id: '1',\n                cName: '系统管理员',\n                eName: 'System',\n                perm: ['1', '2', '3']\n            },\n            {\n                id: '2',\n                cName: '业务管理员',\n                eName: 'Business',\n                perm: ['1', '2']\n            },\n            {\n                id: '3',\n                cName: '普通用户',\n                eName: 'User',\n                perm: ['1']\n            }\n        ], { keyName: 'id' });\n        // 导出定制格式的roles,扩展枚举项新的属性name、disabled\n        const roles = enums.get('roles', {\n            extend: [\n                {\n                    key: 'name',\n                    dir: 'cName' // 指定取值路径,取属性cName的值\n                },\n                {\n                    key: 'disabled',\n                    // 传入函数,获取结果值\n                    transfer: item => item.value.perm.some(i => i >= 2)\n                }\n            ]\n        });\n        console.log(roles);\n        // [{key: '1', name: '系统管理员', disabled: true, value: {...}}, ....]\n        return {\n            enumsGet: enums.get,\n            roles\n        };\n    }\n};\n</script>\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64

    API

    get

    • get(name: string) 获取指定名字的枚举

    • get(name: string, key: string) 获取指定名字及键枚举默认值

    • get(name: string, opt: {extend: Array<Object>}) 获取指定名字的自定义格式枚举,查看extend配置

    • get(name: string, key: string, opt: {dir: string}) 获取指定名字及键枚举dir规则的值

    get('status')\nget('status', '1')\nget('status', {\n    extend: [\n        {\n            key: 'name',\n            dir: 'value',\n        },\n        {\n            key: 'disabled',\n            transfer: item => item === '0'\n        }\n    ]\n})\nget('status', '1', {dir: 'value'})\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    push

    动态添加枚举,重复添加会覆盖

    • push(name: string, _enum: Array<Array>)
    • push(name: string, _enum: Array<Object>, opt?: Object)
      • opt.keyName 指定key的取值属性,默认是key
      • opt.valueName 指定value的取值属性

    枚举项为数组,枚举项的[0]解析为key,枚举项的[1]解析为value

    枚举项为对象时,根据opt配置keyName、valueName取枚举项属性值分别作为key和value,如果valueName未设置则value就是枚举项

    remove

    • remove(name: string)

    移除指定的枚举

    concat

    基于现有的枚举,连接上新的枚举后返回新的枚举

    • concat(name: string, _enum: Array<Array|Object>, opt?: Object))
      • opt.keyName 指定key的取值属性,默认是key
      • opt.valueName 指定value的取值属性
      • opt.before 是否添加在现有的之前,默认是false
      • opt.extend:返回的枚举extend配置

    convert

    将传入的枚举格式转换为{key, value}的形式

    • convert(name: string, _enum: Array<Array|Object>, opt?: Object))
      • opt.keyName 指定key的取值属性,默认是key
      • opt.valueName 指定value的取值属性

    extend配置

    扩展枚举项属性的配置

    • extend: Array<Object>
      • key 指定扩展的属性名
      • dir 指定该属性的取值路径
      • transfer(item: {key: any, value: any}) 转换函数,参数未枚举项,返回就是该属性的值

    提示

    同时设置dir和transfer,transfer优先

    get('status', {\n    extend: [\n        {\n            key: 'name',\n            dir: 'value',\n        },\n        {\n            key: 'disabled',\n            transfer: item => item.key === '0'\n        }\n    ]\n})\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    dir规则

    dir是指定枚举项value的取值方式,规则如下:

    • 对象属性 AA.B
    • 数组 [0][0][1]
    • 混合 A[0][0].AA[0].B
    // 假如枚举项value的结构如下\nconst user = {\n    age: 18,\n    name: 'aring',\n    role: [\n        {\n            id: 1,\n            name: '管理员'\n        },\n                    {\n            id: 2,\n            name: '业务操作员'\n        }\n    ]\n}\n// 那么规则解析是:\ndir              value\n'age'        =>  18\n'role[0]'    =>  {id: 1, name: '管理员'}\n'role[1].id' =>  2\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

    提示

    枚举项value如果是基本类型,则规则不生效,value就是当前值

    ',45),e={},t=(0,a(3744).Z)(e,[["render",function(n,s){return p}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[673],{9073:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-c253c956",path:"/reference/plugin/plugins/enums.html",title:"@fesjs/plugin-enums",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"介绍",slug:"介绍",children:[]},{level:2,title:"启用方式",slug:"启用方式",children:[]},{level:2,title:"配置",slug:"配置",children:[{level:3,title:"静态配置",slug:"静态配置",children:[]},{level:3,title:"动态配置",slug:"动态配置",children:[]}]},{level:2,title:"场景使用",slug:"场景使用",children:[]},{level:2,title:"API",slug:"api",children:[{level:3,title:"get",slug:"get",children:[]},{level:3,title:"push",slug:"push",children:[]},{level:3,title:"remove",slug:"remove",children:[]},{level:3,title:"concat",slug:"concat",children:[]},{level:3,title:"convert",slug:"convert",children:[]},{level:3,title:"extend配置",slug:"extend配置",children:[]},{level:3,title:"dir规则",slug:"dir规则",children:[]}]}],filePathRelative:"reference/plugin/plugins/enums.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},9339:(n,s,a)=>{a.r(s),a.d(s,{default:()=>t});const p=(0,a(6252).uE)('

    @fesjs/plugin-enums

    介绍

    日常业务开发中,有很多场景会使用到枚举值,比如select-options、table-column。

    该插件提供统一的枚举存取及丰富的函数来处理枚举。

    启用方式

    package.json 中引入依赖:

    {\n    "dependencies": {\n        "@fesjs/fes": "^2.0.0",\n        "@fesjs/plugin-enums": "^2.0.0"\n    }\n}\n
    1
    2
    3
    4
    5
    6

    配置

    静态配置

    .fes.js 中配置:

    // 配置格式:[[key, value], ...]\nexport default {\n    enums: {\n        status: [['0', '无效的'], ['1', '有效的']]\n    }\n}\n
    1
    2
    3
    4
    5
    6

    动态配置

    在业务代码中

    import { enums } from '@fesjs/fes';\n// 动态添加\nenums.push('status', [['0', '无效的'], ['1', '有效的']]\nenums.get('status', '1') // 有效的\n
    1
    2
    3
    4

    场景使用

    • 动态添加的枚举项支持数组和对象

    • 枚举项为对象时,可以指定keyName和valueName属性名

    • 导出枚举值,可指定取值的路径

    • 导出枚举可扩展属性

    <template>\n    <div>\n        <!-- 遍历枚举status -->\n        <div v-for="item in enumsGet('status')" :key="item.key">\n            {{item.value}}:{{item.key}}\n        </div>\n        <!-- 遍历枚举扩展后的roles -->\n        <div v-for="item in roles" :key="item.key">\n            {{item.name}}:{{item.disabled}}\n        </div>\n        <!-- 获取枚举roles为2的英文名 -->\n        <div>{{enumsGet('roles', '2', { dir: 'eName' })}}</div>\n    </div>\n</template>\n<script>\nimport { enums } from '@fesjs/fes';\n\nexport default {\n    setup() {\n        // 动态添加枚举,枚举项是对象,并指定key的属性名为id\n        enums.push('roles', [\n            {\n                id: '1',\n                cName: '系统管理员',\n                eName: 'System',\n                perm: ['1', '2', '3']\n            },\n            {\n                id: '2',\n                cName: '业务管理员',\n                eName: 'Business',\n                perm: ['1', '2']\n            },\n            {\n                id: '3',\n                cName: '普通用户',\n                eName: 'User',\n                perm: ['1']\n            }\n        ], { keyName: 'id' });\n        // 导出定制格式的roles,扩展枚举项新的属性name、disabled\n        const roles = enums.get('roles', {\n            extend: [\n                {\n                    key: 'name',\n                    dir: 'cName' // 指定取值路径,取属性cName的值\n                },\n                {\n                    key: 'disabled',\n                    // 传入函数,获取结果值\n                    transfer: item => item.value.perm.some(i => i >= 2)\n                }\n            ]\n        });\n        console.log(roles);\n        // [{key: '1', name: '系统管理员', disabled: true, value: {...}}, ....]\n        return {\n            enumsGet: enums.get,\n            roles\n        };\n    }\n};\n</script>\n\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64

    API

    get

    • get(name: string) 获取指定名字的枚举

    • get(name: string, key: string) 获取指定名字及键枚举默认值

    • get(name: string, opt: {extend: Array<Object>}) 获取指定名字的自定义格式枚举,查看extend配置

    • get(name: string, key: string, opt: {dir: string}) 获取指定名字及键枚举dir规则的值

    get('status')\nget('status', '1')\nget('status', {\n    extend: [\n        {\n            key: 'name',\n            dir: 'value',\n        },\n        {\n            key: 'disabled',\n            transfer: item => item === '0'\n        }\n    ]\n})\nget('status', '1', {dir: 'value'})\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    push

    动态添加枚举,重复添加会覆盖

    • push(name: string, _enum: Array<Array>)
    • push(name: string, _enum: Array<Object>, opt?: Object)
      • opt.keyName 指定key的取值属性,默认是key
      • opt.valueName 指定value的取值属性

    枚举项为数组,枚举项的[0]解析为key,枚举项的[1]解析为value

    枚举项为对象时,根据opt配置keyName、valueName取枚举项属性值分别作为key和value,如果valueName未设置则value就是枚举项

    remove

    • remove(name: string)

    移除指定的枚举

    concat

    基于现有的枚举,连接上新的枚举后返回新的枚举

    • concat(name: string, _enum: Array<Array|Object>, opt?: Object))
      • opt.keyName 指定key的取值属性,默认是key
      • opt.valueName 指定value的取值属性
      • opt.before 是否添加在现有的之前,默认是false
      • opt.extend:返回的枚举extend配置

    convert

    将传入的枚举格式转换为{key, value}的形式

    • convert(name: string, _enum: Array<Array|Object>, opt?: Object))
      • opt.keyName 指定key的取值属性,默认是key
      • opt.valueName 指定value的取值属性

    extend配置

    扩展枚举项属性的配置

    • extend: Array<Object>
      • key 指定扩展的属性名
      • dir 指定该属性的取值路径
      • transfer(item: {key: any, value: any}) 转换函数,参数未枚举项,返回就是该属性的值

    提示

    同时设置dir和transfer,transfer优先

    get('status', {\n    extend: [\n        {\n            key: 'name',\n            dir: 'value',\n        },\n        {\n            key: 'disabled',\n            transfer: item => item.key === '0'\n        }\n    ]\n})\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    dir规则

    dir是指定枚举项value的取值方式,规则如下:

    • 对象属性 AA.B
    • 数组 [0][0][1]
    • 混合 A[0][0].AA[0].B
    // 假如枚举项value的结构如下\nconst user = {\n    age: 18,\n    name: 'aring',\n    role: [\n        {\n            id: 1,\n            name: '管理员'\n        },\n                    {\n            id: 2,\n            name: '业务操作员'\n        }\n    ]\n}\n// 那么规则解析是:\ndir              value\n'age'        =>  18\n'role[0]'    =>  {id: 1, name: '管理员'}\n'role[1].id' =>  2\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

    提示

    枚举项value如果是基本类型,则规则不生效,value就是当前值

    ',45),e={},t=(0,a(3744).Z)(e,[["render",function(n,s){return p}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-c5618810.81be60b6.js b/assets/js/v-c5618810.81be60b6.js deleted file mode 100644 index 8bb83143..00000000 --- a/assets/js/v-c5618810.81be60b6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[287],{4020:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-c5618810",path:"/reference/plugin/dev/api.html",title:"插件 API",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"属性",slug:"属性",children:[{level:3,title:"api.paths",slug:"api-paths",children:[]},{level:3,title:"api.cwd",slug:"api-cwd",children:[]},{level:3,title:"api.pkg",slug:"api-pkg",children:[]},{level:3,title:"api.configInstance",slug:"api-configinstance",children:[]},{level:3,title:"userConfig",slug:"userconfig",children:[]},{level:3,title:"config",slug:"config",children:[]},{level:3,title:"env",slug:"env",children:[]},{level:3,title:"args",slug:"args",children:[]}]},{level:2,title:"核心方法",slug:"核心方法",children:[{level:3,title:"describe",slug:"describe",children:[]},{level:3,title:"register",slug:"register",children:[]},{level:3,title:"applyPlugins",slug:"applyplugins",children:[]},{level:3,title:"registerMethod",slug:"registermethod",children:[]},{level:3,title:"registerCommand",slug:"registercommand",children:[]},{level:3,title:"registerPresets",slug:"registerpresets",children:[]},{level:3,title:"registerPlugins",slug:"registerplugins",children:[]},{level:3,title:"hasPlugins",slug:"hasplugins",children:[]},{level:3,title:"hasPresets",slug:"haspresets",children:[]},{level:3,title:"skipPlugins",slug:"skipplugins",children:[]}]},{level:2,title:"扩展方法",slug:"扩展方法",children:[{level:3,title:"addPluginExports",slug:"addpluginexports",children:[]},{level:3,title:"addCoreExports",slug:"addcoreexports",children:[]},{level:3,title:"addRuntimePlugin",slug:"addruntimeplugin",children:[]},{level:3,title:"addRuntimePluginKey",slug:"addruntimepluginkey",children:[]},{level:3,title:"addEntryImportsAhead",slug:"addentryimportsahead",children:[]},{level:3,title:"addEntryImports",slug:"addentryimports",children:[]},{level:3,title:"addEntryCodeAhead",slug:"addentrycodeahead",children:[]},{level:3,title:"addEntryCode",slug:"addentrycode",children:[]},{level:3,title:"addHTMLHeadScripts",slug:"addhtmlheadscripts",children:[]},{level:3,title:"addBeforeMiddlewares",slug:"addbeforemiddlewares",children:[]},{level:3,title:"addMiddlewares",slug:"addmiddlewares",children:[]},{level:3,title:"addTmpGenerateWatcherPaths",slug:"addtmpgeneratewatcherpaths",children:[]},{level:3,title:"chainWebpack",slug:"chainwebpack",children:[]},{level:3,title:"copyTmpFiles",slug:"copytmpfiles",children:[]},{level:3,title:"getPort",slug:"getport",children:[]},{level:3,title:"getHostname",slug:"gethostname",children:[]},{level:3,title:"getServer",slug:"getserver",children:[]},{level:3,title:"getRoutes",slug:"getroutes",children:[]},{level:3,title:"getRoutesJSON",slug:"getroutesjson",children:[]},{level:3,title:"modifyRoutes",slug:"modifyroutes",children:[]},{level:3,title:"modifyBundleConfigOpts",slug:"modifybundleconfigopts",children:[]},{level:3,title:"modifyBundleConfig",slug:"modifybundleconfig",children:[]},{level:3,title:"modifyBabelOpts",slug:"modifybabelopts",children:[]},{level:3,title:"modifyBabelPresetOpts",slug:"modifybabelpresetopts",children:[]},{level:3,title:"modifyPaths",slug:"modifypaths",children:[]},{level:3,title:"modifyDefaultConfig",slug:"modifydefaultconfig",children:[]},{level:3,title:"modifyConfig",slug:"modifyconfig",children:[]},{level:3,title:"modifyPublicPathStr",slug:"modifypublicpathstr",children:[]},{level:3,title:"onPluginReady",slug:"onpluginready",children:[]},{level:3,title:"onStart",slug:"onstart",children:[]},{level:3,title:"onExit",slug:"onexit",children:[]},{level:3,title:"onGenerateFiles",slug:"ongeneratefiles",children:[]},{level:3,title:"restartServer",slug:"restartserver",children:[]},{level:3,title:"writeTmpFile",slug:"writetmpfile",children:[]}]}],filePathRelative:"reference/plugin/dev/api.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},3221:(n,s,a)=>{a.r(s),a.d(s,{default:()=>T});var p=a(6252);const e=(0,p.uE)('

    插件 API

    属性

    api.paths

    一些关键的路径:

    • cwd,执行命令的绝对路径
    • absNodeModulesPath,nodeModule的绝对路径
    • absOutputPath,输出 build 产物的绝对路径
    • absSrcPath,src 目录的绝对路径
    • absPagesPath,pages目录的绝对路径
    • absTmpPath,.fes临时文件目录的绝对路径

    api.cwd

    执行命令的绝对路径

    api.pkg

    package.json的内容

    api.configInstance

    config实例

    userConfig

    用户配置

    config

    插件配置可被修改,此为最终的配置

    env

    process.env

    args

    环境变量

    核心方法

    describe

    注册阶段执行,用于描述插件或插件集的 id、key、配置信息、启用方式等。

    用法:describe({ id?: string, key?: string, config?: { default, schema, onChange } }, enableBy?)

    例如:

     api.describe({\n    key: 'esbuild',\n    config: {\n        schema(joi) {\n            return joi.object();\n        },\n        default: {}\n    },\n    enableBy: api.EnableBy.config,\n});\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    注:

    ',26),t=(0,p._)("li",null,[(0,p._)("code",null,"config.default"),(0,p.Uk)(" 为配置的默认值,用户没有配置时取这个")],-1),o=(0,p._)("code",null,"config.schema",-1),c=(0,p.Uk)(" 用于声明配置的类型,基于 "),l={href:"https://hapi.dev/module/joi",target:"_blank",rel:"noopener noreferrer"},i=(0,p.Uk)("joi"),r=(0,p.Uk)(",如果你希望用户进行配置,这个是必须的,否则用户的配置无效"),u=(0,p._)("li",null,[(0,p._)("code",null,"config.onChange"),(0,p.Uk)(" 是 "),(0,p._)("code",null,"dev"),(0,p.Uk)(" 阶段配置被修改后的处理机制,默认会重启 dev 进程,也可以修改为 api.ConfigChangeType.regenerateTmpFiles 只重新生成临时文件,还可以通过函数的格式自定义")],-1),d=(0,p._)("li",null,[(0,p._)("code",null,"enableBy"),(0,p.Uk)(" 为启用方式,默认是注册启用,可更改为 "),(0,p._)("code",null,"api.EnableBy.config"),(0,p.Uk)(",还可以用自定义函数的方式决定其启用时机(动态生效)")],-1),k=(0,p.uE)('

    register

    为 api.applyPlugins 注册可供其使用的 hook。

    用法:register({ key: string, fn: Function, pluginId?: string, before?: string, stage?: number })

    参数:

    • key:唯一id
    • fn:hook函数,当执行api.applyPlugins时,此函数被执行。
    • pluginId:插件id,如果配置了插件id,则只有此插件未被禁用时,才会执行。
    // 可同步\napi.register({\n  key: 'foo',\n  fn() {\n    return 'a';\n  },\n});\n\n// 可异步\napi.register({\n  key: 'foo',\n  async fn() {\n    await delay(100);\n    return 'b';\n  },\n});\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    注意:

    • fn 支持同步和异步,异步通过 Promise,返回值为 Promise 即为异步
    • fn 里的内容需结合 api.appyPluginstype 参数来看,如果是 api.ApplyPluginsType.add,需有返回值,这些返回值最终会被合成一个数组。如果是 api.ApplyPluginsType.modify,需对第一个参数做修改,并返回它,它会作为下个hook的参数。 如果是 api.ApplyPluginsType.event,无需返回值
    • stage 和 before 都是用于调整执行顺序的,参考 tapable
    • stage 默认是 0,设为 -1 或更少会提前执行,设为 1 或更多会后置执行

    applyPlugins

    取得 register 注册的 hooks 执行后的数据。

    用法:applyPlugins({ key: string, type: api.ApplyPluginsType, initialValue?: any, args?: any })

    参数:

    • key:唯一id
    • type:hook的类型。
    • initialValue:初始值。
    • args:参数,hook函数执行时,args会作为参数传入。

    例如:

    const foo = await api.applyPlugins({\n  key: 'foo',\n  type: api.ApplyPluginsType.add,\n  initialValue: [],\n});\nconsole.log(foo); // ['a', 'b']\n
    1
    2
    3
    4
    5
    6

    api.ApplyPluginsType

    编译时插件hook执行类型,enum 类型,包含三个属性:

    • compose,用于合并执行多个函数,函数可决定前序函数的执行时机
    • modify,用于修改值
    • event,用于执行事件,前面没有依赖关系

    registerMethod

    api 上注册方法。如果有提供 fn,则执行 fn 定义的函数。

    用法:registerMethod({ name: string, fn?: Function, exitsError?: boolean })

    例如:

     api.registerMethod({\n    name: 'writeTmpFile',\n    fn({\n        path,\n        content\n    }) {\n        assert(\n            api.stage >= api.ServiceStage.pluginReady,\n            'api.writeTmpFile() should not execute in register stage.'\n        );\n        const absPath = join(api.paths.absTmpPath, path);\n        api.utils.mkdirp.sync(dirname(absPath));\n        if (!existsSync(absPath) || readFileSync(absPath, 'utf-8') !== content) {\n            writeFileSync(absPath, content, 'utf-8');\n        }\n    }\n});\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

    然后在插件中可以使用:

    api.writeTmpFile()\n
    1

    registerCommand

    ',26),b=(0,p.Uk)("注册命令,基于 "),m={href:"https://github.com/tj/commander.js/",target:"_blank",rel:"noopener noreferrer"},g=(0,p.Uk)("commander"),h=(0,p.Uk)(" 实现的机制。"),f=(0,p._)("p",null,[(0,p.Uk)("用法:"),(0,p._)("strong",null,"registerCommand({ command: string, description: string, fn: Function, options?: Object })")],-1),v=(0,p._)("p",null,"参数:",-1),y=(0,p._)("li",null,"command",-1),j=(0,p._)("li",null,[(0,p.Uk)("description,描述文字,输入 "),(0,p._)("code",null,"--help"),(0,p.Uk)(" 会打印")],-1),x=(0,p._)("li",null,[(0,p.Uk)("fn,命令执行的函数,参数有: "),(0,p._)("ul",null,[(0,p._)("li",null,"rawArgv,原始参数"),(0,p._)("li",null,"args,参数"),(0,p._)("li",null,"options,执行命令时附带的的参数配置"),(0,p._)("li",null,"program,commander对象")])],-1),P=(0,p.Uk)("options,参数配置,基于 "),w={href:"https://github.com/tj/commander.js/",target:"_blank",rel:"noopener noreferrer"},_=(0,p.Uk)("commander"),C=(0,p.Uk)(" 。"),E=(0,p.uE)('

    例如:

    api.registerCommand({\n    command: 'webpack',\n    description: 'inspect webpack configurations',\n    options: [{\n        name: '--rule <ruleName>',\n        description: 'inspect a specific module rule'\n    }, {\n        name: '--plugin <pluginName>',\n        description: 'inspect a specific plugin'\n    }, {\n        name: '--rules',\n        description: 'list all module rule names'\n    }, {\n        name: '--plugins',\n        description: 'list all plugin names'\n    }, {\n        name: '--verbose',\n        description: 'show full function definitions in output'\n    }],\n    async fn({ rawArgv, args, options, program}) {\n    }\n})\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    当项目引入此插件后,使用:

    fes webpack\n
    1

    registerPresets

    注册插件集,参数为路径数组。

    用法:registerPresets(presets: string[])

    例如:

    api.registerPresets([\n    { id: 'preset_2', key: 'preset2', apply: () => () => {} },\n    require.resolve('./preset_3'),\n]);\n
    1
    2
    3
    4

    registerPlugins

    注册插件,参数为路径数组。

    用法:registerPlugins(plugins: string[])

    例如:

    api.registerPlugins([\n    { id: 'preset_2', key: 'preset2', apply: () => () => {} },\n    require.resolve('./preset_3'),\n]);\n
    1
    2
    3
    4

    hasPlugins

    判断是否有注册某个插件,插件的 id 规则:

    • id 默认为包名
    • 内置插件以 @@ 为前缀,比如 @@/registerMethod

    用法:hasPlugins(pluginIds: string[])

    例如

    // 判断是否有注册 @fesjs/plugin-locale\napi.hasPlugins(['@fesjs/plugin-locale']);\n
    1
    2

    提示

    如果在注册阶段使用,只能判断在他之前是否有注册某个插件。

    hasPresets

    判断是否有注册某个插件集。

    用法:hasPresets(presetIds: string[])

    例如

    // 判断是否有注册\napi.hasPlugins(['@fesjs/preset-xxx']);\n
    1
    2

    提示

    如果在注册阶段使用,只能判断在他之前是否有注册某个插件集。

    skipPlugins

    声明哪些插件需要被禁用,参数为插件 id 的数组。

    用法:hasPresets(presetIds: string[])

    例如:

    // 禁用 plugin-model 插件\napi.skipPlugins(['@fesjs/plugin-model']);\n
    1
    2

    扩展方法

    通过 api.registerMethod() 扩展的方法。

    addPluginExports

    把插件需要导出的运行时 API 写入@fesjs/fes

    api.addPluginExports(() => [\n    {\n        specifiers: ['access', 'useAccess'],\n        source: absoluteFilePath\n    }\n]);\n
    1
    2
    3
    4
    5
    6

    这样用户使用时:

    import { access, useAccess } from '@fesjs/fes';\n
    1

    addCoreExports

    提供给其他插件运行时需要的 API。

    api.addCoreExports(() => [\n    {\n        specifiers: ['getRoutes'],\n        source: absCoreFilePath\n    }\n]);\n
    1
    2
    3
    4
    5
    6

    使用:

    import { getHistory, destroyRouter } from '@@/core/coreExports';\n
    1

    addRuntimePlugin

    添加运行时插件,返回值格式为表示文件路径的字符串。

    例如:

    api.addRuntimePlugin(() => join(__dirname, './runtime'));\n
    1

    addRuntimePluginKey

    添加插件提供的运行时配置的 key,返回值格式为字符串。

    例如:

    api.addRuntimePluginKey(() => 'some');\n
    1

    则用户可以:

    // app.js\nconst some = function(){\n    return {\n\n    }\n}\n\n
    1
    2
    3
    4
    5
    6
    7

    addEntryImportsAhead

    在入口文件现有 import 的前面添加 import。

    例如:

    api.addEntryImportsAhead(() => [{ source: 'anypackage' }]);\n
    1

    addEntryImports

    在入口文件现有 import 的后面添加 import。

    例如:

    api.addEntryImport(() => {\n  return [\n    {\n      source: '/modulePath/xxx.js',\n      specifier: 'moduleName',\n    }\n  ]\n});\n
    1
    2
    3
    4
    5
    6
    7
    8

    addEntryCodeAhead

    在入口文件最前面(import 之后)添加代码。

    例如:

    api.addEntryCodeAhead(\n    () => `${globalCSSFile\n        .map(file => `require('${winPath(relative(absTmpPath, file))}');`)\n        .join('')}`\n\n
    1
    2
    3
    4
    5

    addEntryCode

    在入口文件最后添加代码。

    例如:

    api.addEntryCode(() => {\n  return `console.log('works!')`\n})\n
    1
    2
    3

    addHTMLHeadScripts

    在 HTML 头部添加脚本。

    例如:

    api.addHTMLHeadScripts(() => {\n  return [\n    {\n      content: '',\n      src: '',\n      // ...attrs\n    },\n  ];\n});\n
    1
    2
    3
    4
    5
    6
    7
    8
    9

    addBeforeMiddlewares

    添加在 webpack compiler 中间件之前的中间件,返回值格式为 express 中间件。

    例如:

    api.addBeforeMiddlewares(() => {\n  return (req, res, next) => {\n    if (false) {\n      res.end('end');\n    } else {\n      next();\n    }\n  };\n});\n
    1
    2
    3
    4
    5
    6
    7
    8
    9

    addMiddlewares

    添加在 webpack compiler 中间件之后的中间件,返回值格式为 express 中间件。

    addTmpGenerateWatcherPaths

    添加重新生成临时文件的监听路径。

    例如:

    api.addTmpGenerateWatcherPaths(() => [\n    './app.js',\n]);\n
    1
    2
    3

    chainWebpack

    通过 [webpack-chain] 的方式修改 webpack 配置。

    例如:

    api.chainWebpack((memo) => {\n    memo.resolve.alias.set('vue-i18n', 'vue-i18n/dist/vue-i18n.esm-bundler.js');\n});\n
    1
    2
    3

    copyTmpFiles

    批量写临时文件。

    例如:

     api.copyTmpFiles({\n    namespace,\n    path: join(__dirname, 'runtime'),\n    ignore: ['.tpl']\n});\n
    1
    2
    3
    4
    5

    参数:

    • namespace:复制到临时文件夹下的目标目录
    • path:需要复制的文件目录
    • ignore:需要排除的文件

    提示

    不能在注册阶段使用,通常放在 api.onGenerateFiles() 里,这样能在需要时重新生成临时文件 临时文件的写入做了缓存处理,如果内容一致,不会做写的操作,以减少触发 webpack 的重新编译

    getPort

    获取端口号,dev 时有效。

    getHostname

    获取 hostname,dev 时有效。

    getServer

    获取 devServer,dev 时有效。

    getRoutes

    获取 api.modifyRoutes 修改过后的路由信息。

    getRoutesJSON

    获取格式化后的路由信息

    modifyRoutes

    修改路由。

    例如:

    // 把BaseLayout插入到路由配置中,作为根路由\napi.modifyRoutes(routes => [\n    {\n        path: '/',\n        component: winPath(\n            join(api.paths.absTmpPath || '', absFilePath)\n        ),\n        children: routes\n    }\n]);\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    modifyBundleConfigOpts

    修改获取 bundleConfig 的函数参数。

    例如:

    api.modifyBundleConfigOpts(memo => {\n    memo.miniCSSExtractPluginPath = require.resolve('mini-css-extract-plugin');\n    memo.miniCSSExtractPluginLoaderPath = require.resolve(\n    'mini-css-extract-plugin/dist/loader',\n    );\n    return memo;\n});\n\n
    1
    2
    3
    4
    5
    6
    7
    8

    modifyBundleConfig

    修改 bundle 配置。

    api.modifyBundleConfig((bundleConfig) => {\n    // do something\n    return bundleConfig;\n});\n
    1
    2
    3
    4

    modifyBabelOpts

    修改 babel 配置项。

    例如:

    api.modifyBabelOpts((babelOpts) => {\n    if (api.config.babelPluginImport) {\n        api.config.babelPluginImport.forEach((config) => {\n            babelOpts.plugins.push(['import', config]);\n        });\n    }\n    return babelOpts;\n});\n
    1
    2
    3
    4
    5
    6
    7
    8

    modifyBabelPresetOpts

    修改 babel 插件的配置。

    例如:

    api.modifyBabelPresetOpts(opts => {\n    return {\n      ...opts,\n      import: (opts.import || []).concat([\n        { libraryName: 'ant-design-vue', libraryDirectory: 'es', style: true },\n      ]),\n    };\n});\n
    1
    2
    3
    4
    5
    6
    7
    8

    modifyPaths

    修改 paths 对象。

    modifyDefaultConfig

    修改默认配置。 例如:

    api.modifyDefaultConfig((memo) => {\n  return {\n    ...memo,\n    ...defaultOptions,\n  };\n});\n
    1
    2
    3
    4
    5
    6

    modifyConfig

    修改最终配置。

    例如:

    api.modifyConfig((memo) => {\n  return {\n    ...memo,\n    ...defaultOptions,\n  };\n});\n\n
    1
    2
    3
    4
    5
    6
    7

    modifyPublicPathStr

    修改 publicPath 字符串。

    例如:

    api.modifyPublicPathStr(() => {\n  return api.config.publicPath || '/';\n});\n
    1
    2
    3

    onPluginReady

    在插件初始化完成触发。在 onStart 之前,此时还没有 config 和 paths,他们尚未解析好。

    onStart

    在命令注册函数执行前触发。可以使用 config 和 paths。

    onExit

    dev 退出时触发。

    onGenerateFiles

    生成临时文件,触发时机在 webpack 编译之前。

    restartServer

    重启 devServer,dev 时有效。

    writeTmpFile

    写临时文件。

    例如:

    api.writeTmpFile({\n    path: absoluteFilePath,\n    content: Mustache.render(\n        readFileSync(join(__dirname, 'runtime/core.tpl'), 'utf-8'),\n        {\n            REPLACE_ROLES: JSON.stringify(roles)\n        }\n    )\n});\n
    1
    2
    3
    4
    5
    6
    7
    8
    9

    参数:

    • path:相对于临时文件夹的路径
    • content:文件内容

    提示

    不能在注册阶段使用,通常放在 api.onGenerateFiles() 里,这样能在需要时重新生成临时文件 临时文件的写入做了缓存处理,如果内容一致,不会做写的操作,以减少触发 webpack 的重新编译

    ',154),S={},T=(0,a(3744).Z)(S,[["render",function(n,s){const a=(0,p.up)("OutboundLink");return(0,p.wg)(),(0,p.iD)(p.HY,null,[e,(0,p._)("ul",null,[t,(0,p._)("li",null,[o,c,(0,p._)("a",l,[i,(0,p.Wm)(a)]),r]),u,d]),k,(0,p._)("p",null,[b,(0,p._)("a",m,[g,(0,p.Wm)(a)]),h]),f,v,(0,p._)("ul",null,[y,j,x,(0,p._)("li",null,[P,(0,p._)("a",w,[_,(0,p.Wm)(a)]),C])]),E],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-c5618810.c7e42791.js b/assets/js/v-c5618810.c7e42791.js new file mode 100644 index 00000000..11894cce --- /dev/null +++ b/assets/js/v-c5618810.c7e42791.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[287],{4020:(n,s,a)=>{a.r(s),a.d(s,{data:()=>p});const p={key:"v-c5618810",path:"/reference/plugin/dev/api.html",title:"插件 API",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"属性",slug:"属性",children:[{level:3,title:"api.paths",slug:"api-paths",children:[]},{level:3,title:"api.cwd",slug:"api-cwd",children:[]},{level:3,title:"api.pkg",slug:"api-pkg",children:[]},{level:3,title:"api.configInstance",slug:"api-configinstance",children:[]},{level:3,title:"userConfig",slug:"userconfig",children:[]},{level:3,title:"config",slug:"config",children:[]},{level:3,title:"env",slug:"env",children:[]},{level:3,title:"args",slug:"args",children:[]}]},{level:2,title:"核心方法",slug:"核心方法",children:[{level:3,title:"describe",slug:"describe",children:[]},{level:3,title:"register",slug:"register",children:[]},{level:3,title:"applyPlugins",slug:"applyplugins",children:[]},{level:3,title:"registerMethod",slug:"registermethod",children:[]},{level:3,title:"registerCommand",slug:"registercommand",children:[]},{level:3,title:"registerPresets",slug:"registerpresets",children:[]},{level:3,title:"registerPlugins",slug:"registerplugins",children:[]},{level:3,title:"hasPlugins",slug:"hasplugins",children:[]},{level:3,title:"hasPresets",slug:"haspresets",children:[]},{level:3,title:"skipPlugins",slug:"skipplugins",children:[]}]},{level:2,title:"扩展方法",slug:"扩展方法",children:[{level:3,title:"addPluginExports",slug:"addpluginexports",children:[]},{level:3,title:"addCoreExports",slug:"addcoreexports",children:[]},{level:3,title:"addRuntimePlugin",slug:"addruntimeplugin",children:[]},{level:3,title:"addRuntimePluginKey",slug:"addruntimepluginkey",children:[]},{level:3,title:"addEntryImportsAhead",slug:"addentryimportsahead",children:[]},{level:3,title:"addEntryImports",slug:"addentryimports",children:[]},{level:3,title:"addEntryCodeAhead",slug:"addentrycodeahead",children:[]},{level:3,title:"addEntryCode",slug:"addentrycode",children:[]},{level:3,title:"addHTMLHeadScripts",slug:"addhtmlheadscripts",children:[]},{level:3,title:"addBeforeMiddlewares",slug:"addbeforemiddlewares",children:[]},{level:3,title:"addMiddlewares",slug:"addmiddlewares",children:[]},{level:3,title:"addTmpGenerateWatcherPaths",slug:"addtmpgeneratewatcherpaths",children:[]},{level:3,title:"chainWebpack",slug:"chainwebpack",children:[]},{level:3,title:"copyTmpFiles",slug:"copytmpfiles",children:[]},{level:3,title:"getPort",slug:"getport",children:[]},{level:3,title:"getHostname",slug:"gethostname",children:[]},{level:3,title:"getServer",slug:"getserver",children:[]},{level:3,title:"getRoutes",slug:"getroutes",children:[]},{level:3,title:"getRoutesJSON",slug:"getroutesjson",children:[]},{level:3,title:"modifyRoutes",slug:"modifyroutes",children:[]},{level:3,title:"modifyBundleConfigOpts",slug:"modifybundleconfigopts",children:[]},{level:3,title:"modifyBundleConfig",slug:"modifybundleconfig",children:[]},{level:3,title:"modifyBabelOpts",slug:"modifybabelopts",children:[]},{level:3,title:"modifyBabelPresetOpts",slug:"modifybabelpresetopts",children:[]},{level:3,title:"modifyPaths",slug:"modifypaths",children:[]},{level:3,title:"modifyDefaultConfig",slug:"modifydefaultconfig",children:[]},{level:3,title:"modifyConfig",slug:"modifyconfig",children:[]},{level:3,title:"modifyPublicPathStr",slug:"modifypublicpathstr",children:[]},{level:3,title:"onPluginReady",slug:"onpluginready",children:[]},{level:3,title:"onStart",slug:"onstart",children:[]},{level:3,title:"onExit",slug:"onexit",children:[]},{level:3,title:"onGenerateFiles",slug:"ongeneratefiles",children:[]},{level:3,title:"restartServer",slug:"restartserver",children:[]},{level:3,title:"writeTmpFile",slug:"writetmpfile",children:[]}]}],filePathRelative:"reference/plugin/dev/api.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},3221:(n,s,a)=>{a.r(s),a.d(s,{default:()=>y});var p=a(6252);const e=(0,p.uE)('

    插件 API

    属性

    api.paths

    一些关键的路径:

    • cwd,执行命令的绝对路径
    • absNodeModulesPath,nodeModule的绝对路径
    • absOutputPath,输出 build 产物的绝对路径
    • absSrcPath,src 目录的绝对路径
    • absPagesPath,pages目录的绝对路径
    • absTmpPath,.fes临时文件目录的绝对路径

    api.cwd

    执行命令的绝对路径

    api.pkg

    package.json的内容

    api.configInstance

    config实例

    userConfig

    用户配置

    config

    插件配置可被修改,此为最终的配置

    env

    process.env

    args

    环境变量

    核心方法

    describe

    注册阶段执行,用于描述插件或插件集的 id、key、配置信息、启用方式等。

    用法:describe({ id?: string, key?: string, config?: { default, schema, onChange } }, enableBy?)

    例如:

     api.describe({\n    key: 'esbuild',\n    config: {\n        schema(joi) {\n            return joi.object();\n        },\n        default: {}\n    },\n    enableBy: api.EnableBy.config,\n});\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    注:

    ',26),t=(0,p._)("li",null,[(0,p._)("code",null,"config.default"),(0,p.Uk)(" 为配置的默认值,用户没有配置时取这个")],-1),o=(0,p._)("code",null,"config.schema",-1),c={href:"https://hapi.dev/module/joi",target:"_blank",rel:"noopener noreferrer"},l=(0,p._)("li",null,[(0,p._)("code",null,"config.onChange"),(0,p.Uk)(" 是 "),(0,p._)("code",null,"dev"),(0,p.Uk)(" 阶段配置被修改后的处理机制,默认会重启 dev 进程,也可以修改为 api.ConfigChangeType.regenerateTmpFiles 只重新生成临时文件,还可以通过函数的格式自定义")],-1),i=(0,p._)("li",null,[(0,p._)("code",null,"enableBy"),(0,p.Uk)(" 为启用方式,默认是注册启用,可更改为 "),(0,p._)("code",null,"api.EnableBy.config"),(0,p.Uk)(",还可以用自定义函数的方式决定其启用时机(动态生效)")],-1),r=(0,p.uE)('

    register

    为 api.applyPlugins 注册可供其使用的 hook。

    用法:register({ key: string, fn: Function, pluginId?: string, before?: string, stage?: number })

    参数:

    • key:唯一id
    • fn:hook函数,当执行api.applyPlugins时,此函数被执行。
    • pluginId:插件id,如果配置了插件id,则只有此插件未被禁用时,才会执行。
    // 可同步\napi.register({\n  key: 'foo',\n  fn() {\n    return 'a';\n  },\n});\n\n// 可异步\napi.register({\n  key: 'foo',\n  async fn() {\n    await delay(100);\n    return 'b';\n  },\n});\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    注意:

    • fn 支持同步和异步,异步通过 Promise,返回值为 Promise 即为异步
    • fn 里的内容需结合 api.appyPluginstype 参数来看,如果是 api.ApplyPluginsType.add,需有返回值,这些返回值最终会被合成一个数组。如果是 api.ApplyPluginsType.modify,需对第一个参数做修改,并返回它,它会作为下个hook的参数。 如果是 api.ApplyPluginsType.event,无需返回值
    • stage 和 before 都是用于调整执行顺序的,参考 tapable
    • stage 默认是 0,设为 -1 或更少会提前执行,设为 1 或更多会后置执行

    applyPlugins

    取得 register 注册的 hooks 执行后的数据。

    用法:applyPlugins({ key: string, type: api.ApplyPluginsType, initialValue?: any, args?: any })

    参数:

    • key:唯一id
    • type:hook的类型。
    • initialValue:初始值。
    • args:参数,hook函数执行时,args会作为参数传入。

    例如:

    const foo = await api.applyPlugins({\n  key: 'foo',\n  type: api.ApplyPluginsType.add,\n  initialValue: [],\n});\nconsole.log(foo); // ['a', 'b']\n
    1
    2
    3
    4
    5
    6

    api.ApplyPluginsType

    编译时插件hook执行类型,enum 类型,包含三个属性:

    • compose,用于合并执行多个函数,函数可决定前序函数的执行时机
    • modify,用于修改值
    • event,用于执行事件,前面没有依赖关系

    registerMethod

    api 上注册方法。如果有提供 fn,则执行 fn 定义的函数。

    用法:registerMethod({ name: string, fn?: Function, exitsError?: boolean })

    例如:

     api.registerMethod({\n    name: 'writeTmpFile',\n    fn({\n        path,\n        content\n    }) {\n        assert(\n            api.stage >= api.ServiceStage.pluginReady,\n            'api.writeTmpFile() should not execute in register stage.'\n        );\n        const absPath = join(api.paths.absTmpPath, path);\n        api.utils.mkdirp.sync(dirname(absPath));\n        if (!existsSync(absPath) || readFileSync(absPath, 'utf-8') !== content) {\n            writeFileSync(absPath, content, 'utf-8');\n        }\n    }\n});\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

    然后在插件中可以使用:

    api.writeTmpFile()\n
    1

    registerCommand

    ',26),u={href:"https://github.com/tj/commander.js/",target:"_blank",rel:"noopener noreferrer"},d=(0,p._)("p",null,[(0,p.Uk)("用法:"),(0,p._)("strong",null,"registerCommand({ command: string, description: string, fn: Function, options?: Object })")],-1),k=(0,p._)("p",null,"参数:",-1),b=(0,p._)("li",null,"command",-1),m=(0,p._)("li",null,[(0,p.Uk)("description,描述文字,输入 "),(0,p._)("code",null,"--help"),(0,p.Uk)(" 会打印")],-1),g=(0,p._)("li",null,[(0,p.Uk)("fn,命令执行的函数,参数有: "),(0,p._)("ul",null,[(0,p._)("li",null,"rawArgv,原始参数"),(0,p._)("li",null,"args,参数"),(0,p._)("li",null,"options,执行命令时附带的的参数配置"),(0,p._)("li",null,"program,commander对象")])],-1),h={href:"https://github.com/tj/commander.js/",target:"_blank",rel:"noopener noreferrer"},f=(0,p.uE)('

    例如:

    api.registerCommand({\n    command: 'webpack',\n    description: 'inspect webpack configurations',\n    options: [{\n        name: '--rule <ruleName>',\n        description: 'inspect a specific module rule'\n    }, {\n        name: '--plugin <pluginName>',\n        description: 'inspect a specific plugin'\n    }, {\n        name: '--rules',\n        description: 'list all module rule names'\n    }, {\n        name: '--plugins',\n        description: 'list all plugin names'\n    }, {\n        name: '--verbose',\n        description: 'show full function definitions in output'\n    }],\n    async fn({ rawArgv, args, options, program}) {\n    }\n})\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    当项目引入此插件后,使用:

    fes webpack\n
    1

    registerPresets

    注册插件集,参数为路径数组。

    用法:registerPresets(presets: string[])

    例如:

    api.registerPresets([\n    { id: 'preset_2', key: 'preset2', apply: () => () => {} },\n    require.resolve('./preset_3'),\n]);\n
    1
    2
    3
    4

    registerPlugins

    注册插件,参数为路径数组。

    用法:registerPlugins(plugins: string[])

    例如:

    api.registerPlugins([\n    { id: 'preset_2', key: 'preset2', apply: () => () => {} },\n    require.resolve('./preset_3'),\n]);\n
    1
    2
    3
    4

    hasPlugins

    判断是否有注册某个插件,插件的 id 规则:

    • id 默认为包名
    • 内置插件以 @@ 为前缀,比如 @@/registerMethod

    用法:hasPlugins(pluginIds: string[])

    例如

    // 判断是否有注册 @fesjs/plugin-locale\napi.hasPlugins(['@fesjs/plugin-locale']);\n
    1
    2

    提示

    如果在注册阶段使用,只能判断在他之前是否有注册某个插件。

    hasPresets

    判断是否有注册某个插件集。

    用法:hasPresets(presetIds: string[])

    例如

    // 判断是否有注册\napi.hasPlugins(['@fesjs/preset-xxx']);\n
    1
    2

    提示

    如果在注册阶段使用,只能判断在他之前是否有注册某个插件集。

    skipPlugins

    声明哪些插件需要被禁用,参数为插件 id 的数组。

    用法:hasPresets(presetIds: string[])

    例如:

    // 禁用 plugin-model 插件\napi.skipPlugins(['@fesjs/plugin-model']);\n
    1
    2

    扩展方法

    通过 api.registerMethod() 扩展的方法。

    addPluginExports

    把插件需要导出的运行时 API 写入@fesjs/fes

    api.addPluginExports(() => [\n    {\n        specifiers: ['access', 'useAccess'],\n        source: absoluteFilePath\n    }\n]);\n
    1
    2
    3
    4
    5
    6

    这样用户使用时:

    import { access, useAccess } from '@fesjs/fes';\n
    1

    addCoreExports

    提供给其他插件运行时需要的 API。

    api.addCoreExports(() => [\n    {\n        specifiers: ['getRoutes'],\n        source: absCoreFilePath\n    }\n]);\n
    1
    2
    3
    4
    5
    6

    使用:

    import { getHistory, destroyRouter } from '@@/core/coreExports';\n
    1

    addRuntimePlugin

    添加运行时插件,返回值格式为表示文件路径的字符串。

    例如:

    api.addRuntimePlugin(() => join(__dirname, './runtime'));\n
    1

    addRuntimePluginKey

    添加插件提供的运行时配置的 key,返回值格式为字符串。

    例如:

    api.addRuntimePluginKey(() => 'some');\n
    1

    则用户可以:

    // app.js\nconst some = function(){\n    return {\n\n    }\n}\n\n
    1
    2
    3
    4
    5
    6
    7

    addEntryImportsAhead

    在入口文件现有 import 的前面添加 import。

    例如:

    api.addEntryImportsAhead(() => [{ source: 'anypackage' }]);\n
    1

    addEntryImports

    在入口文件现有 import 的后面添加 import。

    例如:

    api.addEntryImport(() => {\n  return [\n    {\n      source: '/modulePath/xxx.js',\n      specifier: 'moduleName',\n    }\n  ]\n});\n
    1
    2
    3
    4
    5
    6
    7
    8

    addEntryCodeAhead

    在入口文件最前面(import 之后)添加代码。

    例如:

    api.addEntryCodeAhead(\n    () => `${globalCSSFile\n        .map(file => `require('${winPath(relative(absTmpPath, file))}');`)\n        .join('')}`\n\n
    1
    2
    3
    4
    5

    addEntryCode

    在入口文件最后添加代码。

    例如:

    api.addEntryCode(() => {\n  return `console.log('works!')`\n})\n
    1
    2
    3

    addHTMLHeadScripts

    在 HTML 头部添加脚本。

    例如:

    api.addHTMLHeadScripts(() => {\n  return [\n    {\n      content: '',\n      src: '',\n      // ...attrs\n    },\n  ];\n});\n
    1
    2
    3
    4
    5
    6
    7
    8
    9

    addBeforeMiddlewares

    添加在 webpack compiler 中间件之前的中间件,返回值格式为 express 中间件。

    例如:

    api.addBeforeMiddlewares(() => {\n  return (req, res, next) => {\n    if (false) {\n      res.end('end');\n    } else {\n      next();\n    }\n  };\n});\n
    1
    2
    3
    4
    5
    6
    7
    8
    9

    addMiddlewares

    添加在 webpack compiler 中间件之后的中间件,返回值格式为 express 中间件。

    addTmpGenerateWatcherPaths

    添加重新生成临时文件的监听路径。

    例如:

    api.addTmpGenerateWatcherPaths(() => [\n    './app.js',\n]);\n
    1
    2
    3

    chainWebpack

    通过 [webpack-chain] 的方式修改 webpack 配置。

    例如:

    api.chainWebpack((memo) => {\n    memo.resolve.alias.set('vue-i18n', 'vue-i18n/dist/vue-i18n.esm-bundler.js');\n});\n
    1
    2
    3

    copyTmpFiles

    批量写临时文件。

    例如:

     api.copyTmpFiles({\n    namespace,\n    path: join(__dirname, 'runtime'),\n    ignore: ['.tpl']\n});\n
    1
    2
    3
    4
    5

    参数:

    • namespace:复制到临时文件夹下的目标目录
    • path:需要复制的文件目录
    • ignore:需要排除的文件

    提示

    不能在注册阶段使用,通常放在 api.onGenerateFiles() 里,这样能在需要时重新生成临时文件 临时文件的写入做了缓存处理,如果内容一致,不会做写的操作,以减少触发 webpack 的重新编译

    getPort

    获取端口号,dev 时有效。

    getHostname

    获取 hostname,dev 时有效。

    getServer

    获取 devServer,dev 时有效。

    getRoutes

    获取 api.modifyRoutes 修改过后的路由信息。

    getRoutesJSON

    获取格式化后的路由信息

    modifyRoutes

    修改路由。

    例如:

    // 把BaseLayout插入到路由配置中,作为根路由\napi.modifyRoutes(routes => [\n    {\n        path: '/',\n        component: winPath(\n            join(api.paths.absTmpPath || '', absFilePath)\n        ),\n        children: routes\n    }\n]);\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    modifyBundleConfigOpts

    修改获取 bundleConfig 的函数参数。

    例如:

    api.modifyBundleConfigOpts(memo => {\n    memo.miniCSSExtractPluginPath = require.resolve('mini-css-extract-plugin');\n    memo.miniCSSExtractPluginLoaderPath = require.resolve(\n    'mini-css-extract-plugin/dist/loader',\n    );\n    return memo;\n});\n\n
    1
    2
    3
    4
    5
    6
    7
    8

    modifyBundleConfig

    修改 bundle 配置。

    api.modifyBundleConfig((bundleConfig) => {\n    // do something\n    return bundleConfig;\n});\n
    1
    2
    3
    4

    modifyBabelOpts

    修改 babel 配置项。

    例如:

    api.modifyBabelOpts((babelOpts) => {\n    if (api.config.babelPluginImport) {\n        api.config.babelPluginImport.forEach((config) => {\n            babelOpts.plugins.push(['import', config]);\n        });\n    }\n    return babelOpts;\n});\n
    1
    2
    3
    4
    5
    6
    7
    8

    modifyBabelPresetOpts

    修改 babel 插件的配置。

    例如:

    api.modifyBabelPresetOpts(opts => {\n    return {\n      ...opts,\n      import: (opts.import || []).concat([\n        { libraryName: 'ant-design-vue', libraryDirectory: 'es', style: true },\n      ]),\n    };\n});\n
    1
    2
    3
    4
    5
    6
    7
    8

    modifyPaths

    修改 paths 对象。

    modifyDefaultConfig

    修改默认配置。 例如:

    api.modifyDefaultConfig((memo) => {\n  return {\n    ...memo,\n    ...defaultOptions,\n  };\n});\n
    1
    2
    3
    4
    5
    6

    modifyConfig

    修改最终配置。

    例如:

    api.modifyConfig((memo) => {\n  return {\n    ...memo,\n    ...defaultOptions,\n  };\n});\n\n
    1
    2
    3
    4
    5
    6
    7

    modifyPublicPathStr

    修改 publicPath 字符串。

    例如:

    api.modifyPublicPathStr(() => {\n  return api.config.publicPath || '/';\n});\n
    1
    2
    3

    onPluginReady

    在插件初始化完成触发。在 onStart 之前,此时还没有 config 和 paths,他们尚未解析好。

    onStart

    在命令注册函数执行前触发。可以使用 config 和 paths。

    onExit

    dev 退出时触发。

    onGenerateFiles

    生成临时文件,触发时机在 webpack 编译之前。

    restartServer

    重启 devServer,dev 时有效。

    writeTmpFile

    写临时文件。

    例如:

    api.writeTmpFile({\n    path: absoluteFilePath,\n    content: Mustache.render(\n        readFileSync(join(__dirname, 'runtime/core.tpl'), 'utf-8'),\n        {\n            REPLACE_ROLES: JSON.stringify(roles)\n        }\n    )\n});\n
    1
    2
    3
    4
    5
    6
    7
    8
    9

    参数:

    • path:相对于临时文件夹的路径
    • content:文件内容

    提示

    不能在注册阶段使用,通常放在 api.onGenerateFiles() 里,这样能在需要时重新生成临时文件 临时文件的写入做了缓存处理,如果内容一致,不会做写的操作,以减少触发 webpack 的重新编译

    ',154),v={},y=(0,a(3744).Z)(v,[["render",function(n,s){const a=(0,p.up)("OutboundLink");return(0,p.wg)(),(0,p.iD)(p.HY,null,[e,(0,p._)("ul",null,[t,(0,p._)("li",null,[o,(0,p.Uk)(" 用于声明配置的类型,基于 "),(0,p._)("a",c,[(0,p.Uk)("joi"),(0,p.Wm)(a)]),(0,p.Uk)(",如果你希望用户进行配置,这个是必须的,否则用户的配置无效")]),l,i]),r,(0,p._)("p",null,[(0,p.Uk)("注册命令,基于 "),(0,p._)("a",u,[(0,p.Uk)("commander"),(0,p.Wm)(a)]),(0,p.Uk)(" 实现的机制。")]),d,k,(0,p._)("ul",null,[b,m,g,(0,p._)("li",null,[(0,p.Uk)("options,参数配置,基于 "),(0,p._)("a",h,[(0,p.Uk)("commander"),(0,p.Wm)(a)]),(0,p.Uk)(" 。")])]),f],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const a=n.__vccOpts||n;for(const[n,p]of s)a[n]=p;return a}}}]); \ No newline at end of file diff --git a/assets/js/v-d61a9282.315b2b24.js b/assets/js/v-d61a9282.315b2b24.js new file mode 100644 index 00000000..dbf0c902 --- /dev/null +++ b/assets/js/v-d61a9282.315b2b24.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[783],{6811:(l,e,n)=>{n.r(e),n.d(e,{data:()=>u});const u={key:"v-d61a9282",path:"/reference/plugin/",title:"介绍",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"插件列表",slug:"插件列表",children:[]},{level:2,title:"架构",slug:"架构",children:[]}],filePathRelative:"reference/plugin/README.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},671:(l,e,n)=>{n.r(e),n.d(e,{default:()=>x});var u=n(6252);const t=(0,u._)("h1",{id:"介绍",tabindex:"-1"},[(0,u._)("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),(0,u.Uk)(" 介绍")],-1),s=(0,u._)("h2",{id:"插件列表",tabindex:"-1"},[(0,u._)("a",{class:"header-anchor",href:"#插件列表","aria-hidden":"true"},"#"),(0,u.Uk)(" 插件列表")],-1),r=(0,u._)("thead",null,[(0,u._)("tr",null,[(0,u._)("th",null,"插件"),(0,u._)("th",null,"介绍")])],-1),i=(0,u._)("td",null,"提供对页面资源的权限控制能力",-1),d=(0,u._)("td",null,"提供统一的枚举存取及丰富的函数来处理枚举",-1),_=(0,u._)("td",null,"svg 文件自动注册为组件",-1),a=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"Jest"),(0,u.Uk)(",提供单元测试、覆盖测试能力")],-1),c=(0,u._)("td",null,"简单的配置即可拥有布局,包括导航以及侧边栏",-1),f=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"Vue I18n"),(0,u.Uk)(",提供国际化能力")],-1),p=(0,u._)("td",null,"简易的数据管理方案",-1),o=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"Axios"),(0,u.Uk)(" 封装的 request,内置防止重复请求、请求节流、错误处理等功能")],-1),g=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"Vuex"),(0,u.Uk)(", 提供状态管理能力")],-1),m=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"qiankun"),(0,u.Uk)(",提供微服务能力")],-1),k=(0,u._)("td",null,"样式支持sass",-1),h=(0,u._)("td",null,[(0,u.Uk)("提供代码编辑器能力, 基于"),(0,u._)("code",null,"monaco-editor"),(0,u.Uk)("(VS Code使用的代码编辑器)")],-1),U=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"windicss"),(0,u.Uk)(",提供原子化 CSS 能力")],-1),w=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"pinia"),(0,u.Uk)(",提供状态管理")],-1),j=(0,u._)("td",null,"水印",-1),W=(0,u._)("h2",{id:"架构",tabindex:"-1"},[(0,u._)("a",{class:"header-anchor",href:"#架构","aria-hidden":"true"},"#"),(0,u.Uk)(" 架构")],-1),v=["src"],b=(0,u._)("p",null,"Fes.js 把大家常用的技术栈封装成一个个插件进行整理,收敛到一起,让大家只用 Fes.js 就可以完成 80% 的日常工作。",-1),q={},x=(0,n(3744).Z)(q,[["render",function(l,e){const n=(0,u.up)("RouterLink");return(0,u.wg)(),(0,u.iD)(u.HY,null,[t,s,(0,u._)("table",null,[r,(0,u._)("tbody",null,[(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/access.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-access")])),_:1})]),i]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/enums.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-enums")])),_:1})]),d]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/icon.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-icon")])),_:1})]),_]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/jest.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-jest")])),_:1})]),a]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/layout.html"},{default:(0,u.w5)((()=>[(0,u.Uk)(" @fesjs/plugin-layout")])),_:1})]),c]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/locale.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-locale")])),_:1})]),f]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/model.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-model")])),_:1})]),p]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/request.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-request")])),_:1})]),o]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/vuex.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-vuex")])),_:1})]),g]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/qiankun.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-qiankun")])),_:1})]),m]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/sass.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-sass")])),_:1})]),k]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/editor.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-monaco-editor")])),_:1})]),h]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/windicss.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-windicss")])),_:1})]),U]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/pinia.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-pinia")])),_:1})]),w]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/watermark.html"},{default:(0,u.w5)((()=>[(0,u.Uk)("@fesjs/plugin-watermark")])),_:1})]),j])])]),W,(0,u._)("img",{src:l.$withBase("framework.png"),alt:"架构"},null,8,v),b],64)}]])},3744:(l,e)=>{e.Z=(l,e)=>{const n=l.__vccOpts||l;for(const[l,u]of e)n[l]=u;return n}}}]); \ No newline at end of file diff --git a/assets/js/v-d61a9282.83f8c839.js b/assets/js/v-d61a9282.83f8c839.js deleted file mode 100644 index 9c06e1b5..00000000 --- a/assets/js/v-d61a9282.83f8c839.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[783],{6811:(l,e,n)=>{n.r(e),n.d(e,{data:()=>u});const u={key:"v-d61a9282",path:"/reference/plugin/",title:"介绍",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"插件列表",slug:"插件列表",children:[]},{level:2,title:"架构",slug:"架构",children:[]}],filePathRelative:"reference/plugin/README.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},671:(l,e,n)=>{n.r(e),n.d(e,{default:()=>J});var u=n(6252);const t=(0,u._)("h1",{id:"介绍",tabindex:"-1"},[(0,u._)("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),(0,u.Uk)(" 介绍")],-1),s=(0,u._)("h2",{id:"插件列表",tabindex:"-1"},[(0,u._)("a",{class:"header-anchor",href:"#插件列表","aria-hidden":"true"},"#"),(0,u.Uk)(" 插件列表")],-1),r=(0,u._)("thead",null,[(0,u._)("tr",null,[(0,u._)("th",null,"插件"),(0,u._)("th",null,"介绍")])],-1),i=(0,u.Uk)("@fesjs/plugin-access"),d=(0,u._)("td",null,"提供对页面资源的权限控制能力",-1),_=(0,u.Uk)("@fesjs/plugin-enums"),a=(0,u._)("td",null,"提供统一的枚举存取及丰富的函数来处理枚举",-1),c=(0,u.Uk)("@fesjs/plugin-icon"),f=(0,u._)("td",null,"svg 文件自动注册为组件",-1),p=(0,u.Uk)("@fesjs/plugin-jest"),o=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"Jest"),(0,u.Uk)(",提供单元测试、覆盖测试能力")],-1),g=(0,u.Uk)(" @fesjs/plugin-layout"),m=(0,u._)("td",null,"简单的配置即可拥有布局,包括导航以及侧边栏",-1),k=(0,u.Uk)("@fesjs/plugin-locale"),h=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"Vue I18n"),(0,u.Uk)(",提供国际化能力")],-1),U=(0,u.Uk)("@fesjs/plugin-model"),w=(0,u._)("td",null,"简易的数据管理方案",-1),j=(0,u.Uk)("@fesjs/plugin-request"),W=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"Axios"),(0,u.Uk)(" 封装的 request,内置防止重复请求、请求节流、错误处理等功能")],-1),v=(0,u.Uk)("@fesjs/plugin-vuex"),b=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"Vuex"),(0,u.Uk)(", 提供状态管理能力")],-1),q=(0,u.Uk)("@fesjs/plugin-qiankun"),x=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"qiankun"),(0,u.Uk)(",提供微服务能力")],-1),C=(0,u.Uk)("@fesjs/plugin-sass"),y=(0,u._)("td",null,"样式支持sass",-1),R=(0,u.Uk)("@fesjs/plugin-monaco-editor"),S=(0,u._)("td",null,[(0,u.Uk)("提供代码编辑器能力, 基于"),(0,u._)("code",null,"monaco-editor"),(0,u.Uk)("(VS Code使用的代码编辑器)")],-1),V=(0,u.Uk)("@fesjs/plugin-windicss"),A=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"windicss"),(0,u.Uk)(",提供原子化 CSS 能力")],-1),D=(0,u.Uk)("@fesjs/plugin-pinia"),E=(0,u._)("td",null,[(0,u.Uk)("基于 "),(0,u._)("code",null,"pinia"),(0,u.Uk)(",提供状态管理")],-1),F=(0,u.Uk)("@fesjs/plugin-watermark"),Z=(0,u._)("td",null,"水印",-1),z=(0,u._)("h2",{id:"架构",tabindex:"-1"},[(0,u._)("a",{class:"header-anchor",href:"#架构","aria-hidden":"true"},"#"),(0,u.Uk)(" 架构")],-1),B=["src"],H=(0,u._)("p",null,"Fes.js 把大家常用的技术栈封装成一个个插件进行整理,收敛到一起,让大家只用 Fes.js 就可以完成 80% 的日常工作。",-1),I={},J=(0,n(3744).Z)(I,[["render",function(l,e){const n=(0,u.up)("RouterLink");return(0,u.wg)(),(0,u.iD)(u.HY,null,[t,s,(0,u._)("table",null,[r,(0,u._)("tbody",null,[(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/access.html"},{default:(0,u.w5)((()=>[i])),_:1})]),d]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/enums.html"},{default:(0,u.w5)((()=>[_])),_:1})]),a]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/icon.html"},{default:(0,u.w5)((()=>[c])),_:1})]),f]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/jest.html"},{default:(0,u.w5)((()=>[p])),_:1})]),o]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/layout.html"},{default:(0,u.w5)((()=>[g])),_:1})]),m]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/locale.html"},{default:(0,u.w5)((()=>[k])),_:1})]),h]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/model.html"},{default:(0,u.w5)((()=>[U])),_:1})]),w]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/request.html"},{default:(0,u.w5)((()=>[j])),_:1})]),W]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/vuex.html"},{default:(0,u.w5)((()=>[v])),_:1})]),b]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/qiankun.html"},{default:(0,u.w5)((()=>[q])),_:1})]),x]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/sass.html"},{default:(0,u.w5)((()=>[C])),_:1})]),y]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/editor.html"},{default:(0,u.w5)((()=>[R])),_:1})]),S]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/windicss.html"},{default:(0,u.w5)((()=>[V])),_:1})]),A]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/pinia.html"},{default:(0,u.w5)((()=>[D])),_:1})]),E]),(0,u._)("tr",null,[(0,u._)("td",null,[(0,u.Wm)(n,{to:"/reference/plugin/plugins/watermark.html"},{default:(0,u.w5)((()=>[F])),_:1})]),Z])])]),z,(0,u._)("img",{src:l.$withBase("framework.png"),alt:"架构"},null,8,B),H],64)}]])},3744:(l,e)=>{e.Z=(l,e)=>{const n=l.__vccOpts||l;for(const[l,u]of e)n[l]=u;return n}}}]); \ No newline at end of file diff --git a/assets/js/v-d7fa887a.0bcd6154.js b/assets/js/v-d7fa887a.0bcd6154.js deleted file mode 100644 index 2bde0f50..00000000 --- a/assets/js/v-d7fa887a.0bcd6154.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[617],{4148:(e,a,s)=>{s.r(a),s.d(a,{data:()=>n});const n={key:"v-d7fa887a",path:"/guide/contributing.html",title:"贡献指南",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"包概览",slug:"包概览",children:[]},{level:2,title:"开发准备",slug:"开发准备",children:[]},{level:2,title:"贡献文档",slug:"贡献文档",children:[]},{level:2,title:"贡献源码",slug:"贡献源码",children:[]},{level:2,title:"提交PR",slug:"提交pr",children:[]}],filePathRelative:"guide/contributing.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5938:(e,a,s)=>{s.r(a),s.d(a,{default:()=>I});var n=s(6252);const l=(0,n._)("h1",{id:"贡献指南",tabindex:"-1"},[(0,n._)("a",{class:"header-anchor",href:"#贡献指南","aria-hidden":"true"},"#"),(0,n.Uk)(" 贡献指南")],-1),r=(0,n._)("h2",{id:"包概览",tabindex:"-1"},[(0,n._)("a",{class:"header-anchor",href:"#包概览","aria-hidden":"true"},"#"),(0,n.Uk)(" 包概览")],-1),c=(0,n.Uk)("项目仓库借助于 "),o={href:"https://classic.yarnpkg.com/zh-Hans/docs/workspaces",target:"_blank",rel:"noopener noreferrer"},i=(0,n.Uk)("Yarn 工作区"),t=(0,n.Uk)(" 来实现 "),d={href:"https://en.wikipedia.org/wiki/Monorepo",target:"_blank",rel:"noopener noreferrer"},p=(0,n.Uk)(" Monorepo"),u=(0,n.Uk)(" ,在 "),h=(0,n._)("code",null,"packages",-1),b=(0,n.Uk)(" 目录下存放多个互相关联的独立包。"),f=(0,n.uE)('
    • @fesjs/create-fes-app: 创建项目模板模块。提供create-fes-app命令,提供创建多种类型项目模板的能力。

    • @fesjs/compiler: 编译时插件管理模块。定义插件的生命周期、插件配置、插件通讯机制等。

    • @fesjs/runtime: 运行时插件模块。集成了vue-router,定义运行时插件生命周期、插件通讯机制。

    • @fesjs/preset-build-in: 内置插件集。包含devbuild等命令,集成webpack5+babel,提供方便编写插件的API,入口文件处理,路由处理等能力。

    • @fesjs/fes-template: 适用于PC类型的模板项目。

    • @fesjs/fes-template-h5: 适用于H5类型的模板项目。

    • @fesjs/plugin-${name}: 官方插件。

    • @fesjs/fes: 入口模块。提供fes命令和 API 入口,封装@fesjs/compiler + @fesjs/runtime + @fesjs/preset-build-in,用户只需要安装此依赖和其他插件。

    开发准备

    开发要求:

    ',3),m={href:"http://nodejs.org",target:"_blank",rel:"noopener noreferrer"},g=(0,n.Uk)("Node.js v14+"),k={href:"https://classic.yarnpkg.com/zh-Hans/docs/install",target:"_blank",rel:"noopener noreferrer"},v=(0,n.Uk)("Yarn v1"),_=(0,n._)("p",null,"本项目开发使用的一些主要工具:",-1),j={href:"https://jestjs.io/",target:"_blank",rel:"noopener noreferrer"},x=(0,n.Uk)("Jest"),U=(0,n.Uk)(" 用于单元测试"),w={href:"https://eslint.org/",target:"_blank",rel:"noopener noreferrer"},y=(0,n.Uk)("ESLint"),W=(0,n.Uk)(" + "),q={href:"https://prettier.io/",target:"_blank",rel:"noopener noreferrer"},P=(0,n.Uk)("Prettier"),z=(0,n.Uk)(" 用于代码检查和格式化"),E=(0,n.uE)('

    克隆仓库:

    git clone https://github.com/WeBankFinTech/fes.js.git\n
    1

    进入fes.js目录,安装依赖:

    yarn\n
    1

    贡献文档

    ',5),C=(0,n.Uk)("文档代码在"),H=(0,n._)("code",null,"docs",-1),R=(0,n.Uk)("目录,基于 "),A={href:"https://v2.vuepress.vuejs.org/zh/",target:"_blank",rel:"noopener noreferrer"},F=(0,n.Uk)("vuepress"),M=(0,n.Uk)(" 实现。"),Y=(0,n.uE)('

    第一步:启动服务

    yarn docs:dev\n
    1

    第二步:修改md文件

    菜单配置在/docs/.vuepress/configs/sidebar/zh.ts中,可以通过此配置找到对应想修改的文档。

    如果想添加图片,则可以先把图片添加至/docs/.vuepress/public,在代码中使用:

    <img :src="$withBase('framework.png')" alt="架构">\n
    1

    第三步:查看更新

    当md文档保存后,文档会自动更新,在http://localhost:8080/查看。

    贡献源码

    Fes.js统一使用ES Module规范编写源码,代码会在 node 端和浏览器端执行,所以源码需要编译后才能发布成包,再被执行。

    启动编译服务

    yarn dev\n
    1

    当我们修改build.config.js中配置的包代码时,会把src目录的源码编译后到lib目录。

    修改源码

    在了解Fes.js设计前提下,修改核心代码或者插件代码。

    验证修改内容

    根据需求选择模板项目来验证修改内容,比如选择fes-template

    1. 查看需待验证包是否已经添加到模板项目的依赖中,如果没有则在模板项目的 package.json 中添加包依赖,添加后在根目录执行yarn关联依赖
    2. 启动模板项目的开发服务
    cd packages/fes-template\nyarn dev\n
    1
    2
    1. 在项目模板中添加代码验证修改内容
    2. 打开localhost:8000查看结果

    快速调试技巧

    每次修改插件或者核心代码后,等待自动编译完,需要在模板目录重新执行fes dev,比较费时费力。

    可以先在模板的 .fes 目录中找到对应临时代码,更改逻辑,验证完后再将变更逻辑保存到正式文件中。

    注意

    直接修改临时文件切莫重新执行fes dev,修改会被覆盖。

    提交PR

    1. fork项目!
    2. 创建你的功能分支: git checkout -b my-new-feature
    3. 本地提交新代码: git commit -am 'Add some feature'
    4. 推送本地到服务器分支: git push origin my-new-feature
    5. 创建一个PR
    ',26),B={},I=(0,s(3744).Z)(B,[["render",function(e,a){const s=(0,n.up)("OutboundLink");return(0,n.wg)(),(0,n.iD)(n.HY,null,[l,r,(0,n._)("p",null,[c,(0,n._)("a",o,[i,(0,n.Wm)(s)]),t,(0,n._)("a",d,[p,(0,n.Wm)(s)]),u,h,b]),f,(0,n._)("ul",null,[(0,n._)("li",null,[(0,n._)("a",m,[g,(0,n.Wm)(s)])]),(0,n._)("li",null,[(0,n._)("a",k,[v,(0,n.Wm)(s)])])]),_,(0,n._)("ul",null,[(0,n._)("li",null,[(0,n._)("a",j,[x,(0,n.Wm)(s)]),U]),(0,n._)("li",null,[(0,n._)("a",w,[y,(0,n.Wm)(s)]),W,(0,n._)("a",q,[P,(0,n.Wm)(s)]),z])]),E,(0,n._)("p",null,[C,H,R,(0,n._)("a",A,[F,(0,n.Wm)(s)]),M]),Y],64)}]])},3744:(e,a)=>{a.Z=(e,a)=>{const s=e.__vccOpts||e;for(const[e,n]of a)s[e]=n;return s}}}]); \ No newline at end of file diff --git a/assets/js/v-d7fa887a.eec494da.js b/assets/js/v-d7fa887a.eec494da.js new file mode 100644 index 00000000..162530f6 --- /dev/null +++ b/assets/js/v-d7fa887a.eec494da.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[617],{4148:(e,a,s)=>{s.r(a),s.d(a,{data:()=>n});const n={key:"v-d7fa887a",path:"/guide/contributing.html",title:"贡献指南",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"包概览",slug:"包概览",children:[]},{level:2,title:"开发准备",slug:"开发准备",children:[]},{level:2,title:"贡献文档",slug:"贡献文档",children:[]},{level:2,title:"贡献源码",slug:"贡献源码",children:[]},{level:2,title:"提交PR",slug:"提交pr",children:[]}],filePathRelative:"guide/contributing.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5938:(e,a,s)=>{s.r(a),s.d(a,{default:()=>j});var n=s(6252);const l=(0,n._)("h1",{id:"贡献指南",tabindex:"-1"},[(0,n._)("a",{class:"header-anchor",href:"#贡献指南","aria-hidden":"true"},"#"),(0,n.Uk)(" 贡献指南")],-1),r=(0,n._)("h2",{id:"包概览",tabindex:"-1"},[(0,n._)("a",{class:"header-anchor",href:"#包概览","aria-hidden":"true"},"#"),(0,n.Uk)(" 包概览")],-1),c={href:"https://classic.yarnpkg.com/zh-Hans/docs/workspaces",target:"_blank",rel:"noopener noreferrer"},o={href:"https://en.wikipedia.org/wiki/Monorepo",target:"_blank",rel:"noopener noreferrer"},i=(0,n._)("code",null,"packages",-1),t=(0,n.uE)('
    • @fesjs/create-fes-app: 创建项目模板模块。提供create-fes-app命令,提供创建多种类型项目模板的能力。

    • @fesjs/compiler: 编译时插件管理模块。定义插件的生命周期、插件配置、插件通讯机制等。

    • @fesjs/runtime: 运行时插件模块。集成了vue-router,定义运行时插件生命周期、插件通讯机制。

    • @fesjs/preset-build-in: 内置插件集。包含devbuild等命令,集成webpack5+babel,提供方便编写插件的API,入口文件处理,路由处理等能力。

    • @fesjs/fes-template: 适用于PC类型的模板项目。

    • @fesjs/fes-template-h5: 适用于H5类型的模板项目。

    • @fesjs/plugin-${name}: 官方插件。

    • @fesjs/fes: 入口模块。提供fes命令和 API 入口,封装@fesjs/compiler + @fesjs/runtime + @fesjs/preset-build-in,用户只需要安装此依赖和其他插件。

    开发准备

    开发要求:

    ',3),d={href:"http://nodejs.org",target:"_blank",rel:"noopener noreferrer"},p={href:"https://classic.yarnpkg.com/zh-Hans/docs/install",target:"_blank",rel:"noopener noreferrer"},u=(0,n._)("p",null,"本项目开发使用的一些主要工具:",-1),h={href:"https://jestjs.io/",target:"_blank",rel:"noopener noreferrer"},b={href:"https://eslint.org/",target:"_blank",rel:"noopener noreferrer"},f={href:"https://prettier.io/",target:"_blank",rel:"noopener noreferrer"},m=(0,n.uE)('

    克隆仓库:

    git clone https://github.com/WeBankFinTech/fes.js.git\n
    1

    进入fes.js目录,安装依赖:

    yarn\n
    1

    贡献文档

    ',5),g=(0,n._)("code",null,"docs",-1),k={href:"https://v2.vuepress.vuejs.org/zh/",target:"_blank",rel:"noopener noreferrer"},v=(0,n.uE)('

    第一步:启动服务

    yarn docs:dev\n
    1

    第二步:修改md文件

    菜单配置在/docs/.vuepress/configs/sidebar/zh.ts中,可以通过此配置找到对应想修改的文档。

    如果想添加图片,则可以先把图片添加至/docs/.vuepress/public,在代码中使用:

    <img :src="$withBase('framework.png')" alt="架构">\n
    1

    第三步:查看更新

    当md文档保存后,文档会自动更新,在http://localhost:8080/查看。

    贡献源码

    Fes.js统一使用ES Module规范编写源码,代码会在 node 端和浏览器端执行,所以源码需要编译后才能发布成包,再被执行。

    启动编译服务

    yarn dev\n
    1

    当我们修改build.config.js中配置的包代码时,会把src目录的源码编译后到lib目录。

    修改源码

    在了解Fes.js设计前提下,修改核心代码或者插件代码。

    验证修改内容

    根据需求选择模板项目来验证修改内容,比如选择fes-template

    1. 查看需待验证包是否已经添加到模板项目的依赖中,如果没有则在模板项目的 package.json 中添加包依赖,添加后在根目录执行yarn关联依赖
    2. 启动模板项目的开发服务
    cd packages/fes-template\nyarn dev\n
    1
    2
    1. 在项目模板中添加代码验证修改内容
    2. 打开localhost:8000查看结果

    快速调试技巧

    每次修改插件或者核心代码后,等待自动编译完,需要在模板目录重新执行fes dev,比较费时费力。

    可以先在模板的 .fes 目录中找到对应临时代码,更改逻辑,验证完后再将变更逻辑保存到正式文件中。

    注意

    直接修改临时文件切莫重新执行fes dev,修改会被覆盖。

    提交PR

    1. fork项目!
    2. 创建你的功能分支: git checkout -b my-new-feature
    3. 本地提交新代码: git commit -am 'Add some feature'
    4. 推送本地到服务器分支: git push origin my-new-feature
    5. 创建一个PR
    ',26),_={},j=(0,s(3744).Z)(_,[["render",function(e,a){const s=(0,n.up)("OutboundLink");return(0,n.wg)(),(0,n.iD)(n.HY,null,[l,r,(0,n._)("p",null,[(0,n.Uk)("项目仓库借助于 "),(0,n._)("a",c,[(0,n.Uk)("Yarn 工作区"),(0,n.Wm)(s)]),(0,n.Uk)(" 来实现 "),(0,n._)("a",o,[(0,n.Uk)(" Monorepo"),(0,n.Wm)(s)]),(0,n.Uk)(" ,在 "),i,(0,n.Uk)(" 目录下存放多个互相关联的独立包。")]),t,(0,n._)("ul",null,[(0,n._)("li",null,[(0,n._)("a",d,[(0,n.Uk)("Node.js v14+"),(0,n.Wm)(s)])]),(0,n._)("li",null,[(0,n._)("a",p,[(0,n.Uk)("Yarn v1"),(0,n.Wm)(s)])])]),u,(0,n._)("ul",null,[(0,n._)("li",null,[(0,n._)("a",h,[(0,n.Uk)("Jest"),(0,n.Wm)(s)]),(0,n.Uk)(" 用于单元测试")]),(0,n._)("li",null,[(0,n._)("a",b,[(0,n.Uk)("ESLint"),(0,n.Wm)(s)]),(0,n.Uk)(" + "),(0,n._)("a",f,[(0,n.Uk)("Prettier"),(0,n.Wm)(s)]),(0,n.Uk)(" 用于代码检查和格式化")])]),m,(0,n._)("p",null,[(0,n.Uk)("文档代码在"),g,(0,n.Uk)("目录,基于 "),(0,n._)("a",k,[(0,n.Uk)("vuepress"),(0,n.Wm)(s)]),(0,n.Uk)(" 实现。")]),v],64)}]])},3744:(e,a)=>{a.Z=(e,a)=>{const s=e.__vccOpts||e;for(const[e,n]of a)s[e]=n;return s}}}]); \ No newline at end of file diff --git a/assets/js/v-ef8c5e10.01694dac.js b/assets/js/v-ef8c5e10.01694dac.js new file mode 100644 index 00000000..d5f3e211 --- /dev/null +++ b/assets/js/v-ef8c5e10.01694dac.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[276],{9812:(e,a,s)=>{s.r(a),s.d(a,{data:()=>n});const n={key:"v-ef8c5e10",path:"/guide/env.html",title:"环境变量",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"配置环境变量",slug:"配置环境变量",children:[{level:3,title:"命令行添加",slug:"命令行添加",children:[]},{level:3,title:".env 文件配置",slug:"env-文件配置",children:[]}]},{level:2,title:"编译时配置列表",slug:"编译时配置列表",children:[{level:3,title:"FES_ENV",slug:"fes-env",children:[]},{level:3,title:"FES_PRESETS",slug:"fes-presets",children:[]},{level:3,title:"FES_PLUGINS",slug:"fes-plugins",children:[]},{level:3,title:"PORT",slug:"port",children:[]},{level:3,title:"HOST",slug:"host",children:[]},{level:3,title:"HTTPS",slug:"https",children:[]},{level:3,title:"WATCH",slug:"watch",children:[]},{level:3,title:"BABEL_CACHE",slug:"babel-cache",children:[]},{level:3,title:"ANALYZE",slug:"analyze",children:[]},{level:3,title:"ANALYZE_MODE",slug:"analyze-mode",children:[]},{level:3,title:"ANALYZE_PORT",slug:"analyze-port",children:[]},{level:3,title:"CLEAR_OUTPUT",slug:"clear-output",children:[]},{level:3,title:"RM_TMPDIR",slug:"rm-tmpdir",children:[]}]},{level:2,title:"process.env",slug:"process-env",children:[]}],filePathRelative:"guide/env.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},3125:(e,a,s)=>{s.r(a),s.d(a,{default:()=>o});var n=s(6252);const l=(0,n.uE)('

    环境变量

    在构建或者代码在端上运行中需要一些跟区分于环境的变量,用于配置构建流程或者运行时过程,这时候我们可以配置环境变量。

    配置环境变量

    命令行添加

    比如:

    # OS X, Linux\nPORT=3000 fes dev\n\n# Windows (cmd.exe)\nset PORT=3000 && fes dev\n
    1
    2
    3
    4
    5
    ',6),r={href:"https://github.com/kentcdodds/cross-env",target:"_blank",rel:"noopener noreferrer"},d=(0,n._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,n._)("pre",{class:"language-bash"},[(0,n._)("code",null,[(0,n._)("span",{class:"token function"},"yarn"),(0,n.Uk)(),(0,n._)("span",{class:"token function"},"add"),(0,n.Uk)(" cross-env "),(0,n._)("span",{class:"token parameter variable"},"--dev"),(0,n.Uk)("\ncross-env "),(0,n._)("span",{class:"token assign-left variable"},"PORT"),(0,n._)("span",{class:"token operator"},"="),(0,n._)("span",{class:"token number"},"3000"),(0,n.Uk)(" fes dev\n")])]),(0,n._)("div",{class:"line-numbers"},[(0,n._)("span",{class:"line-number"},"1"),(0,n._)("br"),(0,n._)("span",{class:"line-number"},"2"),(0,n._)("br")])],-1),c=(0,n._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,n._)("pre",{class:"language-bash"},[(0,n._)("code",null,[(0,n._)("span",{class:"token function"},"npm"),(0,n.Uk)(" i cross-env --save-dev\ncross-env "),(0,n._)("span",{class:"token assign-left variable"},"PORT"),(0,n._)("span",{class:"token operator"},"="),(0,n._)("span",{class:"token number"},"3000"),(0,n.Uk)(" fes dev\n")])]),(0,n._)("div",{class:"line-numbers"},[(0,n._)("span",{class:"line-number"},"1"),(0,n._)("br"),(0,n._)("span",{class:"line-number"},"2"),(0,n._)("br")])],-1),t=(0,n.uE)('

    .env 文件配置

    Fes.js 中约定根目录下以 .env 开头的文件为环境变量配置文件。

    比如:

    PORT=3000\n
    1

    然后执行

    fes dev\n
    1

    会以 3000 端口启动 dev server。

    本地临时配置

    可以新建 .env.local,这份配置会和 .env 做合并后形成最终配置。

    环境配置

    可以通过环境变量 FES_ENV 区分不同环境来指定配置,这时候必须在执行命令前添加 FES_ENV 保证执行加载环境变量配置文件逻辑前 FES_ENV 已设置。

    举个 🌰 :

    FES_ENV=sit fes dev\n
    1

    如果存在 .env.sit 文件,则会将 .env.sit 的配置和 .env 做合并后形成最终配置。

    配置优先级

    本地临时配置 > 环境配置 > 基础配置

    提示

    如果多份配置中存在相同的配置项,则优先级高的会覆盖优先级低的

    编译时配置列表

    编译时配置是在构建过程需要的变量,开放给用户配置。

    FES_ENV

    指定当前的环境,不同环境各自的配置文件。

    提示

    FES_ENV 在会在加载.env前使用,所以只能用命令行方式配置。

    FES_PRESETS

    添加额外的插件集入口

    FES_PLUGINS

    添加额外的插件入口

    PORT

    fes dev 时服务指定的端口号,默认是 8080

    HOST

    默认是 localhost

    HTTPS

    默认是 false

    WATCH

    设为 none 时不监听文件变更。比如:

    WATCH=none fes dev\n
    1

    BABEL_CACHE

    默认开启 Babel 编译缓存,值为 none 时禁用缓存。

    ANALYZE

    用于分析 bundle 构成,默认关闭。

    比如:

    ANALYZE=1 fes build\n
    1

    ANALYZE_MODE

    默认是server

    ANALYZE_PORT

    默认是8888

    CLEAR_OUTPUT

    仅仅在 build 时生效。如果设置为 none,就不会在构建前清除 Output 文件内容。

    RM_TMPDIR

    仅仅在 build 时生效。如果设置为 none,就不会在构建后清除 .fes 临时文件内容。

    process.env

    运行时配置需要以 FES_APP_ 开头,比如在 .env 中配置:

    FES_APP_KEY=123456789\n
    1

    在代码中使用:

    console.log(process.env.FES_APP_KEY)\n// 输出 123456789\n
    1
    2

    除了用户自定义的以FES_APP_开头的变量,还提供如下配置:

    • NODE_ENV:Node 环境变量

    • FES_ENV:Fes.js 环境变量

    • BASE_URL:等同于 publicPath

    ',56),i={},o=(0,s(3744).Z)(i,[["render",function(e,a){const s=(0,n.up)("OutboundLink"),i=(0,n.up)("CodeGroupItem"),o=(0,n.up)("CodeGroup");return(0,n.wg)(),(0,n.iD)(n.HY,null,[l,(0,n._)("p",null,[(0,n.Uk)("如果要同时考虑 OS X 和 Windows,可借助三方工具 "),(0,n._)("a",r,[(0,n.Uk)("cross-env"),(0,n.Wm)(s)])]),(0,n.Wm)(o,null,{default:(0,n.w5)((()=>[(0,n.Wm)(i,{title:"YARN",active:""},{default:(0,n.w5)((()=>[d])),_:1}),(0,n.Wm)(i,{title:"NPM"},{default:(0,n.w5)((()=>[c])),_:1})])),_:1}),t],64)}]])},3744:(e,a)=>{a.Z=(e,a)=>{const s=e.__vccOpts||e;for(const[e,n]of a)s[e]=n;return s}}}]); \ No newline at end of file diff --git a/assets/js/v-ef8c5e10.9585488a.js b/assets/js/v-ef8c5e10.9585488a.js deleted file mode 100644 index 068056a5..00000000 --- a/assets/js/v-ef8c5e10.9585488a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[276],{9812:(e,a,s)=>{s.r(a),s.d(a,{data:()=>n});const n={key:"v-ef8c5e10",path:"/guide/env.html",title:"环境变量",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"配置环境变量",slug:"配置环境变量",children:[{level:3,title:"命令行添加",slug:"命令行添加",children:[]},{level:3,title:".env 文件配置",slug:"env-文件配置",children:[]}]},{level:2,title:"编译时配置列表",slug:"编译时配置列表",children:[{level:3,title:"FES_ENV",slug:"fes-env",children:[]},{level:3,title:"FES_PRESETS",slug:"fes-presets",children:[]},{level:3,title:"FES_PLUGINS",slug:"fes-plugins",children:[]},{level:3,title:"PORT",slug:"port",children:[]},{level:3,title:"HOST",slug:"host",children:[]},{level:3,title:"HTTPS",slug:"https",children:[]},{level:3,title:"WATCH",slug:"watch",children:[]},{level:3,title:"BABEL_CACHE",slug:"babel-cache",children:[]},{level:3,title:"ANALYZE",slug:"analyze",children:[]},{level:3,title:"ANALYZE_MODE",slug:"analyze-mode",children:[]},{level:3,title:"ANALYZE_PORT",slug:"analyze-port",children:[]},{level:3,title:"CLEAR_OUTPUT",slug:"clear-output",children:[]},{level:3,title:"RM_TMPDIR",slug:"rm-tmpdir",children:[]}]},{level:2,title:"process.env",slug:"process-env",children:[]}],filePathRelative:"guide/env.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},3125:(e,a,s)=>{s.r(a),s.d(a,{default:()=>h});var n=s(6252);const l=(0,n.uE)('

    环境变量

    在构建或者代码在端上运行中需要一些跟区分于环境的变量,用于配置构建流程或者运行时过程,这时候我们可以配置环境变量。

    配置环境变量

    命令行添加

    比如:

    # OS X, Linux\nPORT=3000 fes dev\n\n# Windows (cmd.exe)\nset PORT=3000 && fes dev\n
    1
    2
    3
    4
    5
    ',6),r=(0,n.Uk)("如果要同时考虑 OS X 和 Windows,可借助三方工具 "),d={href:"https://github.com/kentcdodds/cross-env",target:"_blank",rel:"noopener noreferrer"},c=(0,n.Uk)("cross-env"),t=(0,n._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,n._)("pre",{class:"language-bash"},[(0,n._)("code",null,[(0,n._)("span",{class:"token function"},"yarn"),(0,n.Uk)(),(0,n._)("span",{class:"token function"},"add"),(0,n.Uk)(" cross-env "),(0,n._)("span",{class:"token parameter variable"},"--dev"),(0,n.Uk)("\ncross-env "),(0,n._)("span",{class:"token assign-left variable"},"PORT"),(0,n._)("span",{class:"token operator"},"="),(0,n._)("span",{class:"token number"},"3000"),(0,n.Uk)(" fes dev\n")])]),(0,n._)("div",{class:"line-numbers"},[(0,n._)("span",{class:"line-number"},"1"),(0,n._)("br"),(0,n._)("span",{class:"line-number"},"2"),(0,n._)("br")])],-1),i=(0,n._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,n._)("pre",{class:"language-bash"},[(0,n._)("code",null,[(0,n._)("span",{class:"token function"},"npm"),(0,n.Uk)(" i cross-env --save-dev\ncross-env "),(0,n._)("span",{class:"token assign-left variable"},"PORT"),(0,n._)("span",{class:"token operator"},"="),(0,n._)("span",{class:"token number"},"3000"),(0,n.Uk)(" fes dev\n")])]),(0,n._)("div",{class:"line-numbers"},[(0,n._)("span",{class:"line-number"},"1"),(0,n._)("br"),(0,n._)("span",{class:"line-number"},"2"),(0,n._)("br")])],-1),o=(0,n.uE)('

    .env 文件配置

    Fes.js 中约定根目录下以 .env 开头的文件为环境变量配置文件。

    比如:

    PORT=3000\n
    1

    然后执行

    fes dev\n
    1

    会以 3000 端口启动 dev server。

    本地临时配置

    可以新建 .env.local,这份配置会和 .env 做合并后形成最终配置。

    环境配置

    可以通过环境变量 FES_ENV 区分不同环境来指定配置,这时候必须在执行命令前添加 FES_ENV 保证执行加载环境变量配置文件逻辑前 FES_ENV 已设置。

    举个 🌰 :

    FES_ENV=sit fes dev\n
    1

    如果存在 .env.sit 文件,则会将 .env.sit 的配置和 .env 做合并后形成最终配置。

    配置优先级

    本地临时配置 > 环境配置 > 基础配置

    提示

    如果多份配置中存在相同的配置项,则优先级高的会覆盖优先级低的

    编译时配置列表

    编译时配置是在构建过程需要的变量,开放给用户配置。

    FES_ENV

    指定当前的环境,不同环境各自的配置文件。

    提示

    FES_ENV 在会在加载.env前使用,所以只能用命令行方式配置。

    FES_PRESETS

    添加额外的插件集入口

    FES_PLUGINS

    添加额外的插件入口

    PORT

    fes dev 时服务指定的端口号,默认是 8080

    HOST

    默认是 localhost

    HTTPS

    默认是 false

    WATCH

    设为 none 时不监听文件变更。比如:

    WATCH=none fes dev\n
    1

    BABEL_CACHE

    默认开启 Babel 编译缓存,值为 none 时禁用缓存。

    ANALYZE

    用于分析 bundle 构成,默认关闭。

    比如:

    ANALYZE=1 fes build\n
    1

    ANALYZE_MODE

    默认是server

    ANALYZE_PORT

    默认是8888

    CLEAR_OUTPUT

    仅仅在 build 时生效。如果设置为 none,就不会在构建前清除 Output 文件内容。

    RM_TMPDIR

    仅仅在 build 时生效。如果设置为 none,就不会在构建后清除 .fes 临时文件内容。

    process.env

    运行时配置需要以 FES_APP_ 开头,比如在 .env 中配置:

    FES_APP_KEY=123456789\n
    1

    在代码中使用:

    console.log(process.env.FES_APP_KEY)\n// 输出 123456789\n
    1
    2

    除了用户自定义的以FES_APP_开头的变量,还提供如下配置:

    • NODE_ENV:Node 环境变量

    • FES_ENV:Fes.js 环境变量

    • BASE_URL:等同于 publicPath

    ',56),p={},h=(0,s(3744).Z)(p,[["render",function(e,a){const s=(0,n.up)("OutboundLink"),p=(0,n.up)("CodeGroupItem"),h=(0,n.up)("CodeGroup");return(0,n.wg)(),(0,n.iD)(n.HY,null,[l,(0,n._)("p",null,[r,(0,n._)("a",d,[c,(0,n.Wm)(s)])]),(0,n.Wm)(h,null,{default:(0,n.w5)((()=>[(0,n.Wm)(p,{title:"YARN",active:""},{default:(0,n.w5)((()=>[t])),_:1}),(0,n.Wm)(p,{title:"NPM"},{default:(0,n.w5)((()=>[i])),_:1})])),_:1}),o],64)}]])},3744:(e,a)=>{a.Z=(e,a)=>{const s=e.__vccOpts||e;for(const[e,n]of a)s[e]=n;return s}}}]); \ No newline at end of file diff --git a/assets/js/v-fb0f0066.5c369786.js b/assets/js/v-fb0f0066.5c369786.js deleted file mode 100644 index f2e82852..00000000 --- a/assets/js/v-fb0f0066.5c369786.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[170],{3866:(n,s,e)=>{e.r(s),e.d(s,{data:()=>a});const a={key:"v-fb0f0066",path:"/guide/getting-started.html",title:"快速上手",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"依赖环境",slug:"依赖环境",children:[]},{level:2,title:"创建项目",slug:"创建项目",children:[]},{level:2,title:"启动项目",slug:"启动项目",children:[]},{level:2,title:"部署发布",slug:"部署发布",children:[{level:3,title:"构建",slug:"构建",children:[]},{level:3,title:"本地验证",slug:"本地验证",children:[]},{level:3,title:"部署",slug:"部署",children:[]}]}],filePathRelative:"guide/getting-started.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},2204:(n,s,e)=>{e.r(s),e.d(s,{default:()=>X});var a=e(6252);const l=(0,a._)("h1",{id:"快速上手",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#快速上手","aria-hidden":"true"},"#"),(0,a.Uk)(" 快速上手")],-1),r=(0,a._)("h2",{id:"依赖环境",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#依赖环境","aria-hidden":"true"},"#"),(0,a.Uk)(" 依赖环境")],-1),c=(0,a.Uk)("首先得有 "),i={href:"https://nodejs.org/",target:"_blank",rel:"noopener noreferrer"},p=(0,a.Uk)("Node.js"),u=(0,a.Uk)(",并确保 node 版本是 10.13 或以上。"),t=(0,a.uE)('
    # 打印 node 版本\nnode -v\nv10.13.0\n
    1
    2
    3

    推荐使用 yarn 管理 npm 依赖

    # 全局安装 yarn\nnpm i yarn -g\n
    1
    2

    创建项目

    这一章节会帮助你从头搭建一个简单的 Fes.js 前端应用。

    步骤1 创建工作空间

    如果工作空间不存在,则先创建:

    # 创建目录 workspace\nmkdir workspace\n# 进入目录 workspace\ncd workspace\n
    1
    2
    3
    4

    如果工作空间已存在,则直接进入

    # 进入目录 workspace\ncd workspace\n
    1
    2
    步骤2 在工作空间创建项目
    ',11),b=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" create @fesjs/fes-app myapp\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br")])],-1),_=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\nnpx @fesjs/create-fes-app myapp\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br")])],-1),d=(0,a._)("p",null,[(0,a.Uk)("如果项目文件夹 "),(0,a._)("code",null,"workspace/myapp"),(0,a.Uk)(" 已经存在,会提示目录已存在:")],-1),o=["src"],m=(0,a._)("p",null,"你可以选择:",-1),k=(0,a._)("ul",null,[(0,a._)("li",null,[(0,a._)("code",null,"Overwrite"),(0,a.Uk)(" 删除项目文件夹,重新创建项目。")]),(0,a._)("li",null,[(0,a._)("code",null,"Merge"),(0,a.Uk)(" 保留原项目文件夹,存在相同文件则用模板文件覆盖当前目录文件。")])],-1),h=(0,a.Uk)("当选择 "),g=(0,a._)("code",null,"Overwrite",-1),v=(0,a.Uk)(" 或者 "),f=(0,a._)("code",null,"Merge",-1),U=(0,a.Uk)(" 或者项目目录 "),w=(0,a._)("code",null,"workspace/myapp",-1),x=(0,a.Uk)(" 不存在,会提示选取一个 "),y=(0,a._)("code",null,"template",-1),W=(0,a.Uk)(": "),C=["src"],N=(0,a._)("p",null,[(0,a.Uk)("你可以选默认适用于中后台前端应用的 "),(0,a._)("code",null,"PC"),(0,a.Uk)(" 类型,也可以选适用于移动端的 "),(0,a._)("code",null,"H5"),(0,a.Uk)(" 类型。")],-1),j=(0,a._)("h5",{id:"步骤3-安装依赖",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#步骤3-安装依赖","aria-hidden":"true"},"#"),(0,a.Uk)(" 步骤3 安装依赖")],-1),M=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 进入项目目录"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token builtin class-name"},"cd"),(0,a.Uk)(" myapp\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" \n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br")])],-1),A=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 进入项目目录"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token builtin class-name"},"cd"),(0,a.Uk)(" myapp\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" i \n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br")])],-1),O=(0,a._)("h2",{id:"启动项目",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#启动项目","aria-hidden":"true"},"#"),(0,a.Uk)(" 启动项目")],-1),P=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 开发调试"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" dev\n\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" run v1.22.4\n$ fes dev\nStarting the development server http://localhost:8080 "),(0,a._)("span",{class:"token punctuation"},".."),(0,a.Uk)(".\n\n✔ Webpack\n Compiled successfully "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"15"),(0,a.Uk)(".91s\n\n DONE Compiled successfully "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(" 15917ms "),(0,a._)("span",{class:"token number"},"11"),(0,a.Uk)(":17:08 AM\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"11"),(0,a._)("br")])],-1),R=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 开发调试"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" run dev\n\n"),(0,a._)("span",{class:"token operator"},">"),(0,a.Uk)(" fes dev\nStarting the development server http://localhost:8080 "),(0,a._)("span",{class:"token punctuation"},".."),(0,a.Uk)(".\n\n✔ Webpack\n Compiled successfully "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"3"),(0,a.Uk)(".66s\n\n DONE Compiled successfully "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(" 3662ms "),(0,a._)("span",{class:"token number"},"11"),(0,a.Uk)(":17:46 AM\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br")])],-1),Y=(0,a.Uk)("Fes.js 会在 "),$={href:"http://localhost:8080",target:"_blank",rel:"noopener noreferrer"},D=(0,a.Uk)("http://localhost:8080"),E=(0,a.Uk)(" 启动一个热重载的开发服务器。当你修改你的 .vue 文件时,浏览器中的内容也会自动更新。"),T=["src"],B=(0,a._)("h2",{id:"部署发布",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#部署发布","aria-hidden":"true"},"#"),(0,a.Uk)(" 部署发布")],-1),q=(0,a._)("h3",{id:"构建",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#构建","aria-hidden":"true"},"#"),(0,a.Uk)(" 构建")],-1),F=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 构建"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" build\n\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" run v1.22.4\n$ fes build\n\n✔ Webpack\n Compiled successfully "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"45"),(0,a.Uk)(".37s\n\n✨ Done "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"48"),(0,a.Uk)(".87s.\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br")])],-1),G=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 构建"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" run build\n\n"),(0,a._)("span",{class:"token operator"},">"),(0,a.Uk)(" fes build\n\n✔ Webpack\n Compiled successfully "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"45"),(0,a.Uk)(".37s\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br")])],-1),H=(0,a.uE)('

    构建产物默认生成到 ./dist 下,然后通过 tree 命令查看。

    tree ./dist\n\ndist\n├── chunk-vendors.27cd4686.js\n├── chunk-vendors.a5f5de67.css\n├── index.11411d43.css\n├── index.d72f1ba2.js\n├── index.html\n├── logo.png\n└── static\n    └── logo.0f85bba0.png\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    本地验证

    ',3),S=(0,a.Uk)("发布之前,可以通过 "),Z={href:"https://github.com/vercel/serve",target:"_blank",rel:"noopener noreferrer"},z=(0,a.Uk)("serve"),I=(0,a.Uk)(" 做本地验证,验证结果应该跟执行 "),L=(0,a._)("code",null,"fes dev",-1),J=(0,a.Uk)(" 的结果一样。"),K=(0,a._)("h3",{id:"部署",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#部署","aria-hidden":"true"},"#"),(0,a.Uk)(" 部署")],-1),Q=(0,a._)("p",null,"本地验证完,就可以部署了。你需要把 dist 目录部署到服务器上。",-1),V={},X=(0,e(3744).Z)(V,[["render",function(n,s){const e=(0,a.up)("OutboundLink"),V=(0,a.up)("CodeGroupItem"),X=(0,a.up)("CodeGroup");return(0,a.wg)(),(0,a.iD)(a.HY,null,[l,r,(0,a._)("p",null,[c,(0,a._)("a",i,[p,(0,a.Wm)(e)]),u]),t,(0,a.Wm)(X,null,{default:(0,a.w5)((()=>[(0,a.Wm)(V,{title:"YARN",active:""},{default:(0,a.w5)((()=>[b])),_:1}),(0,a.Wm)(V,{title:"NPM"},{default:(0,a.w5)((()=>[_])),_:1})])),_:1}),d,(0,a._)("img",{src:n.$withBase("pickTemplateTip.png"),alt:"目录已存在提示"},null,8,o),m,k,(0,a._)("p",null,[h,g,v,f,U,w,x,y,W,(0,a._)("img",{src:n.$withBase("pickTemplate.png"),alt:"选择模板类型"},null,8,C)]),N,j,(0,a.Wm)(X,null,{default:(0,a.w5)((()=>[(0,a.Wm)(V,{title:"YARN",active:""},{default:(0,a.w5)((()=>[M])),_:1}),(0,a.Wm)(V,{title:"NPM"},{default:(0,a.w5)((()=>[A])),_:1})])),_:1}),O,(0,a.Wm)(X,null,{default:(0,a.w5)((()=>[(0,a.Wm)(V,{title:"YARN",active:""},{default:(0,a.w5)((()=>[P])),_:1}),(0,a.Wm)(V,{title:"NPM"},{default:(0,a.w5)((()=>[R])),_:1})])),_:1}),(0,a._)("p",null,[Y,(0,a._)("a",$,[D,(0,a.Wm)(e)]),E]),(0,a._)("img",{src:n.$withBase("home.png"),alt:"home"},null,8,T),B,q,(0,a.Wm)(X,null,{default:(0,a.w5)((()=>[(0,a.Wm)(V,{title:"YARN",active:""},{default:(0,a.w5)((()=>[F])),_:1}),(0,a.Wm)(V,{title:"NPM"},{default:(0,a.w5)((()=>[G])),_:1})])),_:1}),H,(0,a._)("p",null,[S,(0,a._)("a",Z,[z,(0,a.Wm)(e)]),I,L,J]),K,Q],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const e=n.__vccOpts||n;for(const[n,a]of s)e[n]=a;return e}}}]); \ No newline at end of file diff --git a/assets/js/v-fb0f0066.f066a234.js b/assets/js/v-fb0f0066.f066a234.js new file mode 100644 index 00000000..5b95dd2b --- /dev/null +++ b/assets/js/v-fb0f0066.f066a234.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[170],{3866:(n,s,e)=>{e.r(s),e.d(s,{data:()=>a});const a={key:"v-fb0f0066",path:"/guide/getting-started.html",title:"快速上手",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"依赖环境",slug:"依赖环境",children:[]},{level:2,title:"创建项目",slug:"创建项目",children:[]},{level:2,title:"启动项目",slug:"启动项目",children:[]},{level:2,title:"部署发布",slug:"部署发布",children:[{level:3,title:"构建",slug:"构建",children:[]},{level:3,title:"本地验证",slug:"本地验证",children:[]},{level:3,title:"部署",slug:"部署",children:[]}]}],filePathRelative:"guide/getting-started.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},2204:(n,s,e)=>{e.r(s),e.d(s,{default:()=>T});var a=e(6252);const l=(0,a._)("h1",{id:"快速上手",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#快速上手","aria-hidden":"true"},"#"),(0,a.Uk)(" 快速上手")],-1),r=(0,a._)("h2",{id:"依赖环境",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#依赖环境","aria-hidden":"true"},"#"),(0,a.Uk)(" 依赖环境")],-1),c={href:"https://nodejs.org/",target:"_blank",rel:"noopener noreferrer"},i=(0,a.uE)('
    # 打印 node 版本\nnode -v\nv10.13.0\n
    1
    2
    3

    推荐使用 yarn 管理 npm 依赖

    # 全局安装 yarn\nnpm i yarn -g\n
    1
    2

    创建项目

    这一章节会帮助你从头搭建一个简单的 Fes.js 前端应用。

    步骤1 创建工作空间

    如果工作空间不存在,则先创建:

    # 创建目录 workspace\nmkdir workspace\n# 进入目录 workspace\ncd workspace\n
    1
    2
    3
    4

    如果工作空间已存在,则直接进入

    # 进入目录 workspace\ncd workspace\n
    1
    2
    步骤2 在工作空间创建项目
    ',11),p=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" create @fesjs/fes-app myapp\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br")])],-1),u=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\nnpx @fesjs/create-fes-app myapp\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br")])],-1),t=(0,a._)("p",null,[(0,a.Uk)("如果项目文件夹 "),(0,a._)("code",null,"workspace/myapp"),(0,a.Uk)(" 已经存在,会提示目录已存在:")],-1),b=["src"],_=(0,a._)("p",null,"你可以选择:",-1),d=(0,a._)("ul",null,[(0,a._)("li",null,[(0,a._)("code",null,"Overwrite"),(0,a.Uk)(" 删除项目文件夹,重新创建项目。")]),(0,a._)("li",null,[(0,a._)("code",null,"Merge"),(0,a.Uk)(" 保留原项目文件夹,存在相同文件则用模板文件覆盖当前目录文件。")])],-1),o=(0,a._)("code",null,"Overwrite",-1),m=(0,a._)("code",null,"Merge",-1),k=(0,a._)("code",null,"workspace/myapp",-1),h=(0,a._)("code",null,"template",-1),g=["src"],v=(0,a._)("p",null,[(0,a.Uk)("你可以选默认适用于中后台前端应用的 "),(0,a._)("code",null,"PC"),(0,a.Uk)(" 类型,也可以选适用于移动端的 "),(0,a._)("code",null,"H5"),(0,a.Uk)(" 类型。")],-1),f=(0,a._)("h5",{id:"步骤3-安装依赖",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#步骤3-安装依赖","aria-hidden":"true"},"#"),(0,a.Uk)(" 步骤3 安装依赖")],-1),U=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 进入项目目录"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token builtin class-name"},"cd"),(0,a.Uk)(" myapp\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" \n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br")])],-1),w=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 进入项目目录"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token builtin class-name"},"cd"),(0,a.Uk)(" myapp\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" i \n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br")])],-1),x=(0,a._)("h2",{id:"启动项目",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#启动项目","aria-hidden":"true"},"#"),(0,a.Uk)(" 启动项目")],-1),y=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 开发调试"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" dev\n\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" run v1.22.4\n$ fes dev\nStarting the development server http://localhost:8080 "),(0,a._)("span",{class:"token punctuation"},".."),(0,a.Uk)(".\n\n✔ Webpack\n Compiled successfully "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"15"),(0,a.Uk)(".91s\n\n DONE Compiled successfully "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(" 15917ms "),(0,a._)("span",{class:"token number"},"11"),(0,a.Uk)(":17:08 AM\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"11"),(0,a._)("br")])],-1),W=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 开发调试"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" run dev\n\n"),(0,a._)("span",{class:"token operator"},">"),(0,a.Uk)(" fes dev\nStarting the development server http://localhost:8080 "),(0,a._)("span",{class:"token punctuation"},".."),(0,a.Uk)(".\n\n✔ Webpack\n Compiled successfully "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"3"),(0,a.Uk)(".66s\n\n DONE Compiled successfully "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(" 3662ms "),(0,a._)("span",{class:"token number"},"11"),(0,a.Uk)(":17:46 AM\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br")])],-1),C={href:"http://localhost:8080",target:"_blank",rel:"noopener noreferrer"},N=["src"],j=(0,a._)("h2",{id:"部署发布",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#部署发布","aria-hidden":"true"},"#"),(0,a.Uk)(" 部署发布")],-1),M=(0,a._)("h3",{id:"构建",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#构建","aria-hidden":"true"},"#"),(0,a.Uk)(" 构建")],-1),A=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 构建"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" build\n\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" run v1.22.4\n$ fes build\n\n✔ Webpack\n Compiled successfully "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"45"),(0,a.Uk)(".37s\n\n✨ Done "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"48"),(0,a.Uk)(".87s.\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br")])],-1),O=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 构建"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" run build\n\n"),(0,a._)("span",{class:"token operator"},">"),(0,a.Uk)(" fes build\n\n✔ Webpack\n Compiled successfully "),(0,a._)("span",{class:"token keyword"},"in"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"45"),(0,a.Uk)(".37s\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br")])],-1),P=(0,a.uE)('

    构建产物默认生成到 ./dist 下,然后通过 tree 命令查看。

    tree ./dist\n\ndist\n├── chunk-vendors.27cd4686.js\n├── chunk-vendors.a5f5de67.css\n├── index.11411d43.css\n├── index.d72f1ba2.js\n├── index.html\n├── logo.png\n└── static\n    └── logo.0f85bba0.png\n
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    本地验证

    ',3),R={href:"https://github.com/vercel/serve",target:"_blank",rel:"noopener noreferrer"},Y=(0,a._)("code",null,"fes dev",-1),$=(0,a._)("h3",{id:"部署",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#部署","aria-hidden":"true"},"#"),(0,a.Uk)(" 部署")],-1),D=(0,a._)("p",null,"本地验证完,就可以部署了。你需要把 dist 目录部署到服务器上。",-1),E={},T=(0,e(3744).Z)(E,[["render",function(n,s){const e=(0,a.up)("OutboundLink"),E=(0,a.up)("CodeGroupItem"),T=(0,a.up)("CodeGroup");return(0,a.wg)(),(0,a.iD)(a.HY,null,[l,r,(0,a._)("p",null,[(0,a.Uk)("首先得有 "),(0,a._)("a",c,[(0,a.Uk)("Node.js"),(0,a.Wm)(e)]),(0,a.Uk)(",并确保 node 版本是 10.13 或以上。")]),i,(0,a.Wm)(T,null,{default:(0,a.w5)((()=>[(0,a.Wm)(E,{title:"YARN",active:""},{default:(0,a.w5)((()=>[p])),_:1}),(0,a.Wm)(E,{title:"NPM"},{default:(0,a.w5)((()=>[u])),_:1})])),_:1}),t,(0,a._)("img",{src:n.$withBase("pickTemplateTip.png"),alt:"目录已存在提示"},null,8,b),_,d,(0,a._)("p",null,[(0,a.Uk)("当选择 "),o,(0,a.Uk)(" 或者 "),m,(0,a.Uk)(" 或者项目目录 "),k,(0,a.Uk)(" 不存在,会提示选取一个 "),h,(0,a.Uk)(": "),(0,a._)("img",{src:n.$withBase("pickTemplate.png"),alt:"选择模板类型"},null,8,g)]),v,f,(0,a.Wm)(T,null,{default:(0,a.w5)((()=>[(0,a.Wm)(E,{title:"YARN",active:""},{default:(0,a.w5)((()=>[U])),_:1}),(0,a.Wm)(E,{title:"NPM"},{default:(0,a.w5)((()=>[w])),_:1})])),_:1}),x,(0,a.Wm)(T,null,{default:(0,a.w5)((()=>[(0,a.Wm)(E,{title:"YARN",active:""},{default:(0,a.w5)((()=>[y])),_:1}),(0,a.Wm)(E,{title:"NPM"},{default:(0,a.w5)((()=>[W])),_:1})])),_:1}),(0,a._)("p",null,[(0,a.Uk)("Fes.js 会在 "),(0,a._)("a",C,[(0,a.Uk)("http://localhost:8080"),(0,a.Wm)(e)]),(0,a.Uk)(" 启动一个热重载的开发服务器。当你修改你的 .vue 文件时,浏览器中的内容也会自动更新。")]),(0,a._)("img",{src:n.$withBase("home.png"),alt:"home"},null,8,N),j,M,(0,a.Wm)(T,null,{default:(0,a.w5)((()=>[(0,a.Wm)(E,{title:"YARN",active:""},{default:(0,a.w5)((()=>[A])),_:1}),(0,a.Wm)(E,{title:"NPM"},{default:(0,a.w5)((()=>[O])),_:1})])),_:1}),P,(0,a._)("p",null,[(0,a.Uk)("发布之前,可以通过 "),(0,a._)("a",R,[(0,a.Uk)("serve"),(0,a.Wm)(e)]),(0,a.Uk)(" 做本地验证,验证结果应该跟执行 "),Y,(0,a.Uk)(" 的结果一样。")]),$,D],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const e=n.__vccOpts||n;for(const[n,a]of s)e[n]=a;return e}}}]); \ No newline at end of file diff --git a/assets/js/v-fffb8e28.91f97848.js b/assets/js/v-fffb8e28.7aa72175.js similarity index 57% rename from assets/js/v-fffb8e28.91f97848.js rename to assets/js/v-fffb8e28.7aa72175.js index a29e2605..200b3697 100644 --- a/assets/js/v-fffb8e28.91f97848.js +++ b/assets/js/v-fffb8e28.7aa72175.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[807],{9570:(e,s,l)=>{l.r(s),l.d(s,{data:()=>i});const i={key:"v-fffb8e28",path:"/guide/",title:"介绍",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"痛点",slug:"痛点",children:[]},{level:2,title:"Fes.js 是什么?",slug:"fes-js-是什么",children:[]},{level:2,title:"Fes.js 如何工作?",slug:"fes-js-如何工作",children:[{level:3,title:"架构",slug:"架构",children:[]},{level:3,title:"插件和插件集",slug:"插件和插件集",children:[]},{level:3,title:".fes 临时文件",slug:"fes-临时文件",children:[]}]},{level:2,title:"为什么不是 ...?",slug:"为什么不是",children:[{level:3,title:"Vue CLI",slug:"vue-cli",children:[]},{level:3,title:"UMI",slug:"umi",children:[]}]}],filePathRelative:"guide/README.md",git:{updatedTime:1668745765e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5195:(e,s,l)=>{l.r(s),l.d(s,{default:()=>c});var i=l(6252);const a=(0,i.uE)('

    介绍

    痛点

    在开发一个前端项目之前,我们可能需要做如下准备工作:

    • 搭建开发环境
    • 约定代码规范
    • 封装API请求
    • 配置路由
    • 实现布局、菜单、导航
    • 实现登录
    • 权限管理
    • ...

    除了准备工作之外,还会遇到很多相似的业务类型,比如中后台应用大多都是工作台、增删改查、权限、图表等。如果每次项目都完全手动处理一遍,不仅耗费时间,久而久之可能会存在多种技术栈、开发规范,导致开发流程不统一,历史项目越来越难维护。所以我们需要一套完整的解决方案,管理开发到部署整个流程。

    Fes.js 是什么?

    Fes.js 是一个好用的前端应用解决方案。Fes.js 以 Vue 3.0 和路由为基础,同时支持配置式路由和约定式路由,并以此进行功能扩展。配以覆盖编译时和运行时生命周期完善的插件体系,支持各种功能扩展和业务需求。

    它主要具备以下特点:

    • 🚀 快速 ,内置了路由、开发、构建等,并且提供测试、布局、权限、国际化、状态管理、API请求、数据字典、SvgIcon等插件,可以满足大部分日常开发需求。

    • 🧨 简单 ,基于Vue.js 3.0,上手简单。贯彻“约定优于配置”思想,设计插件上尽可能用约定替代配置,同时提供统一的插件配置入口,简单简洁又不失灵活。提供一致性的API入口,一致化的体验,学习起来更轻松。

    • 💪 健壮 ,只需要关心页面内容,减少写BUG的机会!提供单元测试、覆盖测试能力保障项目质量。

    • 📦 可扩展 ,借鉴Umi实现了完整的生命周期和插件化机制,插件可以管理项目的编译时和运行时,能力均可以通过插件封装进来,在 Fes.js 中协调有序的运行。

    • 📡 面向未来 ,在满足需求的同时,我们也不会停止对新技术的探索。已使用Vue3.0来提升应用性能,已使用webpack5提升构建性能和实现微服务,未来会探索vite等新技术。

    Fes.js 如何工作?

    架构

    ',11),n=["src"],r=(0,i._)("p",null,"Fes.js 把大家常用的技术栈封装成一个个插件进行整理,收敛到一起,让大家只用 Fes.js 就可以完成 80% 的日常工作。",-1),t=(0,i._)("h3",{id:"插件和插件集",tabindex:"-1"},[(0,i._)("a",{class:"header-anchor",href:"#插件和插件集","aria-hidden":"true"},"#"),(0,i.Uk)(" 插件和插件集")],-1),d=["src"],h=(0,i.uE)(' Fes.js 支持插件和插件集,通过这张图应该很好理解到他们的关系,通过插件集我们把插件收敛依赖然后支持不同的业务类型。

    .fes 临时文件

    .fes 临时目录是整个 Fes.js 项目的发动机,你的入口文件、路由等等都在这里,这些是由 fes 内部插件及三方插件生成的。

    你通常会在 .fes 下看到以下目录

    + .fes\n  + core     # 内部插件生成\n  + pluginA  # 外部插件生成\n  + presetB  # 外部插件生成\n  + fes.js   # 入口文件\n
    1
    2
    3
    4
    5

    临时文件是 Fes.js 中非常重要的一部分,框架或插件会根据你的代码生成临时文件,这些原来需要放在项目里的脏乱差的部分都被藏在了这里。

    你可以在这里调试代码,但不要在 .git 仓库里提交他,因为他的临时性,每次启动 fes 时都会被删除并重新生成。

    为什么不是 ...?

    Vue CLI

    Vue CLI 是基于 Vue.js 进行快速开发的完整系统,提供交互式脚手架、丰富的官方插件,并且可通过插件进行扩展,他在打包层把体验做到了极致,但是不包含路由,不是框架。所以,如果大家想基于他修改部分配置,或者希望在打包层之外也做技术收敛时,就会遇到困难。

    UMI

    UMI 是个很好的选择,Fes.js 很多功能是借鉴 UMI 做的。UMI 是基于 React 封装的应用级框架,贯彻着函数式编程的思维。而 Vue 有所不同,虽然 Vue 3.0 向函数式迈了一大步,但大家可能依然喜欢编写 .vue文件,而非 .jsx 文件。两种思维方式会导致部分API设计上有所差异,虽然 UMI 有 plugin-vue ,但不太 "vue"。推荐喜欢 React 的同学使用 UMI。

    ',12),u={},c=(0,l(3744).Z)(u,[["render",function(e,s){return(0,i.wg)(),(0,i.iD)(i.HY,null,[a,(0,i._)("img",{src:e.$withBase("framework.png"),alt:"架构"},null,8,n),r,t,(0,i._)("p",null,[(0,i._)("img",{src:e.$withBase("plugins.png"),alt:"插件",title:"插件",style:{width:"500px"},class:"medium-zoom-image"},null,8,d)]),h],64)}]])},3744:(e,s)=>{s.Z=(e,s)=>{const l=e.__vccOpts||e;for(const[e,i]of s)l[e]=i;return l}}}]); \ No newline at end of file +"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[807],{9570:(e,s,l)=>{l.r(s),l.d(s,{data:()=>i});const i={key:"v-fffb8e28",path:"/guide/",title:"介绍",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"痛点",slug:"痛点",children:[]},{level:2,title:"Fes.js 是什么?",slug:"fes-js-是什么",children:[]},{level:2,title:"Fes.js 如何工作?",slug:"fes-js-如何工作",children:[{level:3,title:"架构",slug:"架构",children:[]},{level:3,title:"插件和插件集",slug:"插件和插件集",children:[]},{level:3,title:".fes 临时文件",slug:"fes-临时文件",children:[]}]},{level:2,title:"为什么不是 ...?",slug:"为什么不是",children:[{level:3,title:"Vue CLI",slug:"vue-cli",children:[]},{level:3,title:"UMI",slug:"umi",children:[]}]}],filePathRelative:"guide/README.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},5195:(e,s,l)=>{l.r(s),l.d(s,{default:()=>c});var i=l(6252);const a=(0,i.uE)('

    介绍

    痛点

    在开发一个前端项目之前,我们可能需要做如下准备工作:

    • 搭建开发环境
    • 约定代码规范
    • 封装API请求
    • 配置路由
    • 实现布局、菜单、导航
    • 实现登录
    • 权限管理
    • ...

    除了准备工作之外,还会遇到很多相似的业务类型,比如中后台应用大多都是工作台、增删改查、权限、图表等。如果每次项目都完全手动处理一遍,不仅耗费时间,久而久之可能会存在多种技术栈、开发规范,导致开发流程不统一,历史项目越来越难维护。所以我们需要一套完整的解决方案,管理开发到部署整个流程。

    Fes.js 是什么?

    Fes.js 是一个好用的前端应用解决方案。Fes.js 以 Vue 3.0 和路由为基础,同时支持配置式路由和约定式路由,并以此进行功能扩展。配以覆盖编译时和运行时生命周期完善的插件体系,支持各种功能扩展和业务需求。

    它主要具备以下特点:

    • 🚀 快速 ,内置了路由、开发、构建等,并且提供测试、布局、权限、国际化、状态管理、API请求、数据字典、SvgIcon等插件,可以满足大部分日常开发需求。

    • 🧨 简单 ,基于Vue.js 3.0,上手简单。贯彻“约定优于配置”思想,设计插件上尽可能用约定替代配置,同时提供统一的插件配置入口,简单简洁又不失灵活。提供一致性的API入口,一致化的体验,学习起来更轻松。

    • 💪 健壮 ,只需要关心页面内容,减少写BUG的机会!提供单元测试、覆盖测试能力保障项目质量。

    • 📦 可扩展 ,借鉴Umi实现了完整的生命周期和插件化机制,插件可以管理项目的编译时和运行时,能力均可以通过插件封装进来,在 Fes.js 中协调有序的运行。

    • 📡 面向未来 ,在满足需求的同时,我们也不会停止对新技术的探索。已使用Vue3.0来提升应用性能,已使用webpack5提升构建性能和实现微服务,未来会探索vite等新技术。

    Fes.js 如何工作?

    架构

    ',11),n=["src"],r=(0,i._)("p",null,"Fes.js 把大家常用的技术栈封装成一个个插件进行整理,收敛到一起,让大家只用 Fes.js 就可以完成 80% 的日常工作。",-1),t=(0,i._)("h3",{id:"插件和插件集",tabindex:"-1"},[(0,i._)("a",{class:"header-anchor",href:"#插件和插件集","aria-hidden":"true"},"#"),(0,i.Uk)(" 插件和插件集")],-1),d=["src"],h=(0,i.uE)('

    .fes 临时文件

    .fes 临时目录是整个 Fes.js 项目的发动机,你的入口文件、路由等等都在这里,这些是由 fes 内部插件及三方插件生成的。

    你通常会在 .fes 下看到以下目录

    + .fes\n  + core     # 内部插件生成\n  + pluginA  # 外部插件生成\n  + presetB  # 外部插件生成\n  + fes.js   # 入口文件\n
    1
    2
    3
    4
    5

    临时文件是 Fes.js 中非常重要的一部分,框架或插件会根据你的代码生成临时文件,这些原来需要放在项目里的脏乱差的部分都被藏在了这里。

    你可以在这里调试代码,但不要在 .git 仓库里提交他,因为他的临时性,每次启动 fes 时都会被删除并重新生成。

    为什么不是 ...?

    Vue CLI

    Vue CLI 是基于 Vue.js 进行快速开发的完整系统,提供交互式脚手架、丰富的官方插件,并且可通过插件进行扩展,他在打包层把体验做到了极致,但是不包含路由,不是框架。所以,如果大家想基于他修改部分配置,或者希望在打包层之外也做技术收敛时,就会遇到困难。

    UMI

    UMI 是个很好的选择,Fes.js 很多功能是借鉴 UMI 做的。UMI 是基于 React 封装的应用级框架,贯彻着函数式编程的思维。而 Vue 有所不同,虽然 Vue 3.0 向函数式迈了一大步,但大家可能依然喜欢编写 .vue文件,而非 .jsx 文件。两种思维方式会导致部分API设计上有所差异,虽然 UMI 有 plugin-vue ,但不太 "vue"。推荐喜欢 React 的同学使用 UMI。

    ',11),u={},c=(0,l(3744).Z)(u,[["render",function(e,s){return(0,i.wg)(),(0,i.iD)(i.HY,null,[a,(0,i._)("img",{src:e.$withBase("framework.png"),alt:"架构"},null,8,n),r,t,(0,i._)("p",null,[(0,i._)("img",{src:e.$withBase("plugins.png"),alt:"插件",title:"插件",style:{width:"500px"},class:"medium-zoom-image"},null,8,d)]),(0,i.Uk)(" Fes.js 支持插件和插件集,通过这张图应该很好理解到他们的关系,通过插件集我们把插件收敛依赖然后支持不同的业务类型。 "),h],64)}]])},3744:(e,s)=>{s.Z=(e,s)=>{const l=e.__vccOpts||e;for(const[e,i]of s)l[e]=i;return l}}}]); \ No newline at end of file diff --git a/guide/config.html b/guide/config.html index 71b6a527..b43ed6c6 100644 --- a/guide/config.html +++ b/guide/config.html @@ -5,11 +5,11 @@ 配置 | Fes.js - - + + -

    配置

    Fes.js 约定 .fes.js 文件为项目编译需要配置文件,可以引入 node 端依赖项,不要引入浏览器端依赖项。

    一份常见的配置示例如下:

    export default {
    +    

    配置

    Fes.js 约定 .fes.js 文件为项目编译需要配置文件,可以引入 node 端依赖项,不要引入浏览器端依赖项。

    一份常见的配置示例如下:

    export default {
         base: '/foo/',
         publicPath: '/',
         devServer: {
    @@ -64,7 +64,7 @@
         mock: true,
         devServer: { port: 8080 }
     };
    -
    1
    2
    3
    4

    优先级

    本地临时配置 > 环境配置 > 基础配置

    提示

    如果多份配置中存在相同的配置项,则优先级高的会覆盖优先级低的

    - +
    1
    2
    3
    4

    优先级

    本地临时配置 > 环境配置 > 基础配置

    提示

    如果多份配置中存在相同的配置项,则优先级高的会覆盖优先级低的

    + diff --git a/guide/contributing.html b/guide/contributing.html index a388009a..fdecceae 100644 --- a/guide/contributing.html +++ b/guide/contributing.html @@ -5,18 +5,18 @@ 贡献指南 | Fes.js - - + + -

    贡献指南

    包概览

    项目仓库借助于 Yarn 工作区在新窗口打开 来实现 Monorepo在新窗口打开 ,在 packages 目录下存放多个互相关联的独立包。

    • @fesjs/create-fes-app: 创建项目模板模块。提供create-fes-app命令,提供创建多种类型项目模板的能力。

    • @fesjs/compiler: 编译时插件管理模块。定义插件的生命周期、插件配置、插件通讯机制等。

    • @fesjs/runtime: 运行时插件模块。集成了vue-router,定义运行时插件生命周期、插件通讯机制。

    • @fesjs/preset-build-in: 内置插件集。包含devbuild等命令,集成webpack5+babel,提供方便编写插件的API,入口文件处理,路由处理等能力。

    • @fesjs/fes-template: 适用于PC类型的模板项目。

    • @fesjs/fes-template-h5: 适用于H5类型的模板项目。

    • @fesjs/plugin-${name}: 官方插件。

    • @fesjs/fes: 入口模块。提供fes命令和 API 入口,封装@fesjs/compiler + @fesjs/runtime + @fesjs/preset-build-in,用户只需要安装此依赖和其他插件。

    开发准备

    开发要求:

    本项目开发使用的一些主要工具:

    克隆仓库:

    git clone https://github.com/WeBankFinTech/fes.js.git
    +    

    贡献指南

    包概览

    项目仓库借助于 Yarn 工作区在新窗口打开 来实现 Monorepo在新窗口打开 ,在 packages 目录下存放多个互相关联的独立包。

    • @fesjs/create-fes-app: 创建项目模板模块。提供create-fes-app命令,提供创建多种类型项目模板的能力。

    • @fesjs/compiler: 编译时插件管理模块。定义插件的生命周期、插件配置、插件通讯机制等。

    • @fesjs/runtime: 运行时插件模块。集成了vue-router,定义运行时插件生命周期、插件通讯机制。

    • @fesjs/preset-build-in: 内置插件集。包含devbuild等命令,集成webpack5+babel,提供方便编写插件的API,入口文件处理,路由处理等能力。

    • @fesjs/fes-template: 适用于PC类型的模板项目。

    • @fesjs/fes-template-h5: 适用于H5类型的模板项目。

    • @fesjs/plugin-${name}: 官方插件。

    • @fesjs/fes: 入口模块。提供fes命令和 API 入口,封装@fesjs/compiler + @fesjs/runtime + @fesjs/preset-build-in,用户只需要安装此依赖和其他插件。

    开发准备

    开发要求:

    本项目开发使用的一些主要工具:

    克隆仓库:

    git clone https://github.com/WeBankFinTech/fes.js.git
     
    1

    进入fes.js目录,安装依赖:

    yarn
    -
    1

    贡献文档

    文档代码在docs目录,基于 vuepress在新窗口打开 实现。

    第一步:启动服务

    yarn docs:dev
    +
    1

    贡献文档

    文档代码在docs目录,基于 vuepress在新窗口打开 实现。

    第一步:启动服务

    yarn docs:dev
     
    1

    第二步:修改md文件

    菜单配置在/docs/.vuepress/configs/sidebar/zh.ts中,可以通过此配置找到对应想修改的文档。

    如果想添加图片,则可以先把图片添加至/docs/.vuepress/public,在代码中使用:

    <img :src="$withBase('framework.png')" alt="架构">
     
    1

    第三步:查看更新

    当md文档保存后,文档会自动更新,在http://localhost:8080/查看。

    贡献源码

    Fes.js统一使用ES Module规范编写源码,代码会在 node 端和浏览器端执行,所以源码需要编译后才能发布成包,再被执行。

    启动编译服务

    yarn dev
     
    1

    当我们修改build.config.js中配置的包代码时,会把src目录的源码编译后到lib目录。

    修改源码

    在了解Fes.js设计前提下,修改核心代码或者插件代码。

    验证修改内容

    根据需求选择模板项目来验证修改内容,比如选择fes-template

    1. 查看需待验证包是否已经添加到模板项目的依赖中,如果没有则在模板项目的 package.json 中添加包依赖,添加后在根目录执行yarn关联依赖
    2. 启动模板项目的开发服务
    cd packages/fes-template
     yarn dev
    -
    1
    2
    1. 在项目模板中添加代码验证修改内容
    2. 打开localhost:8000查看结果

    快速调试技巧

    每次修改插件或者核心代码后,等待自动编译完,需要在模板目录重新执行fes dev,比较费时费力。

    可以先在模板的 .fes 目录中找到对应临时代码,更改逻辑,验证完后再将变更逻辑保存到正式文件中。

    注意

    直接修改临时文件切莫重新执行fes dev,修改会被覆盖。

    提交PR

    1. fork项目!
    2. 创建你的功能分支: git checkout -b my-new-feature
    3. 本地提交新代码: git commit -am 'Add some feature'
    4. 推送本地到服务器分支: git push origin my-new-feature
    5. 创建一个PR
    - +
    1
    2
    1. 在项目模板中添加代码验证修改内容
    2. 打开localhost:8000查看结果

    快速调试技巧

    每次修改插件或者核心代码后,等待自动编译完,需要在模板目录重新执行fes dev,比较费时费力。

    可以先在模板的 .fes 目录中找到对应临时代码,更改逻辑,验证完后再将变更逻辑保存到正式文件中。

    注意

    直接修改临时文件切莫重新执行fes dev,修改会被覆盖。

    提交PR

    1. fork项目!
    2. 创建你的功能分支: git checkout -b my-new-feature
    3. 本地提交新代码: git commit -am 'Add some feature'
    4. 推送本地到服务器分支: git push origin my-new-feature
    5. 创建一个PR
    + diff --git a/guide/css.html b/guide/css.html index a1887e0c..4ed582a3 100644 --- a/guide/css.html +++ b/guide/css.html @@ -5,11 +5,11 @@ 使用 css | Fes.js - - + + -

    使用 css

    提示

    本文档以 css 为示例,把后缀换成 .less 同样适用。

    全局样式

    Fes.js 中约定 src/global.css 为全局样式,如果存在此文件,会被自动引入到入口文件最前面。

    比如用于覆盖样式,

    .layout-content {
    +    

    使用 css

    提示

    本文档以 css 为示例,把后缀换成 .less 同样适用。

    全局样式

    Fes.js 中约定 src/global.css 为全局样式,如果存在此文件,会被自动引入到入口文件最前面。

    比如用于覆盖样式,

    .layout-content {
       max-width: 1000px;
     }
     
    1
    2
    3

    组件内样式

    <style>
    @@ -19,13 +19,13 @@
     </style>
     
    1
    2
    3
    4
    5

    引入第三方样式

    可以直接通过 import 引入第三方组件,当然最好在入口文件app.js中引入

    // src/app.js
     import 'bootstrap/dist/css/bootstrap.css'
    -
    1
    2

    CSS Modules

    支持 VueCSS Modules在新窗口打开 用法,可以直接使用:

    <style module>
    +
    1
    2

    CSS Modules

    支持 VueCSS Modules在新窗口打开 用法,可以直接使用:

    <style module>
     .layout-content {
       max-width: 1000px;
     }
     
    1
    2
    3
    4

    如果想直接引入CSS文件的话,则CSS文件名需要包含.module,比如:

    import style from '@/styles/index.module.css'
     console.log(style)
    -
    1
    2

    CSS 预处理器

    Fes.js 内置支持 less,不支持 sassstylus,但如果有需求,可以通过 chainWebpack 配置或者 fes-plugin 插件的形式支持。

    - +
    1
    2

    CSS 预处理器

    Fes.js 内置支持 less,不支持 sassstylus,但如果有需求,可以通过 chainWebpack 配置或者 fes-plugin 插件的形式支持。

    + diff --git a/guide/directory-structure.html b/guide/directory-structure.html index 71cf14f6..b393be22 100644 --- a/guide/directory-structure.html +++ b/guide/directory-structure.html @@ -5,11 +5,11 @@ 目录结构 | Fes.js - - + + -

    目录结构

    快速上手中,大家对框架应该有初步的印象,接下来我们了解下目录结构。Fes.js 遵循 约定优于配置 的原则,一个基础的 Fes.js 项目大致是这样的:

    fes-template
    +    

    目录结构

    快速上手中,大家对框架应该有初步的印象,接下来我们了解下目录结构。Fes.js 遵循 约定优于配置 的原则,一个基础的 Fes.js 项目大致是这样的:

    fes-template
     ├── package.json
     ├── tsconfig.json
     ├── mock.js
    @@ -88,7 +88,7 @@
     FES_ENV=prod
     
    1
    2

    等同于 node 端运行时,设置如下:

    process.env.PORT = '8888';
     process.env.FES_ENV = 'prod';
    -
    1
    2

    dist 目录

    执行 fes build 后,产物默认会存放在这里。

    public 目录

    此目录下所有文件为静态资源,会被复制到输出路径。

    index.html

    默认的 html 模板文件,如果删除此 html 则会使用内置的 html 模板文件。

    src 目录

    .fes 目录

    临时文件目录,比如入口文件、路由等,都会被临时生成到这里。

    注意

    不要提交 .fes 目录到 git 仓库,他们会在 fes devfes build 时被删除并重新生成。

    pages 目录

    所有路由组件文件存放在这里。

    app.js

    运行时配置文件,可以在这里扩展运行时的能力,比如修改路由等。

    - +
    1
    2

    dist 目录

    执行 fes build 后,产物默认会存放在这里。

    public 目录

    此目录下所有文件为静态资源,会被复制到输出路径。

    index.html

    默认的 html 模板文件,如果删除此 html 则会使用内置的 html 模板文件。

    src 目录

    .fes 目录

    临时文件目录,比如入口文件、路由等,都会被临时生成到这里。

    注意

    不要提交 .fes 目录到 git 仓库,他们会在 fes devfes build 时被删除并重新生成。

    pages 目录

    所有路由组件文件存放在这里。

    app.js

    运行时配置文件,可以在这里扩展运行时的能力,比如修改路由等。

    + diff --git a/guide/env.html b/guide/env.html index 62f748fc..1bb34b03 100644 --- a/guide/env.html +++ b/guide/env.html @@ -5,16 +5,16 @@ 环境变量 | Fes.js - - + + -

    环境变量

    在构建或者代码在端上运行中需要一些跟区分于环境的变量,用于配置构建流程或者运行时过程,这时候我们可以配置环境变量。

    配置环境变量

    命令行添加

    比如:

    # OS X, Linux
    +    

    环境变量

    在构建或者代码在端上运行中需要一些跟区分于环境的变量,用于配置构建流程或者运行时过程,这时候我们可以配置环境变量。

    配置环境变量

    命令行添加

    比如:

    # OS X, Linux
     PORT=3000 fes dev
     
     # Windows (cmd.exe)
     set PORT=3000 && fes dev
    -
    1
    2
    3
    4
    5

    如果要同时考虑 OS X 和 Windows,可借助三方工具 cross-env在新窗口打开

    yarn add cross-env --dev
    +
    1
    2
    3
    4
    5

    如果要同时考虑 OS X 和 Windows,可借助三方工具 cross-env在新窗口打开

    yarn add cross-env --dev
     cross-env PORT=3000 fes dev
     
    1
    2
    npm i cross-env --save-dev
     cross-env PORT=3000 fes dev
    @@ -26,7 +26,7 @@ cross-env PORT1

    ANALYZE_MODE

    默认是server

    ANALYZE_PORT

    默认是8888

    CLEAR_OUTPUT

    仅仅在 build 时生效。如果设置为 none,就不会在构建前清除 Output 文件内容。

    RM_TMPDIR

    仅仅在 build 时生效。如果设置为 none,就不会在构建后清除 .fes 临时文件内容。

    process.env

    运行时配置需要以 FES_APP_ 开头,比如在 .env 中配置:

    FES_APP_KEY=123456789
     
    1

    在代码中使用:

    console.log(process.env.FES_APP_KEY)
     // 输出 123456789
    -
    1
    2

    除了用户自定义的以FES_APP_开头的变量,还提供如下配置:

    • NODE_ENV:Node 环境变量

    • FES_ENV:Fes.js 环境变量

    • BASE_URL:等同于 publicPath

    - +
    1
    2

    除了用户自定义的以FES_APP_开头的变量,还提供如下配置:

    • NODE_ENV:Node 环境变量

    • FES_ENV:Fes.js 环境变量

    • BASE_URL:等同于 publicPath

    + diff --git a/guide/faq.html b/guide/faq.html index 87ac8c7c..60265d6a 100644 --- a/guide/faq.html +++ b/guide/faq.html @@ -5,11 +5,11 @@ 常见问题 | Fes.js - - + + - - + + diff --git a/guide/getting-started.html b/guide/getting-started.html index 35ad9b8f..133f1810 100644 --- a/guide/getting-started.html +++ b/guide/getting-started.html @@ -5,11 +5,11 @@ 快速上手 | Fes.js - - + + -

    快速上手

    依赖环境

    首先得有 Node.js在新窗口打开,并确保 node 版本是 10.13 或以上。

    # 打印 node 版本
    +    

    Fes.js 会在 http://localhost:8080在新窗口打开 启动一个热重载的开发服务器。当你修改你的 .vue 文件时,浏览器中的内容也会自动更新。

    home

    部署发布

    构建

    # 构建
    +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    Fes.js 会在 http://localhost:8080在新窗口打开 启动一个热重载的开发服务器。当你修改你的 .vue 文件时,浏览器中的内容也会自动更新。

    home

    部署发布

    构建

    # 构建
     yarn build
     
     yarn run v1.22.4
    @@ -81,7 +81,7 @@ dist
     ├── logo.png
     └── static
         └── logo.0f85bba0.png
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    本地验证

    发布之前,可以通过 serve在新窗口打开 做本地验证,验证结果应该跟执行 fes dev 的结果一样。

    部署

    本地验证完,就可以部署了。你需要把 dist 目录部署到服务器上。

    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    本地验证

    发布之前,可以通过 serve在新窗口打开 做本地验证,验证结果应该跟执行 fes dev 的结果一样。

    部署

    本地验证完,就可以部署了。你需要把 dist 目录部署到服务器上。

    + diff --git a/guide/image.html b/guide/image.html index bf8ef8fa..67b0a483 100644 --- a/guide/image.html +++ b/guide/image.html @@ -5,11 +5,11 @@ 使用图片 | Fes.js - - + + -
    + diff --git a/guide/index.html b/guide/index.html index 9315b1b4..335a8958 100644 --- a/guide/index.html +++ b/guide/index.html @@ -5,16 +5,16 @@ 介绍 | Fes.js - - + + -

    介绍

    痛点

    在开发一个前端项目之前,我们可能需要做如下准备工作:

    • 搭建开发环境
    • 约定代码规范
    • 封装API请求
    • 配置路由
    • 实现布局、菜单、导航
    • 实现登录
    • 权限管理
    • ...

    除了准备工作之外,还会遇到很多相似的业务类型,比如中后台应用大多都是工作台、增删改查、权限、图表等。如果每次项目都完全手动处理一遍,不仅耗费时间,久而久之可能会存在多种技术栈、开发规范,导致开发流程不统一,历史项目越来越难维护。所以我们需要一套完整的解决方案,管理开发到部署整个流程。

    Fes.js 是什么?

    Fes.js 是一个好用的前端应用解决方案。Fes.js 以 Vue 3.0 和路由为基础,同时支持配置式路由和约定式路由,并以此进行功能扩展。配以覆盖编译时和运行时生命周期完善的插件体系,支持各种功能扩展和业务需求。

    它主要具备以下特点:

    • 🚀 快速 ,内置了路由、开发、构建等,并且提供测试、布局、权限、国际化、状态管理、API请求、数据字典、SvgIcon等插件,可以满足大部分日常开发需求。

    • 🧨 简单 ,基于Vue.js 3.0,上手简单。贯彻“约定优于配置”思想,设计插件上尽可能用约定替代配置,同时提供统一的插件配置入口,简单简洁又不失灵活。提供一致性的API入口,一致化的体验,学习起来更轻松。

    • 💪 健壮 ,只需要关心页面内容,减少写BUG的机会!提供单元测试、覆盖测试能力保障项目质量。

    • 📦 可扩展 ,借鉴Umi实现了完整的生命周期和插件化机制,插件可以管理项目的编译时和运行时,能力均可以通过插件封装进来,在 Fes.js 中协调有序的运行。

    • 📡 面向未来 ,在满足需求的同时,我们也不会停止对新技术的探索。已使用Vue3.0来提升应用性能,已使用webpack5提升构建性能和实现微服务,未来会探索vite等新技术。

    Fes.js 如何工作?

    架构

    架构

    Fes.js 把大家常用的技术栈封装成一个个插件进行整理,收敛到一起,让大家只用 Fes.js 就可以完成 80% 的日常工作。

    插件和插件集

    插件

    Fes.js 支持插件和插件集,通过这张图应该很好理解到他们的关系,通过插件集我们把插件收敛依赖然后支持不同的业务类型。

    .fes 临时文件

    .fes 临时目录是整个 Fes.js 项目的发动机,你的入口文件、路由等等都在这里,这些是由 fes 内部插件及三方插件生成的。

    你通常会在 .fes 下看到以下目录

    + .fes
    +    

    介绍

    痛点

    在开发一个前端项目之前,我们可能需要做如下准备工作:

    • 搭建开发环境
    • 约定代码规范
    • 封装API请求
    • 配置路由
    • 实现布局、菜单、导航
    • 实现登录
    • 权限管理
    • ...

    除了准备工作之外,还会遇到很多相似的业务类型,比如中后台应用大多都是工作台、增删改查、权限、图表等。如果每次项目都完全手动处理一遍,不仅耗费时间,久而久之可能会存在多种技术栈、开发规范,导致开发流程不统一,历史项目越来越难维护。所以我们需要一套完整的解决方案,管理开发到部署整个流程。

    Fes.js 是什么?

    Fes.js 是一个好用的前端应用解决方案。Fes.js 以 Vue 3.0 和路由为基础,同时支持配置式路由和约定式路由,并以此进行功能扩展。配以覆盖编译时和运行时生命周期完善的插件体系,支持各种功能扩展和业务需求。

    它主要具备以下特点:

    • 🚀 快速 ,内置了路由、开发、构建等,并且提供测试、布局、权限、国际化、状态管理、API请求、数据字典、SvgIcon等插件,可以满足大部分日常开发需求。

    • 🧨 简单 ,基于Vue.js 3.0,上手简单。贯彻“约定优于配置”思想,设计插件上尽可能用约定替代配置,同时提供统一的插件配置入口,简单简洁又不失灵活。提供一致性的API入口,一致化的体验,学习起来更轻松。

    • 💪 健壮 ,只需要关心页面内容,减少写BUG的机会!提供单元测试、覆盖测试能力保障项目质量。

    • 📦 可扩展 ,借鉴Umi实现了完整的生命周期和插件化机制,插件可以管理项目的编译时和运行时,能力均可以通过插件封装进来,在 Fes.js 中协调有序的运行。

    • 📡 面向未来 ,在满足需求的同时,我们也不会停止对新技术的探索。已使用Vue3.0来提升应用性能,已使用webpack5提升构建性能和实现微服务,未来会探索vite等新技术。

    Fes.js 如何工作?

    架构

    架构

    Fes.js 把大家常用的技术栈封装成一个个插件进行整理,收敛到一起,让大家只用 Fes.js 就可以完成 80% 的日常工作。

    插件和插件集

    插件

    Fes.js 支持插件和插件集,通过这张图应该很好理解到他们的关系,通过插件集我们把插件收敛依赖然后支持不同的业务类型。

    .fes 临时文件

    .fes 临时目录是整个 Fes.js 项目的发动机,你的入口文件、路由等等都在这里,这些是由 fes 内部插件及三方插件生成的。

    你通常会在 .fes 下看到以下目录

    + .fes
       + core     # 内部插件生成
       + pluginA  # 外部插件生成
       + presetB  # 外部插件生成
       + fes.js   # 入口文件
    -
    1
    2
    3
    4
    5

    临时文件是 Fes.js 中非常重要的一部分,框架或插件会根据你的代码生成临时文件,这些原来需要放在项目里的脏乱差的部分都被藏在了这里。

    你可以在这里调试代码,但不要在 .git 仓库里提交他,因为他的临时性,每次启动 fes 时都会被删除并重新生成。

    为什么不是 ...?

    Vue CLI

    Vue CLI 是基于 Vue.js 进行快速开发的完整系统,提供交互式脚手架、丰富的官方插件,并且可通过插件进行扩展,他在打包层把体验做到了极致,但是不包含路由,不是框架。所以,如果大家想基于他修改部分配置,或者希望在打包层之外也做技术收敛时,就会遇到困难。

    UMI

    UMI 是个很好的选择,Fes.js 很多功能是借鉴 UMI 做的。UMI 是基于 React 封装的应用级框架,贯彻着函数式编程的思维。而 Vue 有所不同,虽然 Vue 3.0 向函数式迈了一大步,但大家可能依然喜欢编写 .vue文件,而非 .jsx 文件。两种思维方式会导致部分API设计上有所差异,虽然 UMI 有 plugin-vue ,但不太 "vue"。推荐喜欢 React 的同学使用 UMI。

    - +
    1
    2
    3
    4
    5

    临时文件是 Fes.js 中非常重要的一部分,框架或插件会根据你的代码生成临时文件,这些原来需要放在项目里的脏乱差的部分都被藏在了这里。

    你可以在这里调试代码,但不要在 .git 仓库里提交他,因为他的临时性,每次启动 fes 时都会被删除并重新生成。

    为什么不是 ...?

    Vue CLI

    Vue CLI 是基于 Vue.js 进行快速开发的完整系统,提供交互式脚手架、丰富的官方插件,并且可通过插件进行扩展,他在打包层把体验做到了极致,但是不包含路由,不是框架。所以,如果大家想基于他修改部分配置,或者希望在打包层之外也做技术收敛时,就会遇到困难。

    UMI

    UMI 是个很好的选择,Fes.js 很多功能是借鉴 UMI 做的。UMI 是基于 React 封装的应用级框架,贯彻着函数式编程的思维。而 Vue 有所不同,虽然 Vue 3.0 向函数式迈了一大步,但大家可能依然喜欢编写 .vue文件,而非 .jsx 文件。两种思维方式会导致部分API设计上有所差异,虽然 UMI 有 plugin-vue ,但不太 "vue"。推荐喜欢 React 的同学使用 UMI。

    + diff --git a/guide/mock.html b/guide/mock.html index 29fbcfdb..64d67172 100644 --- a/guide/mock.html +++ b/guide/mock.html @@ -5,11 +5,11 @@ Mock 数据 | Fes.js - - + + -

    Mock 数据

    Mock 数据是前端开发过程中必不可少的一环,是分离前后端开发的关键链路。通过预先跟服务器端约定好的接口,模拟请求数据甚至逻辑,能够让前端开发独立自主,不会被服务端的开发所阻塞。

    约定式 Mock 文件

    Fes.js 约定 ./mock.js 为 mock 文件。

    比如:

    .
    +    

    Mock 数据

    Mock 数据是前端开发过程中必不可少的一环,是分离前后端开发的关键链路。通过预先跟服务器端约定好的接口,模拟请求数据甚至逻辑,能够让前端开发独立自主,不会被服务端的开发所阻塞。

    约定式 Mock 文件

    Fes.js 约定 ./mock.js 为 mock 文件。

    比如:

    .
     ├── mock.js
     └── src
         └── pages
    @@ -144,7 +144,7 @@
             });
         });
     };
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130

    cgiMock 参数

    创建一个 mock 接口,参数非常灵活,参考上面的 demo 即可。

    mockjs 参数

    Mock.js在新窗口打开 是常用的辅助生成模拟数据的三方库,借助他可以提升我们的 mock 数据能力。

    比如:

    export default function ({ cgiMock, mockjs, utils }) {
    +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130

    cgiMock 参数

    创建一个 mock 接口,参数非常灵活,参考上面的 demo 即可。

    mockjs 参数

    Mock.js在新窗口打开 是常用的辅助生成模拟数据的三方库,借助他可以提升我们的 mock 数据能力。

    比如:

    export default function ({ cgiMock, mockjs, utils }) {
         cgiMock('/random', mockjs.mock({
             'string|1-10': '★'
         }));
    @@ -152,7 +152,7 @@
     
    1
    2
    3
    4
    5

    utils 参数

    工具函数:

    • utils.file(path),从项目根目录根据path寻找文件,返回文件流。

    配置 Mock

    详见配置 mock

    关闭 Mock

    可以通过配置关闭。

    export default {
         mock: false,
     };
    -
    1
    2
    3
    - +
    1
    2
    3
    + diff --git a/guide/plugin.html b/guide/plugin.html index e6b5f34e..a36f09c4 100644 --- a/guide/plugin.html +++ b/guide/plugin.html @@ -5,11 +5,11 @@ 插件 | Fes.js - - + + -

    插件

    插件的 id 和 key

    每个插件都会对应一个 id 和一个 keyid 是路径的简写,key 是进一步简化后用于配置的唯一值

    比如插件 /node_modules/@fesjs/plugin-foo/index.js,通常来说,其 id@fesjs/plugin-fookeyfoo

    提示

    id 一般用不上,对于普通开发者 key 用来配置插件,而插件开发者可以使用 key 判断是否安装某个插件。

    启动插件

    有多种方式引入插件

    package.json 依赖

    Fes.js 会自动检测 dependenciesdevDependencies 里的 fes 插件,比如:

    {
    +    

    插件

    插件的 id 和 key

    每个插件都会对应一个 id 和一个 keyid 是路径的简写,key 是进一步简化后用于配置的唯一值

    比如插件 /node_modules/@fesjs/plugin-foo/index.js,通常来说,其 id@fesjs/plugin-fookeyfoo

    提示

    id 一般用不上,对于普通开发者 key 用来配置插件,而插件开发者可以使用 key 判断是否安装某个插件。

    启动插件

    有多种方式引入插件

    package.json 依赖

    Fes.js 会自动检测 dependenciesdevDependencies 里的 fes 插件,比如:

    {
       "dependencies": {
         "@fesjs/plugin-request": "^2.0.0"
       }
    @@ -27,7 +27,7 @@
             prefix: '/v2'
         }
     }
    -
    1
    2
    3
    4
    5

    这里的 mock 是 Mock插件 的 key。

    - +
    1
    2
    3
    4
    5

    这里的 mock 是 Mock插件 的 key。

    + diff --git a/guide/public.html b/guide/public.html index 7a680fa2..8d72a2cf 100644 --- a/guide/public.html +++ b/guide/public.html @@ -5,11 +5,11 @@ 静态资源 | Fes.js - - + + -

    静态资源

    有些内容不需要经过 webpack 模块化处理,则可以将这些内容放在 public 文件夹,构建后会直接复制到 dist 目录,所以你需要通过BASE_URL来引入它们。

    在HTML模板中使用

    public/index.html 中需要设置:

    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    +    

    静态资源

    有些内容不需要经过 webpack 模块化处理,则可以将这些内容放在 public 文件夹,构建后会直接复制到 dist 目录,所以你需要通过BASE_URL来引入它们。

    在HTML模板中使用

    public/index.html 中需要设置:

    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     
    1

    在.vue 和 js 文件中使用

    <template>
       <img :src="`${publicPath}my-image.png`">
     </template>
    @@ -22,7 +22,7 @@
       }
     }
     </script>
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    + diff --git a/guide/route.html b/guide/route.html index b68e601c..6a034afb 100644 --- a/guide/route.html +++ b/guide/route.html @@ -5,17 +5,17 @@ 路由 | Fes.js - - + + -

    路由

    像 Vue 、React 这类框架是用组件化搭建页面,路由解决的是路径到组件的匹配问题。Fes.js 基于 Vue Router 实现的路由,想了解更多的同学可以看看官方文档在新窗口打开

    路由配置

    在配置文件 .fes.js中通过 router 进行配置。

    export default {
    +    

    路由

    像 Vue 、React 这类框架是用组件化搭建页面,路由解决的是路径到组件的匹配问题。Fes.js 基于 Vue Router 实现的路由,想了解更多的同学可以看看官方文档在新窗口打开

    路由配置

    在配置文件 .fes.js中通过 router 进行配置。

    export default {
         router: {
             routes: [],
             mode: 'hash'
         }
     }
    -
    1
    2
    3
    4
    5
    6

    routes

    routes 是配置添加到路由的初始路由列表,格式为路由信息的数组。具体使用参考 Vue Router 文档在新窗口打开 中关于路由配置、路由匹配相关内容。

    mode

    创建历史记录的类型:

    默认是hash模式。

    约定式路由

    约定式路由也叫文件路由,就是不需要手写配置,文件系统即路由,通过目录和文件及其命名分析出路由配置。

    约定规范

    比如以下文件结构:

    pages
    +
    1
    2
    3
    4
    5
    6

    routes

    routes 是配置添加到路由的初始路由列表,格式为路由信息的数组。具体使用参考 Vue Router 文档在新窗口打开 中关于路由配置、路由匹配相关内容。

    mode

    创建历史记录的类型:

    默认是hash模式。

    约定式路由

    约定式路由也叫文件路由,就是不需要手写配置,文件系统即路由,通过目录和文件及其命名分析出路由配置。

    约定规范

    比如以下文件结构:

    pages
     ├── index.vue         # 根路由页面 路径为 /
     ├── *.vue             # 模糊匹配 路径为 *
     ├── a.vue             # 路径 /a
    @@ -97,7 +97,7 @@
             ]
         }
     ]
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9

    模糊匹配

    Fes.js 下约定文件名为 * 的路由是模糊匹配路由,可以用此特性实现 404 路由在新窗口打开

    比如以下目录结构:

    pages
    +
    1
    2
    3
    4
    5
    6
    7
    8
    9

    模糊匹配

    Fes.js 下约定文件名为 * 的路由是模糊匹配路由,可以用此特性实现 404 路由在新窗口打开

    比如以下目录结构:

    pages
     ├── index.vue         # 根路由页面 路径为 /
     └── *.vue             # 模糊匹配 路径为 *
     
    1
    2
    3

    会生成路由:

    [
    @@ -150,10 +150,10 @@
             }
         },
     ]
    -




     
     
     
     


    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    智能路由

    可以看到,编译后路由都会有 count 属性,这是我们根据精准匹配优先算法原则设计出路由排名算法,对匹配到的路由打分:

    • 路由的路径每个子项得到4分
    • 子项为静态细分(/list)再加3分
    • 子项为动态细分(/:orderId)再加2分
    • 根段(/)再1分
    • 通配符(*)匹配到的减去1分

    当我们跳转路由时,如果 URL 匹配到多个路由,则选择分数最高的路由。

    路由跳转

    想学习更多,可以查看 Vue Router 官方文档在新窗口打开

    声明式

    <template>
    +




     
     
     
     


    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    智能路由

    可以看到,编译后路由都会有 count 属性,这是我们根据精准匹配优先算法原则设计出路由排名算法,对匹配到的路由打分:

    • 路由的路径每个子项得到4分
    • 子项为静态细分(/list)再加3分
    • 子项为动态细分(/:orderId)再加2分
    • 根段(/)再1分
    • 通配符(*)匹配到的减去1分

    当我们跳转路由时,如果 URL 匹配到多个路由,则选择分数最高的路由。

    路由跳转

    想学习更多,可以查看 Vue Router 官方文档在新窗口打开

    声明式

    <template>
         <router-link to="/home">Home</router-link>
     </template>
    -
    1
    2
    3

    命令式

    页面跳转 API 由 router 实例提供,查看 Vue Rouer 文档在新窗口打开了解更多。

    import { useRouter } from '@fesjs/fes';
    +
    1
    2
    3

    命令式

    页面跳转 API 由 router 实例提供,查看 Vue Rouer 文档在新窗口打开了解更多。

    import { useRouter } from '@fesjs/fes';
     
     export default {
         setup(){
    @@ -180,7 +180,7 @@
         }
     }
     
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    + diff --git a/guide/runtime-config.html b/guide/runtime-config.html index 3bb311c4..87caef36 100644 --- a/guide/runtime-config.html +++ b/guide/runtime-config.html @@ -5,11 +5,11 @@ 运行时配置 | Fes.js - - + + -

    运行时配置

    Fes.js 约定 src/app.js 为运行时配置文件。运行时配置和配置的区别是他跑在浏览器端,因此我们可以在这里写函数、引入浏览器端依赖项等等,注意不要引入 node 端依赖项。

    运行时为啥需要配置?

    Fes.js 框架跟传统开发模式不一样。传统开发模式中用户编写 entry 文件,而 Fes.js 中 entry 文件由框架生成,用户就不必要编写胶水代码。内置插件和其他插件提供的一些运行时功能提供用户或者其他插件自定义。

    例如:

    plugin-acess插件定义运行时配置项:

    api.addRuntimePluginKey(() => 'access');
    +    

    运行时配置

    Fes.js 约定 src/app.js 为运行时配置文件。运行时配置和配置的区别是他跑在浏览器端,因此我们可以在这里写函数、引入浏览器端依赖项等等,注意不要引入 node 端依赖项。

    运行时为啥需要配置?

    Fes.js 框架跟传统开发模式不一样。传统开发模式中用户编写 entry 文件,而 Fes.js 中 entry 文件由框架生成,用户就不必要编写胶水代码。内置插件和其他插件提供的一些运行时功能提供用户或者其他插件自定义。

    例如:

    plugin-acess插件定义运行时配置项:

    api.addRuntimePluginKey(() => 'access');
     
    1

    plugin-acess插件读取配置项:

    const runtimeConfig = plugin.applyPlugins({
         key: 'access',
         type: ApplyPluginsType.modify,
    @@ -86,7 +86,7 @@
             console.log(to)
         });
     }
    -
    1
    2
    3
    4
    5

    更多配置项

    Fes.js 允许插件注册运行时配置,如果你使用插件,肯定会在插件里找到更多运行时的配置项。

    - +
    1
    2
    3
    4
    5

    更多配置项

    Fes.js 允许插件注册运行时配置,如果你使用插件,肯定会在插件里找到更多运行时的配置项。

    + diff --git a/guide/template.html b/guide/template.html index 33e106ad..253ecc63 100644 --- a/guide/template.html +++ b/guide/template.html @@ -5,11 +5,11 @@ HTML 模板 | Fes.js - - + + -

    HTML 模板

    Fes.js 基于 html-webpack-plugin在新窗口打开 实现的模板功能,默认模板内容是:

    <!DOCTYPE html>
    +    

    HTML 模板

    Fes.js 基于 html-webpack-plugin在新窗口打开 实现的模板功能,默认模板内容是:

    <!DOCTYPE html>
     <html>
       <head>
         <meta charset="utf-8">
    @@ -21,14 +21,14 @@
         <div id="app"></div>
       </body>
     </html>
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    自定义模板

    src/public 文件夹中创建index.html,Fes.js 约定如果这个文件存在,则会替换默认模板。

    模板配置

    在配置文件(.fes.js)中配置 html,把配置在新窗口打开的对象作为参数传入 html-webpack-plugin 实例。

    举个 🌰 :

    export default {
    +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    自定义模板

    src/public 文件夹中创建index.html,Fes.js 约定如果这个文件存在,则会替换默认模板。

    模板配置

    在配置文件(.fes.js)中配置 html,把配置在新窗口打开的对象作为参数传入 html-webpack-plugin 实例。

    举个 🌰 :

    export default {
         html: {
             title: '海贼王'
         }
     }
     
    1
    2
    3
    4
    5

    页面的标题会设置成'海贼王'。

    模板变量

    当然我们也可以手动编写模板,在模板中添加linklinkmeta等标签。在我们手动配置模板时,有时候需要用到一些环境变量,模板里可以获取到的变量如下:

    • htmlWebpackPlugin,特定于此插件的数据
    • webpackConfig,用于此编译的webpack配置。例如,它可用于获取publicPath(webpackConfig.output.publicPath)。
    • compilation,webpack编译对象。例如,可以使用它来获取已处理资产的内容,并将其直接内联到页面中compilation.assets[...].source()

    举个 🌰 :

    <link rel="icon" type="image/x-icon" href="<%= webpackConfig.output.publicPath %>favicon.png" />
     
    1

    除上述 html-webpack-plugin 插件提供的变量外,Fes.js 还把 process.env 中的环境变量添加到模板作用域内:

    • NODE_ENV
    • FES_ENV
    • .env 文件中以 FES_APP_ 开头的变量

    举个 🌰 :

    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    -
    1
    - +
    1
    + diff --git a/index.html b/index.html index d6974d87..5f36b9e3 100644 --- a/index.html +++ b/index.html @@ -5,11 +5,11 @@ 首页 | Fes.js - - + + -

    Fes.js

    一个好用的前端应用解决方案

    快速上手 项目简介

    Fast

    Fes.js 内置路由、构建、插件管理,提供测试、布局、权限、国际化、状态管理、请求、数据字典、Svg等插件,可以满足大部分日常开发需求。

    Easy

    基于Vue.js 3.0,上手非常简单。贯彻 “约定优于配置” 思想,在设计插件上尽可能用约定替代配置,依然提供统一的插件配置入口,简单简洁又不失灵活。提供一致性的API入口,一致化的体验,学习起来更轻松。

    Strong

    仅仅需要关心页面内容,减少犯错的机会!提供单元测试、覆盖测试的能力保障项目质量。

    可扩展

    借鉴 UMI 实现完整的生命周期和插件化机制,插件可以管理项目的编译时和运行时,能力均可以通过插件封装进来,在 Fes.js 中协调有序的运行。

    面向未来

    在满足需求的同时,我们也不会停止对新技术的探索。已使用Vue3.0来提升应用性能,已使用webpack5提升构建性能和实现微服务,未来会探索vite等新技术。

    令人愉悦

    我们的主要重点是开发人员体验。我们喜欢 Fes.js,并且会不断改进框架,所以您也喜欢它!期待有吸引力的解决方案,描述性的错误消息,强大的默认值和详细的文档。如果有问题或疑问,我们有用的社区将为您提供帮助。

    像数 1, 2, 3 一样容易

    # 创建模板
    +    

    Fes.js

    一个好用的前端应用解决方案

    快速上手 项目简介

    Fast

    Fes.js 内置路由、构建、插件管理,提供测试、布局、权限、国际化、状态管理、请求、数据字典、Svg等插件,可以满足大部分日常开发需求。

    Easy

    基于Vue.js 3.0,上手非常简单。贯彻 “约定优于配置” 思想,在设计插件上尽可能用约定替代配置,依然提供统一的插件配置入口,简单简洁又不失灵活。提供一致性的API入口,一致化的体验,学习起来更轻松。

    Strong

    仅仅需要关心页面内容,减少犯错的机会!提供单元测试、覆盖测试的能力保障项目质量。

    可扩展

    借鉴 UMI 实现完整的生命周期和插件化机制,插件可以管理项目的编译时和运行时,能力均可以通过插件封装进来,在 Fes.js 中协调有序的运行。

    面向未来

    在满足需求的同时,我们也不会停止对新技术的探索。已使用Vue3.0来提升应用性能,已使用webpack5提升构建性能和实现微服务,未来会探索vite等新技术。

    令人愉悦

    我们的主要重点是开发人员体验。我们喜欢 Fes.js,并且会不断改进框架,所以您也喜欢它!期待有吸引力的解决方案,描述性的错误消息,强大的默认值和详细的文档。如果有问题或疑问,我们有用的社区将为您提供帮助。

    像数 1, 2, 3 一样容易

    # 创建模板
     yarn create @fesjs/fes-app myapp
     
     # 安装依赖
    @@ -25,7 +25,7 @@ npx @fesjs/create-fes-app myapp
     
     # 运行
     npm run dev
    -
    1
    2
    3
    4
    5
    6
    7
    8

    反馈

    Github IssueFes.js开源运营小助手
    @fesjs/fes.js/issues在新窗口打开
    - +
    1
    2
    3
    4
    5
    6
    7
    8

    反馈

    Github IssueFes.js开源运营小助手
    @fesjs/fes.js/issues在新窗口打开
    + diff --git a/reference/api.html b/reference/api.html index 2827a460..4bd31539 100644 --- a/reference/api.html +++ b/reference/api.html @@ -5,11 +5,11 @@ API | Fes.js - - + + - - + + diff --git a/reference/api/index.html b/reference/api/index.html index 1afe2b9b..7066bb10 100644 --- a/reference/api/index.html +++ b/reference/api/index.html @@ -5,11 +5,11 @@ API | Fes.js - - + + -

    API

    Fes.js 统一了API的出口,所有运行时API(包含Fes.js内置API和插件提供的API)全部通过@fesjs/fes导出。

    import { someApi  } from "@fesjs/fes"
    +    

    API

    Fes.js 统一了API的出口,所有运行时API(包含Fes.js内置API和插件提供的API)全部通过@fesjs/fes导出。

    import { someApi  } from "@fesjs/fes"
     
    1

    基础API

    plugin

    提示

    主要在插件里面使用,项目代码中一般用不到。

    运行时插件接口,是 Fes.js 内置的跑在浏览器里的一套插件体系。

    import { plugin, ApplyPluginsType } from '@fesjs/fes';
     
     // 注册插件
    @@ -32,7 +32,7 @@ plugin.apply
       async: false,
     });
     
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    plugin.register 参数包含:

    • apply 插件文件导出的内容
    • path 插件文件路径

    plugin.applyPlugins 参数包含:

    • key,坑位的 key
    • type,执行方式类型,详见 ApplyPluginsType
    • initialValue,初始值
    • args,参数
    • async,是否异步执行且返回 Promise

    ApplyPluginsType

    提示

    主要在插件里面使用,项目代码中一般用不到。

    运行时插件执行类型,enum 类型,包含三个属性:

    • compose,用于合并执行多个函数,函数可决定前序函数的执行时机
    • modify,用于修改值
    • event,用于执行事件,前面没有依赖关系

    路由API

    Fes.js 路由基于 Vue Router 4.0在新窗口打开,想了解更多的同学可以看看官方文档。

    getRouter

    返回当前 router 实例。

    import { getRouter } from "@fesjs/fes";
    +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    plugin.register 参数包含:

    • apply 插件文件导出的内容
    • path 插件文件路径

    plugin.applyPlugins 参数包含:

    • key,坑位的 key
    • type,执行方式类型,详见 ApplyPluginsType
    • initialValue,初始值
    • args,参数
    • async,是否异步执行且返回 Promise

    ApplyPluginsType

    提示

    主要在插件里面使用,项目代码中一般用不到。

    运行时插件执行类型,enum 类型,包含三个属性:

    • compose,用于合并执行多个函数,函数可决定前序函数的执行时机
    • modify,用于修改值
    • event,用于执行事件,前面没有依赖关系

    路由API

    Fes.js 路由基于 Vue Router 4.0在新窗口打开,想了解更多的同学可以看看官方文档。

    getRouter

    返回当前 router 实例。

    import { getRouter } from "@fesjs/fes";
     const router = getRouter();
     router.push();
     
    1
    2
    3

    useRoute

    返回当前 route 实例,相当于在模板内使用 $route。必须在 setup 函数内调用。

    import { useRoute } from "@fesjs/fes";
    @@ -61,8 +61,8 @@ router.push<
             })
         }
     }
    -
    1
    2
    3
    4
    5
    6
    7

    createWebHashHistory

    提示

    在开发插件时可能用上,平时一般用不上

    创建一个 hash 历史记录。对于没有主机的 web 应用程序 (例如 file://),或当配置服务器不能处理任意URL时这非常有用。注意:如果 SEO 对你很重要,你应该使用 createWebHistory

    createWebHistory

    提示

    在开发插件时可能用上,平时一般用不上

    创建HTML5历史记录。单页应用程序最常见的历史记录。必须通过 http 服务打开页面地址 。

    createMemoryHistory

    提示

    在开发插件时可能用上,平时一般用不上

    创建一个基于内存的历史记录。这个历史记录的主要目的是处理 SSR。它在一个特殊的位置开始,这个位置无处不在。如果用户不在浏览器上下文中,它们可以通过调用 router.push() 或 router.replace() 将该位置替换为启动位置。

    createRouter

    创建一个路由器实例,该实例可用于 Vue 应用程序。查看路由器选项在新窗口打开,了解可以传递的所有属性的列表。

    使用自定义组件路由器链接来创建链接,而不是使用常规标签。这使得 Vue 路由器无需重新加载页面即可更改 URL、处理 URL 生成及其编码。

    <router-link to="/about">Go to About</router-link>
    -
    1

    可以查看官方文档在新窗口打开了解更多 RouterLink 的 Porps。查看官方文档在新窗口打开了解 RouterLink 的作用域插槽。

    返回的结果跟 RouterLink 的作用域插槽的属性一致,查看官方API在新窗口打开了解更多。

    import { RouterLink, useLink } from '@fesjs/fes'
    +
    1
    2
    3
    4
    5
    6
    7

    createWebHashHistory

    提示

    在开发插件时可能用上,平时一般用不上

    创建一个 hash 历史记录。对于没有主机的 web 应用程序 (例如 file://),或当配置服务器不能处理任意URL时这非常有用。注意:如果 SEO 对你很重要,你应该使用 createWebHistory

    createWebHistory

    提示

    在开发插件时可能用上,平时一般用不上

    创建HTML5历史记录。单页应用程序最常见的历史记录。必须通过 http 服务打开页面地址 。

    createMemoryHistory

    提示

    在开发插件时可能用上,平时一般用不上

    创建一个基于内存的历史记录。这个历史记录的主要目的是处理 SSR。它在一个特殊的位置开始,这个位置无处不在。如果用户不在浏览器上下文中,它们可以通过调用 router.push() 或 router.replace() 将该位置替换为启动位置。

    createRouter

    创建一个路由器实例,该实例可用于 Vue 应用程序。查看路由器选项在新窗口打开,了解可以传递的所有属性的列表。

    使用自定义组件路由器链接来创建链接,而不是使用常规标签。这使得 Vue 路由器无需重新加载页面即可更改 URL、处理 URL 生成及其编码。

    <router-link to="/about">Go to About</router-link>
    +
    1

    可以查看官方文档在新窗口打开了解更多 RouterLink 的 Porps。查看官方文档在新窗口打开了解 RouterLink 的作用域插槽。

    返回的结果跟 RouterLink 的作用域插槽的属性一致,查看官方API在新窗口打开了解更多。

    import { RouterLink, useLink } from '@fesjs/fes'
     
     export default {
       name: 'AppLink',
    @@ -86,7 +86,7 @@ router.push<
     <router-view v-slot="{ Component, route }">
       <component :is="Component" />
     </router-view>
    -
    1
    2
    3
    4

    可以查看官方文档在新窗口打开了解更多 RouterView 的 Porps。查看官方文档在新窗口打开了解 RouterView 的作用域插槽。

    Router Methods

    查看官方文档在新窗口打开了解更多

    - +
    1
    2
    3
    4

    可以查看官方文档在新窗口打开了解更多 RouterView 的 Porps。查看官方文档在新窗口打开了解 RouterView 的作用域插槽。

    Router Methods

    查看官方文档在新窗口打开了解更多

    + diff --git a/reference/cli.html b/reference/cli.html index b75ff2d9..2f86a4ef 100644 --- a/reference/cli.html +++ b/reference/cli.html @@ -5,11 +5,11 @@ 命令行接口 | Fes.js - - + + -

    命令行接口

    VuePress 命令行接口是由 @vuepress/cli在新窗口打开 包提供的。它是 vuepress在新窗口打开 包的依赖之一,当然你也可以单独安装它。

    执行 vuepress --help 来获取下列帮助信息:

    Usage:
    +    

    命令行接口

    VuePress 命令行接口是由 @vuepress/cli在新窗口打开 包提供的。它是 vuepress在新窗口打开 包的依赖之一,当然你也可以单独安装它。

    执行 vuepress --help 来获取下列帮助信息:

    Usage:
       $ vuepress <command> [options]
     
     Commands:
    @@ -54,7 +54,7 @@ Options:
       --debug                Enable debug mode 
       -v, --version          Display version number 
       -h, --help             Display this message
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    提示

    通过命令行设置的配置项,会覆盖你配置文件中的同名配置项。

    info

    输出当前系统和依赖相关的信息。

    在你想要检查你的环境,或者提交 Issue 时候,可以使用该命令。

    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    提示

    通过命令行设置的配置项,会覆盖你配置文件中的同名配置项。

    info

    输出当前系统和依赖相关的信息。

    在你想要检查你的环境,或者提交 Issue 时候,可以使用该命令。

    + diff --git a/reference/cli/index.html b/reference/cli/index.html index 2d26fa46..3c532ca1 100644 --- a/reference/cli/index.html +++ b/reference/cli/index.html @@ -5,11 +5,11 @@ 命令行工具 | Fes.js - - + + -

    命令行工具

    create-fes-app

    通过 create-fes-app 命令创建项目模板,输入create-fes-app -h则可以看到如下信息:

    Usage: create-fes-app <name>
    +    

    命令行工具

    create-fes-app

    通过 create-fes-app 命令创建项目模板,输入create-fes-app -h则可以看到如下信息:

    Usage: create-fes-app <name>
     
     Options:
         -v, --version            Output the current version
    @@ -94,7 +94,7 @@ Options:
       --verbose              show full function definitions in output
       -h, --help             display help for command
     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    比如:

    fes webpack
    -
    1
    - +
    1
    + diff --git a/reference/config/index.html b/reference/config/index.html index 61d013b5..694e45c4 100644 --- a/reference/config/index.html +++ b/reference/config/index.html @@ -5,11 +5,11 @@ 配置 | Fes.js - - + + -

    配置

    以下配置项通过字母排序。

    alias

    • 类型: object

    • 默认值: {}

    • 详情:

      配置别名,对引用路径进行映射。

    • 示例:

    export default {
    +    

    配置

    以下配置项通过字母排序。

    alias

    • 类型: object

    • 默认值: {}

    • 详情:

      配置别名,对引用路径进行映射。

    • 示例:

    export default {
         alias: {
            main: 'src/assets/styles/main'
         }
    @@ -27,13 +27,13 @@
     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    • 详情:

      构建结果分析,当配置 process.env.ANALYZE 时开启,例如执行ANALYZE=1 fes build

    autoprefixer

    • 类型: object
    • 默认值:
    {
         flexbox: 'no-2009'
     }
    -
    1
    2
    3

    base

    • 类型: string

    • 默认值: ''

    • 详情:

      设置路由前缀,通常用于部署到非根目录。比如你有路由 /pageA/pageB,然后设置了 base/manage/,那么就可以通过 /manage/pageA/manage/pageB 访问到它们。

    chainWebpack

    示例:

    export default {
    +
    1
    2
    3

    base

    • 类型: string

    • 默认值: ''

    • 详情:

      设置路由前缀,通常用于部署到非根目录。比如你有路由 /pageA/pageB,然后设置了 base/manage/,那么就可以通过 /manage/pageA/manage/pageB 访问到它们。

    chainWebpack

    示例:

    export default {
         chainWebpack(memo, { env, webpack }) {
             // 删除 fes 内置插件
             memo.plugins.delete('copy');
         },
     }
    -
    1
    2
    3
    4
    5
    6

    cssLoader

    copy

    • 类型: Array(string) || Array(object)

    • 默认值: []

    • 详情:

      设置要复制到输出目录的文件、文件夹。

      配置约定 from-to 规则, 其中 from 是相对于 cwd 的路径,to 是相对于输出路径的路径。

    • 示例:

    export default {
    +
    1
    2
    3
    4
    5
    6

    cssLoader

    copy

    • 类型: Array(string) || Array(object)

    • 默认值: []

    • 详情:

      设置要复制到输出目录的文件、文件夹。

      配置约定 from-to 规则, 其中 from 是相对于 cwd 的路径,to 是相对于输出路径的路径。

    • 示例:

    export default {
         copy: {
             from: '/src/assets/images',
             to: 'assets/images'
    @@ -44,7 +44,7 @@
             __DEV__: 'development'
         }
     }
    -
    1
    2
    3
    4
    5

    然后你代码里写 console.log(__DEV__),会被编译成 console.log('development')

    devServer

    • 类型: object

    • 默认值: {}

    • 详情:

      配置开发服务器。支持以下子配置项:

      • port,端口号,默认 8000
      • host,默认 localhost
      • https,是否启用 https server,同时也会开启 HTTP/2

      启用 port 和 host 也可以通过环境变量 PORTHOST 临时指定。

    devtool

    dynamicImport

    • 类型: boolean

    • 默认值: false

    • 详情:

      路由是否按需加载

    exportStatic

    • 类型: object
    • 默认值: {}
    • 详情:

    配置 html 的输出形式,默认只输出 index.html

    如果开启 exportStatic,则会针对每个路由输出 html 文件。

    比如以下路由,

    /
    +
    1
    2
    3
    4
    5

    然后你代码里写 console.log(__DEV__),会被编译成 console.log('development')

    devServer

    • 类型: object

    • 默认值: {}

    • 详情:

      配置开发服务器。支持以下子配置项:

      • port,端口号,默认 8000
      • host,默认 localhost
      • https,是否启用 https server,同时也会开启 HTTP/2

      启用 port 和 host 也可以通过环境变量 PORTHOST 临时指定。

    devtool

    dynamicImport

    • 类型: boolean

    • 默认值: false

    • 详情:

      路由是否按需加载

    exportStatic

    • 类型: object
    • 默认值: {}
    • 详情:

    配置 html 的输出形式,默认只输出 index.html

    如果开启 exportStatic,则会针对每个路由输出 html 文件。

    比如以下路由,

    /
     /users
     /list
     
    1
    2
    3

    不开启 exportStatic 时,输出,

    - index.html
    @@ -61,7 +61,7 @@
             ['import', { libraryName: 'ant-design-vue', libraryDirectory: 'es', style: 'css' }],
         ],
     }
    -
    1
    2
    3
    4
    5

    extraBabelPresets

    • 类型: array
    • 默认值: []
    • 详情:

    配置额外的 babel 插件集。

    extraPostCSSPlugins

    html

    inlineLimit

    • 类型: number

    • 默认值: 8192(8k)

    • 详情:

      配置图片文件是否走 base64 编译的阈值。默认是 8192 字节,小于它会被编译为 base64 编码,否则会生成单独的文件。

    lessLoader

    mock

    • 类型: object || boolean

    • 默认值: {}

    • 详情:

      配置 mock 属性。

      • 当 mock 为 boolean 类型时,true 表示打开 mock,false 表示关闭 mock。
      • 当 mock 为 object 类型时,默认打开 mock。也可以通过子属性 prefix 添加过滤条件,满足条件的走 mock 文件。
    • 示例:

    export default {
    +
    1
    2
    3
    4
    5

    extraBabelPresets

    • 类型: array
    • 默认值: []
    • 详情:

    配置额外的 babel 插件集。

    extraPostCSSPlugins

    html

    inlineLimit

    • 类型: number

    • 默认值: 8192(8k)

    • 详情:

      配置图片文件是否走 base64 编译的阈值。默认是 8192 字节,小于它会被编译为 base64 编码,否则会生成单独的文件。

    lessLoader

    mock

    • 类型: object || boolean

    • 默认值: {}

    • 详情:

      配置 mock 属性。

      • 当 mock 为 boolean 类型时,true 表示打开 mock,false 表示关闭 mock。
      • 当 mock 为 object 类型时,默认打开 mock。也可以通过子属性 prefix 添加过滤条件,满足条件的走 mock 文件。
    • 示例:

    export default {
         mock: {
             prefix: '/api/auth'
         }
    @@ -76,7 +76,7 @@
         `${__dirname}/plugin.js`,
       ],
     };
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    postcssLoader

    proxy

    • 类型: object

    • 默认值: {}

    • 详情:

      配置代理能力。

    • 示例:

    export default {
    +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    postcssLoader

    proxy

    • 类型: object

    • 默认值: {}

    • 详情:

      配置代理能力。

    • 示例:

    export default {
         proxy: {
             '/v2': {
                 'target': 'https://api.douban.com/',
    @@ -84,7 +84,7 @@
             }
         }
     }
    -
    1
    2
    3
    4
    5
    6
    7
    8

    然后访问 /v2/movie/in_theaters_proxy 就能访问到 http://api.douban.com/v2/movie/in_theaters_proxy在新窗口打开 的数据。

    publicPath

    • 类型: string

    • 默认值: /

    • 详情:

      配置 webpack 的 publicPath。当打包的时候,webpack 会在静态文件路径前面添加 publicPath 的值,当你需要修改静态文件地址时,比如使用 CDN 部署,把 publicPath 的值设为 CDN 的值就可以。

    router

    • 类型: object

    • 默认值: { mode: 'hash' }

    • 详情:

      配置路由,具体请查看指南中关于路由的介绍

    singular

    • 类型: boolean

    • 默认值: false

    • 详情:

      配置是否启用单数模式的目录。 比如 src/pages 的约定在开启后为 src/page 目录,@fesjs/fes-plugins 插件也遵照此配置的约定。

    targets

    • 类型: object

    • 默认值: {}

    • 详情:

      配置需要兼容的浏览器最低版本,会自动引入 polyfill 和做语法转换。

    terserOptions

    • 类型: object
    • 默认值:
    const defaultTerserOptions = {
    +
    1
    2
    3
    4
    5
    6
    7
    8

    然后访问 /v2/movie/in_theaters_proxy 就能访问到 http://api.douban.com/v2/movie/in_theaters_proxy在新窗口打开 的数据。

    publicPath

    • 类型: string

    • 默认值: /

    • 详情:

      配置 webpack 的 publicPath。当打包的时候,webpack 会在静态文件路径前面添加 publicPath 的值,当你需要修改静态文件地址时,比如使用 CDN 部署,把 publicPath 的值设为 CDN 的值就可以。

    router

    • 类型: object

    • 默认值: { mode: 'hash' }

    • 详情:

      配置路由,具体请查看指南中关于路由的介绍

    singular

    • 类型: boolean

    • 默认值: false

    • 详情:

      配置是否启用单数模式的目录。 比如 src/pages 的约定在开启后为 src/page 目录,@fesjs/fes-plugins 插件也遵照此配置的约定。

    targets

    • 类型: object

    • 默认值: {}

    • 详情:

      配置需要兼容的浏览器最低版本,会自动引入 polyfill 和做语法转换。

    terserOptions

    • 类型: object
    • 默认值:
    const defaultTerserOptions = {
         compress: {
             // turn off flags with small gains to speed up minification
             arrows: false,
    @@ -120,7 +120,7 @@
             safari10: true
         }
     }
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36

    vueLoader

    更多配置项

    Fes.js 允许插件注册配置,如果你使用插件,肯定会在插件里找到更多配置项。

    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36

    vueLoader

    更多配置项

    Fes.js 允许插件注册配置,如果你使用插件,肯定会在插件里找到更多配置项。

    + diff --git a/reference/plugin/dev/api.html b/reference/plugin/dev/api.html index 291c4489..edc88dbe 100644 --- a/reference/plugin/dev/api.html +++ b/reference/plugin/dev/api.html @@ -5,11 +5,11 @@ 插件 API | Fes.js - - + + -

    插件 API

    属性

    api.paths

    一些关键的路径:

    • cwd,执行命令的绝对路径
    • absNodeModulesPath,nodeModule的绝对路径
    • absOutputPath,输出 build 产物的绝对路径
    • absSrcPath,src 目录的绝对路径
    • absPagesPath,pages目录的绝对路径
    • absTmpPath,.fes临时文件目录的绝对路径

    api.cwd

    执行命令的绝对路径

    api.pkg

    package.json的内容

    api.configInstance

    config实例

    userConfig

    用户配置

    config

    插件配置可被修改,此为最终的配置

    env

    process.env

    args

    环境变量

    核心方法

    describe

    注册阶段执行,用于描述插件或插件集的 id、key、配置信息、启用方式等。

    用法:describe({ id?: string, key?: string, config?: { default, schema, onChange } }, enableBy?)

    例如:

     api.describe({
    +    

    插件 API

    属性

    api.paths

    一些关键的路径:

    • cwd,执行命令的绝对路径
    • absNodeModulesPath,nodeModule的绝对路径
    • absOutputPath,输出 build 产物的绝对路径
    • absSrcPath,src 目录的绝对路径
    • absPagesPath,pages目录的绝对路径
    • absTmpPath,.fes临时文件目录的绝对路径

    api.cwd

    执行命令的绝对路径

    api.pkg

    package.json的内容

    api.configInstance

    config实例

    userConfig

    用户配置

    config

    插件配置可被修改,此为最终的配置

    env

    process.env

    args

    环境变量

    核心方法

    describe

    注册阶段执行,用于描述插件或插件集的 id、key、配置信息、启用方式等。

    用法:describe({ id?: string, key?: string, config?: { default, schema, onChange } }, enableBy?)

    例如:

     api.describe({
         key: 'esbuild',
         config: {
             schema(joi) {
    @@ -19,7 +19,7 @@
         },
         enableBy: api.EnableBy.config,
     });
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    注:

    • config.default 为配置的默认值,用户没有配置时取这个
    • config.schema 用于声明配置的类型,基于 joi在新窗口打开,如果你希望用户进行配置,这个是必须的,否则用户的配置无效
    • config.onChangedev 阶段配置被修改后的处理机制,默认会重启 dev 进程,也可以修改为 api.ConfigChangeType.regenerateTmpFiles 只重新生成临时文件,还可以通过函数的格式自定义
    • enableBy 为启用方式,默认是注册启用,可更改为 api.EnableBy.config,还可以用自定义函数的方式决定其启用时机(动态生效)

    register

    为 api.applyPlugins 注册可供其使用的 hook。

    用法:register({ key: string, fn: Function, pluginId?: string, before?: string, stage?: number })

    参数:

    • key:唯一id
    • fn:hook函数,当执行api.applyPlugins时,此函数被执行。
    • pluginId:插件id,如果配置了插件id,则只有此插件未被禁用时,才会执行。
    // 可同步
    +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    注:

    • config.default 为配置的默认值,用户没有配置时取这个
    • config.schema 用于声明配置的类型,基于 joi在新窗口打开,如果你希望用户进行配置,这个是必须的,否则用户的配置无效
    • config.onChangedev 阶段配置被修改后的处理机制,默认会重启 dev 进程,也可以修改为 api.ConfigChangeType.regenerateTmpFiles 只重新生成临时文件,还可以通过函数的格式自定义
    • enableBy 为启用方式,默认是注册启用,可更改为 api.EnableBy.config,还可以用自定义函数的方式决定其启用时机(动态生效)

    register

    为 api.applyPlugins 注册可供其使用的 hook。

    用法:register({ key: string, fn: Function, pluginId?: string, before?: string, stage?: number })

    参数:

    • key:唯一id
    • fn:hook函数,当执行api.applyPlugins时,此函数被执行。
    • pluginId:插件id,如果配置了插件id,则只有此插件未被禁用时,才会执行。
    // 可同步
     api.register({
       key: 'foo',
       fn() {
    @@ -59,7 +59,7 @@ console.log<
         }
     });
     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

    然后在插件中可以使用:

    api.writeTmpFile()
    -
    1

    registerCommand

    注册命令,基于 commander在新窗口打开 实现的机制。

    用法:registerCommand({ command: string, description: string, fn: Function, options?: Object })

    参数:

    • command
    • description,描述文字,输入 --help 会打印
    • fn,命令执行的函数,参数有:
      • rawArgv,原始参数
      • args,参数
      • options,执行命令时附带的的参数配置
      • program,commander对象
    • options,参数配置,基于 commander在新窗口打开

    例如:

    api.registerCommand({
    +
    1

    registerCommand

    注册命令,基于 commander在新窗口打开 实现的机制。

    用法:registerCommand({ command: string, description: string, fn: Function, options?: Object })

    参数:

    • command
    • description,描述文字,输入 --help 会打印
    • fn,命令执行的函数,参数有:
      • rawArgv,原始参数
      • args,参数
      • options,执行命令时附带的的参数配置
      • program,commander对象
    • options,参数配置,基于 commander在新窗口打开

    例如:

    api.registerCommand({
         command: 'webpack',
         description: 'inspect webpack configurations',
         options: [{
    @@ -228,7 +228,7 @@ api.modifyRo
             }
         )
     });
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9

    参数:

    • path:相对于临时文件夹的路径
    • content:文件内容

    提示

    不能在注册阶段使用,通常放在 api.onGenerateFiles() 里,这样能在需要时重新生成临时文件 临时文件的写入做了缓存处理,如果内容一致,不会做写的操作,以减少触发 webpack 的重新编译

    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9

    参数:

    • path:相对于临时文件夹的路径
    • content:文件内容

    提示

    不能在注册阶段使用,通常放在 api.onGenerateFiles() 里,这样能在需要时重新生成临时文件 临时文件的写入做了缓存处理,如果内容一致,不会做写的操作,以减少触发 webpack 的重新编译

    + diff --git a/reference/plugin/dev/index.html b/reference/plugin/dev/index.html index bfd3b16c..ec17d066 100644 --- a/reference/plugin/dev/index.html +++ b/reference/plugin/dev/index.html @@ -5,11 +5,11 @@ 插件介绍 | Fes.js - - + + -

    插件介绍

    开始

    一个插件是一个 npm 包,它能够为 Fes.js 创建的项目添加额外的功能,这些功能包括:

    • 项目的 webpack 配置。
    • 修改项目的 babel 配置。
    • 添加新的 fes 命令 - 例如 @fes/plugin-jest 添加了 fes test 命令,允许开发者运行单元测试。
    • 集成 Vue 的插件。
    • 修改路由配置
    • 提供运行时 API
    • ...

    插件的入口是一个函数,函数会以 API 对象作为第一个参数:

    export default (api)=>{
    +    

    插件介绍

    开始

    一个插件是一个 npm 包,它能够为 Fes.js 创建的项目添加额外的功能,这些功能包括:

    • 项目的 webpack 配置。
    • 修改项目的 babel 配置。
    • 添加新的 fes 命令 - 例如 @fes/plugin-jest 添加了 fes test 命令,允许开发者运行单元测试。
    • 集成 Vue 的插件。
    • 修改路由配置
    • 提供运行时 API
    • ...

    插件的入口是一个函数,函数会以 API 对象作为第一个参数:

    export default (api)=>{
         api.describe({
             key: 'esbuild',
             config: {
    @@ -25,7 +25,7 @@
     
    1
    第二步:创建插件项目
    create-fes-app pluginName
     
    1

    在询问Pick an template时选择Plugin!

    第三步:进入插件目录 & 安装依赖
    cd pluginName & yarn
     
    1
    第四步:启动编译
    yarn dev
    -
    1
    第五步:使用插件API完成你的插件!(可以参考其他插件理解api用法和场景)

    发布到 npm

    @fesjs/preset-@fesjs/plugin-@webank/fes-preset-@webank/fes-plugin-fes-preset-fes-plugin- 开头的依赖会被 Fes.js 自动注册为插件或插件集。

    所以编写好的插件想发布到 npm 供其他人使用,包名必须是 fes-preset-fes-plugin- 开头。

    - +
    1
    第五步:使用插件API完成你的插件!(可以参考其他插件理解api用法和场景)

    发布到 npm

    @fesjs/preset-@fesjs/plugin-@webank/fes-preset-@webank/fes-plugin-fes-preset-fes-plugin- 开头的依赖会被 Fes.js 自动注册为插件或插件集。

    所以编写好的插件想发布到 npm 供其他人使用,包名必须是 fes-preset-fes-plugin- 开头。

    + diff --git a/reference/plugin/index.html b/reference/plugin/index.html index 8528c22d..99355303 100644 --- a/reference/plugin/index.html +++ b/reference/plugin/index.html @@ -5,11 +5,11 @@ 介绍 | Fes.js - - + + -

    介绍

    插件列表

    插件介绍
    @fesjs/plugin-access提供对页面资源的权限控制能力
    @fesjs/plugin-enums提供统一的枚举存取及丰富的函数来处理枚举
    @fesjs/plugin-iconsvg 文件自动注册为组件
    @fesjs/plugin-jest基于 Jest,提供单元测试、覆盖测试能力
    @fesjs/plugin-layout简单的配置即可拥有布局,包括导航以及侧边栏
    @fesjs/plugin-locale基于 Vue I18n,提供国际化能力
    @fesjs/plugin-model简易的数据管理方案
    @fesjs/plugin-request基于 Axios 封装的 request,内置防止重复请求、请求节流、错误处理等功能
    @fesjs/plugin-vuex基于 Vuex, 提供状态管理能力
    @fesjs/plugin-qiankun基于 qiankun,提供微服务能力
    @fesjs/plugin-sass样式支持sass
    @fesjs/plugin-monaco-editor提供代码编辑器能力, 基于monaco-editor(VS Code使用的代码编辑器)
    @fesjs/plugin-windicss基于 windicss,提供原子化 CSS 能力
    @fesjs/plugin-pinia基于 pinia,提供状态管理
    @fesjs/plugin-watermark水印

    架构

    架构

    Fes.js 把大家常用的技术栈封装成一个个插件进行整理,收敛到一起,让大家只用 Fes.js 就可以完成 80% 的日常工作。

    - +

    介绍

    插件列表

    插件介绍
    @fesjs/plugin-access提供对页面资源的权限控制能力
    @fesjs/plugin-enums提供统一的枚举存取及丰富的函数来处理枚举
    @fesjs/plugin-iconsvg 文件自动注册为组件
    @fesjs/plugin-jest基于 Jest,提供单元测试、覆盖测试能力
    @fesjs/plugin-layout简单的配置即可拥有布局,包括导航以及侧边栏
    @fesjs/plugin-locale基于 Vue I18n,提供国际化能力
    @fesjs/plugin-model简易的数据管理方案
    @fesjs/plugin-request基于 Axios 封装的 request,内置防止重复请求、请求节流、错误处理等功能
    @fesjs/plugin-vuex基于 Vuex, 提供状态管理能力
    @fesjs/plugin-qiankun基于 qiankun,提供微服务能力
    @fesjs/plugin-sass样式支持sass
    @fesjs/plugin-monaco-editor提供代码编辑器能力, 基于monaco-editor(VS Code使用的代码编辑器)
    @fesjs/plugin-windicss基于 windicss,提供原子化 CSS 能力
    @fesjs/plugin-pinia基于 pinia,提供状态管理
    @fesjs/plugin-watermark水印

    架构

    架构

    Fes.js 把大家常用的技术栈封装成一个个插件进行整理,收敛到一起,让大家只用 Fes.js 就可以完成 80% 的日常工作。

    + diff --git a/reference/plugin/plugins/access.html b/reference/plugin/plugins/access.html index f75e3864..6f9661ec 100644 --- a/reference/plugin/plugins/access.html +++ b/reference/plugin/plugins/access.html @@ -5,11 +5,11 @@ @fesjs/plugin-access | Fes.js - - + + -

    @fesjs/plugin-access

    介绍

    对于前端应用来说,权限就是页面、页面元素是否可见。

    资源

    Fes.js 把页面、页面元素统一叫做资源,用资源 ID 来识别区分他们:

    • 页面的资源 ID 默认是页面的路由 path 。比如页面 pages/a.vue 的路由 path/a。当页面访问 /a 时会渲染当前页面,/a 也就是页面的 accessId

    • 页面元素的资源 ID 没有默认值,需要自定义。

    <template>
    +    

    @fesjs/plugin-access

    介绍

    对于前端应用来说,权限就是页面、页面元素是否可见。

    资源

    Fes.js 把页面、页面元素统一叫做资源,用资源 ID 来识别区分他们:

    • 页面的资源 ID 默认是页面的路由 path 。比如页面 pages/a.vue 的路由 path/a。当页面访问 /a 时会渲染当前页面,/a 也就是页面的 accessId

    • 页面元素的资源 ID 没有默认值,需要自定义。

    <template>
         <access :id="accessId"> accessOnepicess1 <input /> </access>
         <div v-access="accessId"> accessOnepicess2 </div>
     </template>
    @@ -43,7 +43,7 @@
             }
         }
     }
    -
    1
    2
    3
    4
    5
    6
    7

    roles

    • 类型:对象

    • 默认值{}

    • 详情

      角色预定义列表。key 是角色 Id ,value是角色 Id 对应的资源列表。

    运行时配置

    app.js 中配置

    unAccessHandler

    • 类型Function

    • 默认值null

    • 详情

      当进入某个路由时,如果路由对应的页面不属于可见资源列表,则会暂停进入,调用 unAccessHandler 函数。

    • 参数

    比如:

    export const access = {
    +
    1
    2
    3
    4
    5
    6
    7

    roles

    • 类型:对象

    • 默认值{}

    • 详情

      角色预定义列表。key 是角色 Id ,value是角色 Id 对应的资源列表。

    运行时配置

    app.js 中配置

    unAccessHandler

    • 类型Function

    • 默认值null

    • 详情

      当进入某个路由时,如果路由对应的页面不属于可见资源列表,则会暂停进入,调用 unAccessHandler 函数。

    • 参数

    比如:

    export const access = {
         unAccessHandler({ to, next }) {
             const accesssIds = accessApi.getAccess();
             if (to.path === '/404') {
    @@ -57,7 +57,7 @@
         }
     };
     
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    noFoundHandler

    • 类型Function

    • 默认值null

    • 详情

      当进入某个路由时,如果路由对应的页面不存在,则会调用 noFoundHandler 函数。

    • 参数

    比如:

    export const access = {
    +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    noFoundHandler

    • 类型Function

    • 默认值null

    • 详情

      当进入某个路由时,如果路由对应的页面不存在,则会调用 noFoundHandler 函数。

    • 参数

    比如:

    export const access = {
         noFoundHandler({ next }) {
             const accesssIds = accessApi.getAccess();
             if (!accesssIds.includes('/404')) {
    @@ -114,7 +114,7 @@ access.getAc
         }
     }
     </script>
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    + diff --git a/reference/plugin/plugins/editor.html b/reference/plugin/plugins/editor.html index 9606e7f4..7f54955c 100644 --- a/reference/plugin/plugins/editor.html +++ b/reference/plugin/plugins/editor.html @@ -5,11 +5,11 @@ @fesjs/plugin-monaco-editor | Fes.js - - + + -

    @fesjs/plugin-monaco-editor

    介绍

    我们会遇到需要编辑代码的场景,比如编辑jsonjavascriptpython等等,Monaco Editor在新窗口打开 是一个好用而且强大的的代码编辑器库,引入Monaco Editor有一定的成本,插件实现了胶水代码,提供轻松引入的能力。目前内置的 Monaco Editor 版本是 1.9.1

    启用方式

    package.json 中引入依赖:

    {
    +    

    @fesjs/plugin-monaco-editor

    介绍

    我们会遇到需要编辑代码的场景,比如编辑jsonjavascriptpython等等,Monaco Editor在新窗口打开 是一个好用而且强大的的代码编辑器库,引入Monaco Editor有一定的成本,插件实现了胶水代码,提供轻松引入的能力。目前内置的 Monaco Editor 版本是 1.9.1

    启用方式

    package.json 中引入依赖:

    {
         "dependencies": {
             "@fesjs/fes": "^2.0.0",
             "@fesjs/plugin-monaco-editor": "^2.0.0"
    @@ -20,12 +20,12 @@
             languages: ['javascript', 'typescript', 'html', 'json']
         }
     }
    -
    1
    2
    3
    4
    5

    我们通过 monaco-editor-webpack-plugin 集成 Monaco EditorESM版本,所以编辑时其实就是 monaco-editor-webpack-plugin 的配置,具体配置项参考文档在新窗口打开

    filename

    • 类型:自定义worker脚本名称

    • 默认值'[name].worker.js'

    publicPath

    • 类型:自定义worker脚本的路径

    • 默认值''

    languages

    • 类型:需要支持的语言类型

    • 默认值['abap', 'apex', 'azcli', 'bat', 'bicep', 'cameligo', 'clojure', 'coffee', 'cpp', 'csharp', 'csp', 'css', 'dart', 'dockerfile', 'ecl', 'elixir', 'fsharp', 'go', 'graphql', 'handlebars', 'hcl', 'html', 'ini', 'java', 'javascript', 'json', 'julia', 'kotlin', 'less', 'lexon', 'liquid', 'lua', 'm3', 'markdown', 'mips', 'msdax', 'mysql', 'objective-c', 'pascal', 'pascaligo', 'perl', 'pgsql', 'php', 'postiats', 'powerquery', 'powershell', 'pug', 'python', 'qsharp', 'r', 'razor', 'redis', 'redshift', 'restructuredtext', 'ruby', 'rust', 'sb', 'scala', 'scheme', 'scss', 'shell', 'solidity', 'sophia', 'sparql', 'sql', 'st', 'swift', 'systemverilog', 'tcl', 'twig', 'typescript', 'vb', 'xml', 'yaml']

    • 详情:默认是全部,但是编译后包体积会非常大,建议用到什么语言则配置什么语言。特别某些语言依赖其他语言,例如javascript依赖typescript,需要使用javascript时需要配置为:

    export default {
    +
    1
    2
    3
    4
    5

    我们通过 monaco-editor-webpack-plugin 集成 Monaco EditorESM版本,所以编辑时其实就是 monaco-editor-webpack-plugin 的配置,具体配置项参考文档在新窗口打开

    filename

    • 类型:自定义worker脚本名称

    • 默认值'[name].worker.js'

    publicPath

    • 类型:自定义worker脚本的路径

    • 默认值''

    languages

    • 类型:需要支持的语言类型

    • 默认值['abap', 'apex', 'azcli', 'bat', 'bicep', 'cameligo', 'clojure', 'coffee', 'cpp', 'csharp', 'csp', 'css', 'dart', 'dockerfile', 'ecl', 'elixir', 'fsharp', 'go', 'graphql', 'handlebars', 'hcl', 'html', 'ini', 'java', 'javascript', 'json', 'julia', 'kotlin', 'less', 'lexon', 'liquid', 'lua', 'm3', 'markdown', 'mips', 'msdax', 'mysql', 'objective-c', 'pascal', 'pascaligo', 'perl', 'pgsql', 'php', 'postiats', 'powerquery', 'powershell', 'pug', 'python', 'qsharp', 'r', 'razor', 'redis', 'redshift', 'restructuredtext', 'ruby', 'rust', 'sb', 'scala', 'scheme', 'scss', 'shell', 'solidity', 'sophia', 'sparql', 'sql', 'st', 'swift', 'systemverilog', 'tcl', 'twig', 'typescript', 'vb', 'xml', 'yaml']

    • 详情:默认是全部,但是编译后包体积会非常大,建议用到什么语言则配置什么语言。特别某些语言依赖其他语言,例如javascript依赖typescript,需要使用javascript时需要配置为:

    export default {
         monacoEditor: {
             languages: ['javascript', 'typescript']
         }
     }
    -
    1
    2
    3
    4
    5

    API

    monaco

    编辑器的全局对象,提供扩展语言,自定义主题等等API,具体用法请查看monaco在新窗口打开官方文档。

    import { monaco } from '@fesjs/fes';
    +
    1
    2
    3
    4
    5

    API

    monaco

    编辑器的全局对象,提供扩展语言,自定义主题等等API,具体用法请查看monaco在新窗口打开官方文档。

    import { monaco } from '@fesjs/fes';
     
     monaco.editor.defineTheme('myCoolTheme', {
     	base: 'vs',
    @@ -60,7 +60,7 @@ monaco.editor}
     }
     </script>
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    props

    属性说明类型默认值
    theme编辑器的主题,使用其他主题需要先使用monaco.editor.defineTheme定义主题stringdefaultTheme
    language编辑器的语言string-
    height编辑器的高度string100%
    width编辑器的宽度string100%
    modelValue(v-model)编辑器的代码string-
    readOnly是否只读booleanfalse
    options编辑器的配置对象object{}
    check是否检查代码,如果检查不通过则不更新数据,目前只支持jsonbooleanfalse

    events

    事件名称说明回调参数
    onload编辑器初始化后触发({monaco, editor, editorModel}) => void
    scrollChange滚动时触发(e) => void
    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    props

    属性说明类型默认值
    theme编辑器的主题,使用其他主题需要先使用monaco.editor.defineTheme定义主题stringdefaultTheme
    language编辑器的语言string-
    height编辑器的高度string100%
    width编辑器的宽度string100%
    modelValue(v-model)编辑器的代码string-
    readOnly是否只读booleanfalse
    options编辑器的配置对象object{}
    check是否检查代码,如果检查不通过则不更新数据,目前只支持jsonbooleanfalse

    events

    事件名称说明回调参数
    onload编辑器初始化后触发({monaco, editor, editorModel}) => void
    scrollChange滚动时触发(e) => void
    + diff --git a/reference/plugin/plugins/enums.html b/reference/plugin/plugins/enums.html index e6752815..04c12275 100644 --- a/reference/plugin/plugins/enums.html +++ b/reference/plugin/plugins/enums.html @@ -5,11 +5,11 @@ @fesjs/plugin-enums | Fes.js - - + + -

    @fesjs/plugin-enums

    介绍

    日常业务开发中,有很多场景会使用到枚举值,比如select-options、table-column。

    该插件提供统一的枚举存取及丰富的函数来处理枚举。

    启用方式

    package.json 中引入依赖:

    {
    +    

    @fesjs/plugin-enums

    介绍

    日常业务开发中,有很多场景会使用到枚举值,比如select-options、table-column。

    该插件提供统一的枚举存取及丰富的函数来处理枚举。

    启用方式

    package.json 中引入依赖:

    {
         "dependencies": {
             "@fesjs/fes": "^2.0.0",
             "@fesjs/plugin-enums": "^2.0.0"
    @@ -136,7 +136,7 @@ dir              value
     'age'        =>  18
     'role[0]'    =>  {id: 1, name: '管理员'}
     'role[1].id' =>  2
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

    提示

    枚举项value如果是基本类型,则规则不生效,value就是当前值

    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

    提示

    枚举项value如果是基本类型,则规则不生效,value就是当前值

    + diff --git a/reference/plugin/plugins/icon.html b/reference/plugin/plugins/icon.html index d67ae209..6b0f1f31 100644 --- a/reference/plugin/plugins/icon.html +++ b/reference/plugin/plugins/icon.html @@ -5,18 +5,18 @@ @fesjs/plugin-icon | Fes.js - - + + -

    @fesjs/plugin-icon

    介绍

    提供以 component 的方式,直接使用 svg icon 的能力。

    启用方式

    package.json 中引入依赖:

    属性

    属性说明类型
    typesvg 文件名string
    spin是否无限旋转boolean
    rotate旋转角度number
    + diff --git a/reference/plugin/plugins/jest.html b/reference/plugin/plugins/jest.html index 09f52be3..06647aa4 100644 --- a/reference/plugin/plugins/jest.html +++ b/reference/plugin/plugins/jest.html @@ -5,11 +5,11 @@ @fesjs/plugin-jest | Fes.js - - + + -

    @fesjs/plugin-jest

    集成 Jest在新窗口打开 测试框架,目前只支持单元测试和覆盖测试。

    启用方式

    package.json 中引入依赖:

    {
    +    

    @fesjs/plugin-jest

    集成 Jest在新窗口打开 测试框架,目前只支持单元测试和覆盖测试。

    启用方式

    package.json 中引入依赖:

    {
         "dependencies": {
             "@fesjs/fes": "^2.0.0",
             "@fesjs/plugin-jest": "^2.0.0"
    @@ -28,7 +28,7 @@
     });
     
     
    1
    2
    3
    4
    5

    命令

    fes 上注册 test 命令:

    $ fes test
    -
    1

    配置

    插件实现 Jest 的全部配置,具体请查看 文档-configuration在新窗口打开。 也可以使用 -h 打印配置帮助信息:

    args 变量

    $ fes test -h
    +
    1

    配置

    插件实现 Jest 的全部配置,具体请查看 文档-configuration在新窗口打开。 也可以使用 -h 打印配置帮助信息:

    args 变量

    $ fes test -h
     
    1

    打印配置帮助信息:

    $ fes test -h
     Usage: fes test [options]
     
    @@ -316,7 +316,7 @@ Options:
       -h, --help                    display help for command
     
     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286

    比如覆盖测试:

    fes test --coverage
    -
    1

    配置文件

    除了插件内置的默认配置之外,插件遵循 Jest的配置文件规范,约定项目根目录下的 jest.config.js 为用户配置文件,约定 packages.jsonjest 属性内容也是配置。

    优先级

    args 配置 > package.json中的 jest > jest.config.js > 默认配置

    - +
    1

    配置文件

    除了插件内置的默认配置之外,插件遵循 Jest的配置文件规范,约定项目根目录下的 jest.config.js 为用户配置文件,约定 packages.jsonjest 属性内容也是配置。

    优先级

    args 配置 > package.json中的 jest > jest.config.js > 默认配置

    + diff --git a/reference/plugin/plugins/layout.html b/reference/plugin/plugins/layout.html index 7d789892..9fbf33fd 100644 --- a/reference/plugin/plugins/layout.html +++ b/reference/plugin/plugins/layout.html @@ -5,11 +5,11 @@ @fesjs/plugin-layout | Fes.js - - + + -

    @fesjs/plugin-layout

    介绍

    为了进一步降低研发成本,我们尝试将布局通过 fes 插件的方式内置,只需通过简单的配置即可拥有布局,包括导航以及侧边栏。从而做到用户无需关心布局。

    • 侧边栏菜单数据根据路由中的配置自动生成。

    • 布局,提供 sidetopmixin 三种布局。

    • 主题,提供 lightdark 两种主题。

    • 默认实现对路由的 404、403 处理。

    • 搭配 @fesjs/plugin-access 插件使用,可以完成对路由的权限控制。

    • 搭配 @fesjs/plugin-locale 插件使用,提供切换语言的能力。

    • 支持自定义头部区域。

    • 菜单支持配置icon

    • 菜单标题支持国际化

    • 可配置页面是否需要 layout。

    启用方式

    package.json 中引入依赖:

    {
    +    

    @fesjs/plugin-layout

    介绍

    为了进一步降低研发成本,我们尝试将布局通过 fes 插件的方式内置,只需通过简单的配置即可拥有布局,包括导航以及侧边栏。从而做到用户无需关心布局。

    • 侧边栏菜单数据根据路由中的配置自动生成。

    • 布局,提供 sidetopmixin 三种布局。

    • 主题,提供 lightdark 两种主题。

    • 默认实现对路由的 404、403 处理。

    • 搭配 @fesjs/plugin-access 插件使用,可以完成对路由的权限控制。

    • 搭配 @fesjs/plugin-locale 插件使用,提供切换语言的能力。

    • 支持自定义头部区域。

    • 菜单支持配置icon

    • 菜单标题支持国际化

    • 可配置页面是否需要 layout。

    启用方式

    package.json 中引入依赖:

    {
         "dependencies": {
             "@fesjs/fes": "^2.0.0",
             "@fesjs/plugin-layout": "^4.0.0"
    @@ -74,7 +74,7 @@
         path: '/product',
         match: ['/product/*', '/product/create']
     }
    -
    1
    2
    3
    4
    • title:菜单的标题,如果同时使用国际化插件,而且title的值以$开头,则使用$后面的内容去匹配语言设置。

    • icon: 菜单的图标,只有一级标题展示图标。

    {
    +
    1
    2
    3
    4
    • title:菜单的标题,如果同时使用国际化插件,而且title的值以$开头,则使用$后面的内容去匹配语言设置。

    • icon: 菜单的图标,只有一级标题展示图标。

    {
         icon: "AppstoreOutlined"
     }
     
    1
    2
    3
    - 图标使用本地或者远程svg图片。
    @@ -102,7 +102,7 @@
         }
     });
     
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    layoutConfig.initialStatebeforeRender.action执行后创建的应用初始状态数据。

    如果菜单需要根据某些状态动态改变,则返回Ref,否则只需要返回数组。

    提示

    在运行时配置菜单中的icon,需要传组件本身,而不是组件的名称。

    • 类型String

    • 默认值true

    • 详情:是否显示 header 区域。

    • 类型String

    • 默认值true

    • 详情:是否显示 sidebar 区域。

    logo

    • 类型String

    • 默认值true

    • 详情:是否显示 logo 区域。

    customHeader

    • 类型:Vue Component

    • 默认值null

    • 详情:top的区域部分位置提供组件自定义功能。

    unAccessHandler

    • 类型Function

    • 默认值null

    • 详情

      当进入某个路由时,如果路由对应的页面不属于可见资源列表,则会暂停进入,调用 unAccessHandler 函数。

    • 参数

    比如:

    export const access = {
    +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    layoutConfig.initialStatebeforeRender.action执行后创建的应用初始状态数据。

    如果菜单需要根据某些状态动态改变,则返回Ref,否则只需要返回数组。

    提示

    在运行时配置菜单中的icon,需要传组件本身,而不是组件的名称。

    • 类型String

    • 默认值true

    • 详情:是否显示 header 区域。

    • 类型String

    • 默认值true

    • 详情:是否显示 sidebar 区域。

    logo

    • 类型String

    • 默认值true

    • 详情:是否显示 logo 区域。

    customHeader

    • 类型:Vue Component

    • 默认值null

    • 详情:top的区域部分位置提供组件自定义功能。

    unAccessHandler

    • 类型Function

    • 默认值null

    • 详情

      当进入某个路由时,如果路由对应的页面不属于可见资源列表,则会暂停进入,调用 unAccessHandler 函数。

    • 参数

    比如:

    export const access = {
         unAccessHandler({ to, next }) {
             const accesssIds = accessApi.getAccess();
             if (to.path === '/404') {
    @@ -116,7 +116,7 @@
         }
     };
     
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    noFoundHandler

    • 类型:函数

    • 默认值:null

    • 详情

      当进入某个路由时,如果路由对应的页面不存在,则会调用 noFoundHandler 函数。

    • 参数

    比如:

    export const access = {
    +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    noFoundHandler

    • 类型:函数

    • 默认值:null

    • 详情

      当进入某个路由时,如果路由对应的页面不存在,则会调用 noFoundHandler 函数。

    • 参数

    比如:

    export const access = {
         noFoundHandler({ next }) {
             const accesssIds = accessApi.getAccess();
             if (!accesssIds.includes('/404')) {
    @@ -126,7 +126,7 @@
         }
     };
     
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    logoUrl

    • 类型String

    • 默认值:默认提供 fes.js 的 Logo

    • 详情:Logo的链接。

    其他运行时配置 (> 4.1.0)

    编译时配置的内容同样支持在运行时配置,但是logo除外,用logoUrl替代。

    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    logoUrl

    • 类型String

    • 默认值:默认提供 fes.js 的 Logo

    • 详情:Logo的链接。

    其他运行时配置 (> 4.1.0)

    编译时配置的内容同样支持在运行时配置,但是logo除外,用logoUrl替代。

    + diff --git a/reference/plugin/plugins/locale.html b/reference/plugin/plugins/locale.html index 085f2f7d..0b07fc08 100644 --- a/reference/plugin/plugins/locale.html +++ b/reference/plugin/plugins/locale.html @@ -5,11 +5,11 @@ @fesjs/plugin-locale | Fes.js - - + + -

    @fesjs/plugin-locale

    介绍

    国际化插件,基于 Vue I18n在新窗口打开,用于解决 i18n 问题。

    启用方式

    package.json 中引入依赖:

    {
    +    

    @fesjs/plugin-locale

    介绍

    国际化插件,基于 Vue I18n在新窗口打开,用于解决 i18n 问题。

    启用方式

    package.json 中引入依赖:

    {
         "dependencies": {
             "@fesjs/fes": "^2.0.0",
             "@fesjs/plugin-locale": "^2.0.0"
    @@ -46,7 +46,7 @@
             ui: 'UI components'
         }
     };
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    想了解更多语言信息配置、匹配规则,请参考 Vue I18n在新窗口打开 文档。

    编译时配置

    在执行 fes dev 或者 fes build 时,通过此配置生成运行时的代码,在配置文件.fes.js 中配置:

    export default {
    +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    想了解更多语言信息配置、匹配规则,请参考 Vue I18n在新窗口打开 文档。

    编译时配置

    在执行 fes dev 或者 fes build 时,通过此配置生成运行时的代码,在配置文件.fes.js 中配置:

    export default {
         locale: {
         }
     }
    @@ -66,7 +66,7 @@ locale.addLo
     
    1
    2

    locale.getAllLocales

    • 类型Function

    • 详情:获取当前获得所有国际化文件的列表,默认会在 locales 文件夹下寻找类似 en-US.js 文件。

    • 参数:null

    • 返回值Array

    import { locale } from '@fesjs/fes';
     console.log(locale.getAllLocales());
     // ["en-US", "id-ID", "ja-JP", "pt-BR", "zh-CN", "zh-TW"]
    -
    1
    2
    3

    useI18n

    Composition API, 只能在 setup 函数中使用,更多细节参考 Vue I18n在新窗口打开。 举个 🌰:

    <template>
    +
    1
    2
    3

    useI18n

    Composition API, 只能在 setup 函数中使用,更多细节参考 Vue I18n在新窗口打开。 举个 🌰:

    <template>
       <form>
         <label>{{ t('language') }}</label>
       </form>
    @@ -85,7 +85,7 @@ console.log<
      }
     }
     </script>
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19

    useI18n()返回结果是 Composer在新窗口打开,提供类似 tnd 等转换函数,在模板中使用。

    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19

    useI18n()返回结果是 Composer在新窗口打开,提供类似 tnd 等转换函数,在模板中使用。

    + diff --git a/reference/plugin/plugins/model.html b/reference/plugin/plugins/model.html index 6542d6da..28abe18c 100644 --- a/reference/plugin/plugins/model.html +++ b/reference/plugin/plugins/model.html @@ -5,11 +5,11 @@ @fesjs/plugin-model | Fes.js - - + + -

    @fesjs/plugin-model

    启用方式

    在 package.json 中引入依赖:

    API

    useModel

    useModel(name)

    • 类型:函数

    • 详情: 获取 Model 数据,也就是 Model 文件默认导出函数执行的结果。

    • 参数

      • name,传入 Model 文件名
    + diff --git a/reference/plugin/plugins/pinia.html b/reference/plugin/plugins/pinia.html index 4ef7172f..542de860 100644 --- a/reference/plugin/plugins/pinia.html +++ b/reference/plugin/plugins/pinia.html @@ -5,11 +5,11 @@ @fesjs/plugin-pinia | Fes.js - - + + -

    @fesjs/plugin-pinia

    介绍

    集成 pinia在新窗口打开 ,提供状态管理的能力,封装一些胶水代码,可以直接定义store 使用。

    为了防止 Fes.jspinia 提供的 API 冲突,Fes.js不提供任何 pinia 的API,相关API直接从 pinia 导出:

    import { defineStore } from 'pinia';
    +    

    @fesjs/plugin-pinia

    介绍

    集成 pinia在新窗口打开 ,提供状态管理的能力,封装一些胶水代码,可以直接定义store 使用。

    为了防止 Fes.jspinia 提供的 API 冲突,Fes.js不提供任何 pinia 的API,相关API直接从 pinia 导出:

    import { defineStore } from 'pinia';
     
    1

    约定 plugin 定义放在 stores 目录下,文件名包含plugin被解析为插件,无需额外配置,定义即可用。

    └── src
         ├── pages
         │    └── index.vue
    @@ -56,7 +56,7 @@
             });
         }
     };
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    + diff --git a/reference/plugin/plugins/qiankun.html b/reference/plugin/plugins/qiankun.html index c277eb22..93139752 100644 --- a/reference/plugin/plugins/qiankun.html +++ b/reference/plugin/plugins/qiankun.html @@ -5,11 +5,11 @@ @fesjs/plugin-qiankun | Fes.js - - + + -

    @fesjs/plugin-qiankun

    Fes.js plugin for qiankun在新窗口打开,参考@umijs/plugin-qiankun在新窗口打开 实现,喜欢 React 的同学推荐直接用 Umi。

    启用方式

    package.json 中引入依赖:

    {
    +    

    @fesjs/plugin-qiankun

    Fes.js plugin for qiankun在新窗口打开,参考@umijs/plugin-qiankun在新窗口打开 实现,喜欢 React 的同学推荐直接用 Umi。

    启用方式

    package.json 中引入依赖:

    {
         "dependencies": {
             "@fesjs/fes": "^2.0.0",
             "@fesjs/plugin-qiankun": "^2.0.0"
    @@ -184,7 +184,7 @@
         }
     }
     </script>
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    基于 props 传递

    • 主应用使用 props 的模式传递数据(参考主应用装载子应用配置一节)
    • 子应用在生命周期钩子中获取 props 消费数据(参考子应用运行时配置一节)

    MicroApp

    属性说明类型默认值
    name子应用名称,传入qiankun.main.apps配置中的nameString-
    settings子应用配置信息Object{}
    props传入子应用的参数Object{}
    lifeCycles子应用生命周期钩子Object{}
    cacheName子应用缓存名称,配置后根据name+cacheName缓存子应用实例Object-

    MicroAppWithMemoHistory

    属性说明类型默认值
    name子应用名称,传入qiankun.main.apps配置中的nameString-
    settings子应用配置信息Object{}
    props传入子应用的参数Object{}
    lifeCycles子应用生命周期钩子Object{}
    cacheName子应用缓存名称,配置后根据name+cacheName缓存子应用实例Object-
    url子应用的路由地址String-
    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    基于 props 传递

    • 主应用使用 props 的模式传递数据(参考主应用装载子应用配置一节)
    • 子应用在生命周期钩子中获取 props 消费数据(参考子应用运行时配置一节)

    MicroApp

    属性说明类型默认值
    name子应用名称,传入qiankun.main.apps配置中的nameString-
    settings子应用配置信息Object{}
    props传入子应用的参数Object{}
    lifeCycles子应用生命周期钩子Object{}
    cacheName子应用缓存名称,配置后根据name+cacheName缓存子应用实例Object-

    MicroAppWithMemoHistory

    属性说明类型默认值
    name子应用名称,传入qiankun.main.apps配置中的nameString-
    settings子应用配置信息Object{}
    props传入子应用的参数Object{}
    lifeCycles子应用生命周期钩子Object{}
    cacheName子应用缓存名称,配置后根据name+cacheName缓存子应用实例Object-
    url子应用的路由地址String-
    + diff --git a/reference/plugin/plugins/request.html b/reference/plugin/plugins/request.html index 96ac09cc..b49d1920 100644 --- a/reference/plugin/plugins/request.html +++ b/reference/plugin/plugins/request.html @@ -5,11 +5,11 @@ @fesjs/plugin-request | Fes.js - - + + -

    @fesjs/plugin-request

    基于 axios 封装的 request,内置防止重复请求、请求节流、错误处理等功能。

    启用方式

    package.json 中引入依赖:

    {
    +    

    @fesjs/plugin-request

    基于 axios 封装的 request,内置防止重复请求、请求节流、错误处理等功能。

    启用方式

    package.json 中引入依赖:

    {
         "dependencies": {
             "@fesjs/fes": "^2.0.0",
             "@fesjs/plugin-request": "^2.0.0"
    @@ -20,7 +20,7 @@
             dataField: 'result'
         }
     };
    -
    1
    2
    3
    4
    5

    dataField

    • 类型: string

    • 默认值: ''

    • 详情:

      dataField 对应接口统一格式中的数据字段,比如接口如果统一的规范是 { success: boolean, result: any} ,那么就不需要配置,这样你通过 useRequest 消费的时候会生成一个默认的 formatResult,直接返回 result 中的数据,方便使用。如果你的后端接口不符合这个规范,可以自行配置 dataField。配置为 ''(空字符串)的时候不做处理。

    base(即将废弃)

    • 类型: string

    • 默认值: ''

    • 详情:

      base 接口前缀。

    即将废弃

    这个字段将在下个版本废弃,推荐使用 axios baseURL在新窗口打开

    运行时配置

    app.js 中进行运行时配置。

    export const request = {
    +
    1
    2
    3
    4
    5

    dataField

    • 类型: string

    • 默认值: ''

    • 详情:

      dataField 对应接口统一格式中的数据字段,比如接口如果统一的规范是 { success: boolean, result: any} ,那么就不需要配置,这样你通过 useRequest 消费的时候会生成一个默认的 formatResult,直接返回 result 中的数据,方便使用。如果你的后端接口不符合这个规范,可以自行配置 dataField。配置为 ''(空字符串)的时候不做处理。

    base(即将废弃)

    • 类型: string

    • 默认值: ''

    • 详情:

      base 接口前缀。

    即将废弃

    这个字段将在下个版本废弃,推荐使用 axios baseURL在新窗口打开

    运行时配置

    app.js 中进行运行时配置。

    export const request = {
         // 格式化 response.data (只有 response.data 类型为 object 才会调用)
         responseDataAdaptor: (data) => {
             data.code = data.code === '200' ? '0' : data.code;
    @@ -126,7 +126,7 @@
             };
         }
     };
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    配置拦截器

    函数的参数格式:传送门在新窗口打开;

    export const request = {
    +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    配置拦截器

    函数的参数格式:传送门在新窗口打开;

    export const request = {
         requestInterceptors: [
             function (config) {
                 // 在发送请求之前做些什么
    @@ -161,7 +161,7 @@
             ]
         ]
     };
    -
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35

    API

    request

    • 类型:函数

    • 详情:请求后端接口

    • 参数

      • url: 后端接口 url
      • data: 参数
      • options:  配置( 支持 axios 所有配置)
    • 返回值: Promise

    useRequest

    request 的封装,返回响应式 loadingerrordata

    - +
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35

    API

    request

    • 类型:函数

    • 详情:请求后端接口

    • 参数

      • url: 后端接口 url
      • data: 参数
      • options:  配置( 支持 axios 所有配置)
    • 返回值: Promise

    useRequest

    request 的封装,返回响应式 loadingerrordata

    + diff --git a/reference/plugin/plugins/sass.html b/reference/plugin/plugins/sass.html index f79c1066..d847969f 100644 --- a/reference/plugin/plugins/sass.html +++ b/reference/plugin/plugins/sass.html @@ -5,11 +5,11 @@ @fesjs/plugin-sass | Fes.js - - + + -

    @fesjs/plugin-sass

    介绍

    Fes.js 默认只支持 less,通过此插件扩展支持 sass

    启用方式

    package.json 中引入依赖:

    + diff --git a/reference/plugin/plugins/vuex.html b/reference/plugin/plugins/vuex.html index c46ca65c..d5049d27 100644 --- a/reference/plugin/plugins/vuex.html +++ b/reference/plugin/plugins/vuex.html @@ -5,11 +5,11 @@ @fesjs/plugin-vuex | Fes.js - - + + -

    @fesjs/plugin-vuex

    介绍

    集成vuex插件

    增强vuex,导出所有的mutationsactionsgetter的事件类型,编辑器提示

    约定模式,module和plugin定义放在stores目录下,文件名包含plugin被解析为插件,无需额外配置,定义即可用。

    └── src
    +    

    @fesjs/plugin-vuex

    介绍

    集成vuex插件

    增强vuex,导出所有的mutationsactionsgetter的事件类型,编辑器提示

    约定模式,module和plugin定义放在stores目录下,文件名包含plugin被解析为插件,无需额外配置,定义即可用。

    └── src
         ├── pages
         │    └── index.vue
         └── stores 
    @@ -129,7 +129,7 @@
     
     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42

    提示

    由于该插件注册在onAppCreated中,如果在onAppCreated及之前使用useStore时,获取不到vuex实例

    fesjs导出了vuex实例store,如在app.js文件中

    import { store, GETTER_TYPES } from '@fesjs/fes';
     console.log(store.getters[GETTER_TYPES.user.address])
    -
    1
    2

    vuex插件

    stores文件夹下的文件名包含plugin被解析为插件,vuex插件写法参考官方文档在新窗口打开

    API

    store

    • 类型 Object
    • vuex实例

    MUTATION_TYPES

    • 类型 Object
    • mutation的所有事件类型

    GETTER_TYPES

    • 类型 Object
    • getter的所有方法名

    ACTION_TYPES

    • 类型 Object
    • action的所有事件类型
    - +
    1
    2

    vuex插件

    stores文件夹下的文件名包含plugin被解析为插件,vuex插件写法参考官方文档在新窗口打开

    API

    store

    • 类型 Object
    • vuex实例

    MUTATION_TYPES

    • 类型 Object
    • mutation的所有事件类型

    GETTER_TYPES

    • 类型 Object
    • getter的所有方法名

    ACTION_TYPES

    • 类型 Object
    • action的所有事件类型
    + diff --git a/reference/plugin/plugins/watermark.html b/reference/plugin/plugins/watermark.html index ca94c5bf..4748cc2e 100644 --- a/reference/plugin/plugins/watermark.html +++ b/reference/plugin/plugins/watermark.html @@ -5,11 +5,11 @@ @fesjs/plugin-watermark | Fes.js - - + + -

    @fesjs/plugin-watermark

    介绍

    给页面添加水印效果

    启用方式

    package.json 中引入依赖:

    如果不需要时间戳,则可以设置timestampfalse

    + diff --git a/reference/plugin/plugins/windicss.html b/reference/plugin/plugins/windicss.html index b3096712..6cc81b33 100644 --- a/reference/plugin/plugins/windicss.html +++ b/reference/plugin/plugins/windicss.html @@ -5,21 +5,21 @@ @fesjs/plugin-windicss | Fes.js - - + + -
    + diff --git a/service-worker.js b/service-worker.js index 0af12abb..c46c2523 100644 --- a/service-worker.js +++ b/service-worker.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,l)=>(i=new URL(i+".js",l).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(l,r)=>{const n=e||("document"in self?document.currentScript.src:"")||location.href;if(s[n])return;let u={};const c=e=>i(e,n),a={module:{uri:n},exports:u,require:c};s[n]=Promise.all(l.map((e=>a[e]||c(e)))).then((e=>(r(...e),u)))}}define(["./workbox-6da860f9"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"404.html",revision:"9661810bfceb20fac62219a0864e2bc6"},{url:"assets/css/styles.b00c68fc.css",revision:null},{url:"assets/img/back-to-top.8b37f773.svg",revision:null},{url:"assets/js/205.fc028656.js",revision:null},{url:"assets/js/293.a51fb332.js",revision:null},{url:"assets/js/399.ea3dd8a2.js",revision:null},{url:"assets/js/491.94229b5b.js",revision:null},{url:"assets/js/app.7d1580c9.js",revision:null},{url:"assets/js/runtime~app.626f1f2e.js",revision:null},{url:"assets/js/v-00cf7e23.c69d341d.js",revision:null},{url:"assets/js/v-040800dc.323836dd.js",revision:null},{url:"assets/js/v-0a0e491c.556a9e41.js",revision:null},{url:"assets/js/v-1c0edac3.54f56448.js",revision:null},{url:"assets/js/v-1d14d5cc.b570a951.js",revision:null},{url:"assets/js/v-2c05b6e0.89139121.js",revision:null},{url:"assets/js/v-2fe128e7.8773c281.js",revision:null},{url:"assets/js/v-323bda7e.a6270275.js",revision:null},{url:"assets/js/v-355ee23e.a37e2b48.js",revision:null},{url:"assets/js/v-3706649a.87ee1900.js",revision:null},{url:"assets/js/v-37e1c06f.9522953a.js",revision:null},{url:"assets/js/v-392e58ee.c944921e.js",revision:null},{url:"assets/js/v-3c4e521e.2dd96637.js",revision:null},{url:"assets/js/v-3cd5a4ef.b28b8d5c.js",revision:null},{url:"assets/js/v-3dba8814.7cfcdbac.js",revision:null},{url:"assets/js/v-411c0c9e.1c199fe9.js",revision:null},{url:"assets/js/v-41dee210.11afeb11.js",revision:null},{url:"assets/js/v-494b840e.ae393909.js",revision:null},{url:"assets/js/v-528b8b6c.7f10a88c.js",revision:null},{url:"assets/js/v-5bf80046.7053c98c.js",revision:null},{url:"assets/js/v-5f4c684e.1ee28031.js",revision:null},{url:"assets/js/v-6320961c.a4f16bae.js",revision:null},{url:"assets/js/v-6f2f6a5a.e8179be8.js",revision:null},{url:"assets/js/v-76cb52e8.50562b67.js",revision:null},{url:"assets/js/v-76cd065c.fabc8531.js",revision:null},{url:"assets/js/v-7b48519a.56bce568.js",revision:null},{url:"assets/js/v-7b96e3a4.3306cbb7.js",revision:null},{url:"assets/js/v-85fa9b2a.ec3ca3c5.js",revision:null},{url:"assets/js/v-884fd4bc.85ac18fd.js",revision:null},{url:"assets/js/v-8daa1a0e.531dc54a.js",revision:null},{url:"assets/js/v-a1a49808.55d17752.js",revision:null},{url:"assets/js/v-a951be94.d6df9191.js",revision:null},{url:"assets/js/v-b15becb0.e6d203bb.js",revision:null},{url:"assets/js/v-c253c956.95173f2d.js",revision:null},{url:"assets/js/v-c5618810.81be60b6.js",revision:null},{url:"assets/js/v-d61a9282.83f8c839.js",revision:null},{url:"assets/js/v-d7fa887a.0bcd6154.js",revision:null},{url:"assets/js/v-ef8c5e10.9585488a.js",revision:null},{url:"assets/js/v-fb0f0066.5c369786.js",revision:null},{url:"assets/js/v-fffb8e28.91f97848.js",revision:null},{url:"framework.png",revision:"d5bc1ce01d8f58c2d32e4396441e5dcc"},{url:"guide/config.html",revision:"f7986ac59586fdb1e2b1f6245e5575d4"},{url:"guide/contributing.html",revision:"4c870db64015461106767a7e01d6eb3a"},{url:"guide/css.html",revision:"e2d410cb0670e190290bdb5987be48f2"},{url:"guide/directory-structure.html",revision:"43fb6f29f10668e6dde491b94c2ccdbe"},{url:"guide/env.html",revision:"9528da8b7cbb9253249597e9d2f32c14"},{url:"guide/faq.html",revision:"0adabd4f0945d2e68185722021629b1d"},{url:"guide/getting-started.html",revision:"4b60ee655d5c9cbf855a70b96a2ee064"},{url:"guide/image.html",revision:"273ad11055ca2613160ea3c887204218"},{url:"guide/index.html",revision:"c1b9ff64536aa7f469136fc3555ba804"},{url:"guide/mock.html",revision:"ac959bc3b08c0a9be6049093a4de7e7f"},{url:"guide/plugin.html",revision:"394b0fafd91027c7025cbc9207a849e1"},{url:"guide/public.html",revision:"e111f907f84e5b1a2fcfce53024d447b"},{url:"guide/route.html",revision:"9883da82932a7fa5a67f24423d83b49b"},{url:"guide/runtime-config.html",revision:"9cfb6381bb2315fb41e24199355b1d11"},{url:"guide/template.html",revision:"ea66f854e69c747f8d1b1d93ed8145fb"},{url:"home.png",revision:"3a3b46b3bb2f0a9a52f439c80bade53a"},{url:"index.html",revision:"3001c9fda7e1f701118b509ad0e69f17"},{url:"logo.png",revision:"41e6de8a94a52a5c1d7914b51111a12c"},{url:"mixin.png",revision:"c58d839aa919cee826f75bf5b348fd81"},{url:"pickTemplate.png",revision:"fb8b8e4e86c33eefe04abee6de5a03d9"},{url:"pickTemplateTip.png",revision:"e0c95971ab1e5692e997fe030c18f2a9"},{url:"plugins.png",revision:"f5e112b065621364d8cd663b245dc619"},{url:"reference/api.html",revision:"ce5f1fdd8e252f4f8ae7f3081c84e679"},{url:"reference/api/index.html",revision:"d55e5e3a52713b79e16063de6acc9d10"},{url:"reference/cli.html",revision:"749e16a5221e47a8b9d76761c47829cc"},{url:"reference/cli/index.html",revision:"d93c8c29ccaf472bebe43e1cc5450bd1"},{url:"reference/config/index.html",revision:"434ac1bc40add0100677cbcbaf9c5205"},{url:"reference/plugin/dev/api.html",revision:"5c2c0003ef73b5fcf58ff983f9595644"},{url:"reference/plugin/dev/index.html",revision:"369898b0d1e064964b0655e326a07250"},{url:"reference/plugin/index.html",revision:"8dd8c30ad71194d1d0e8e4a9370fcacf"},{url:"reference/plugin/plugins/access.html",revision:"956c7ee860b846422097b13dc8c4911b"},{url:"reference/plugin/plugins/editor.html",revision:"5479743288083a2333d96a3253ef7065"},{url:"reference/plugin/plugins/enums.html",revision:"2bf650ce2b0137de5d3ecc34e4df5288"},{url:"reference/plugin/plugins/icon.html",revision:"1a36c5e79777c64ed47a81c9857c1496"},{url:"reference/plugin/plugins/jest.html",revision:"13d1c01e72663927bac310d08ab076a2"},{url:"reference/plugin/plugins/layout.html",revision:"1c069e382261cb543e6502266c8f2a0c"},{url:"reference/plugin/plugins/locale.html",revision:"5a1fc1ca55ffd0fd0d777161d0f73399"},{url:"reference/plugin/plugins/model.html",revision:"aed3b340175086f22e5ec940e2ea0ba1"},{url:"reference/plugin/plugins/pinia.html",revision:"7a931a4fb2351263def3cc17d3ccfd5e"},{url:"reference/plugin/plugins/qiankun.html",revision:"8e7840f9feabec41a912b06c7b11182a"},{url:"reference/plugin/plugins/request.html",revision:"b2dcc4c9b2c5e9636c5e02913efe03aa"},{url:"reference/plugin/plugins/sass.html",revision:"21f0f8131f4ec91a179f97c8f2dde533"},{url:"reference/plugin/plugins/vuex.html",revision:"2e45a5f2df0856839578e7d136f113de"},{url:"reference/plugin/plugins/watermark.html",revision:"9cdcef285388055024dd6800e9c032d7"},{url:"reference/plugin/plugins/windicss.html",revision:"cd9652c65be58a2152364ce8be425aac"},{url:"side.png",revision:"a5bf932a270e116563f7e1da8968d493"},{url:"top.png",revision:"b282c6a45571a8a0aa710c044b7e4893"}],{})})); +if(!self.define){let e,s={};const i=(i,l)=>(i=new URL(i+".js",l).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(l,r)=>{const n=e||("document"in self?document.currentScript.src:"")||location.href;if(s[n])return;let u={};const a=e=>i(e,n),c={module:{uri:n},exports:u,require:a};s[n]=Promise.all(l.map((e=>c[e]||a(e)))).then((e=>(r(...e),u)))}}define(["./workbox-d249b2c8"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"404.html",revision:"98d1eb1975c6175f821b407212531dea"},{url:"assets/css/styles.8abd66bb.css",revision:null},{url:"assets/img/back-to-top.8b37f773.svg",revision:null},{url:"assets/js/205.d4ef4058.js",revision:null},{url:"assets/js/293.f5289c13.js",revision:null},{url:"assets/js/399.ae8be0a6.js",revision:null},{url:"assets/js/491.d264dc1d.js",revision:null},{url:"assets/js/app.d5bb65a0.js",revision:null},{url:"assets/js/runtime~app.67702f4f.js",revision:null},{url:"assets/js/v-00cf7e23.1bc881cc.js",revision:null},{url:"assets/js/v-040800dc.1f1fb9d5.js",revision:null},{url:"assets/js/v-0a0e491c.37f99a72.js",revision:null},{url:"assets/js/v-1c0edac3.fe469da8.js",revision:null},{url:"assets/js/v-1d14d5cc.f6b678f3.js",revision:null},{url:"assets/js/v-2c05b6e0.7edc12ad.js",revision:null},{url:"assets/js/v-2fe128e7.a15f3d55.js",revision:null},{url:"assets/js/v-323bda7e.778122f9.js",revision:null},{url:"assets/js/v-355ee23e.f2dde2a4.js",revision:null},{url:"assets/js/v-3706649a.6d045efa.js",revision:null},{url:"assets/js/v-37e1c06f.49408d07.js",revision:null},{url:"assets/js/v-392e58ee.67937c7d.js",revision:null},{url:"assets/js/v-3c4e521e.b813ace2.js",revision:null},{url:"assets/js/v-3cd5a4ef.7a6ef2c7.js",revision:null},{url:"assets/js/v-3dba8814.9f07a8e3.js",revision:null},{url:"assets/js/v-411c0c9e.eb0a832d.js",revision:null},{url:"assets/js/v-41dee210.18d5dcb0.js",revision:null},{url:"assets/js/v-494b840e.3219979d.js",revision:null},{url:"assets/js/v-528b8b6c.e0560471.js",revision:null},{url:"assets/js/v-5bf80046.734741c7.js",revision:null},{url:"assets/js/v-5f4c684e.004fc897.js",revision:null},{url:"assets/js/v-6320961c.594d5357.js",revision:null},{url:"assets/js/v-6f2f6a5a.0a028df5.js",revision:null},{url:"assets/js/v-76cb52e8.0f619206.js",revision:null},{url:"assets/js/v-76cd065c.270a37ed.js",revision:null},{url:"assets/js/v-7b48519a.741c8475.js",revision:null},{url:"assets/js/v-7b96e3a4.033eb852.js",revision:null},{url:"assets/js/v-85fa9b2a.3f03d054.js",revision:null},{url:"assets/js/v-884fd4bc.36a95eba.js",revision:null},{url:"assets/js/v-8daa1a0e.97e78117.js",revision:null},{url:"assets/js/v-a1a49808.5aa9c148.js",revision:null},{url:"assets/js/v-a951be94.9550ef17.js",revision:null},{url:"assets/js/v-b15becb0.9810a63f.js",revision:null},{url:"assets/js/v-c253c956.71cde0f0.js",revision:null},{url:"assets/js/v-c5618810.c7e42791.js",revision:null},{url:"assets/js/v-d61a9282.315b2b24.js",revision:null},{url:"assets/js/v-d7fa887a.eec494da.js",revision:null},{url:"assets/js/v-ef8c5e10.01694dac.js",revision:null},{url:"assets/js/v-fb0f0066.f066a234.js",revision:null},{url:"assets/js/v-fffb8e28.7aa72175.js",revision:null},{url:"framework.png",revision:"d5bc1ce01d8f58c2d32e4396441e5dcc"},{url:"guide/config.html",revision:"ad4c0322930de071fc26718be8ea3a41"},{url:"guide/contributing.html",revision:"1addefd9ee46fd0dada54235fca7e623"},{url:"guide/css.html",revision:"874472f472cfd922c94acd4656db9839"},{url:"guide/directory-structure.html",revision:"ccc775cfa0b436bfa46da9ab7ea22e5a"},{url:"guide/env.html",revision:"68eda51cb71969240d33933aa429443b"},{url:"guide/faq.html",revision:"d78833731a385b494697cfa96fe60a87"},{url:"guide/getting-started.html",revision:"4609d6b12ac4446c1c926654816b8067"},{url:"guide/image.html",revision:"302ee61d9d339d7bc0a1f171b3795530"},{url:"guide/index.html",revision:"8bdbb77b37ef6499d5468169c5c8028b"},{url:"guide/mock.html",revision:"468070dbe75f5e796497d9d2a5f7f1d5"},{url:"guide/plugin.html",revision:"87e64c789fa62acba6ff4ca29050fe0f"},{url:"guide/public.html",revision:"a94a302dff5f040dca3aade3021d3c2a"},{url:"guide/route.html",revision:"c9c1a24d6390a9c16090a36824bf51b8"},{url:"guide/runtime-config.html",revision:"c31644e21c2cdca72c60731ce0da0d78"},{url:"guide/template.html",revision:"cade417e67d870f4e0212ce9de0e3c4e"},{url:"home.png",revision:"3a3b46b3bb2f0a9a52f439c80bade53a"},{url:"index.html",revision:"472913641980ff0c1e5ace67a47defdb"},{url:"logo.png",revision:"41e6de8a94a52a5c1d7914b51111a12c"},{url:"mixin.png",revision:"c58d839aa919cee826f75bf5b348fd81"},{url:"pickTemplate.png",revision:"fb8b8e4e86c33eefe04abee6de5a03d9"},{url:"pickTemplateTip.png",revision:"e0c95971ab1e5692e997fe030c18f2a9"},{url:"plugins.png",revision:"f5e112b065621364d8cd663b245dc619"},{url:"reference/api.html",revision:"db9e9d80763409db954c3e2f9bea1fcb"},{url:"reference/api/index.html",revision:"75904173542fa332f65a3dcb792841a5"},{url:"reference/cli.html",revision:"423be73dec090871634e347cd03dfa4c"},{url:"reference/cli/index.html",revision:"6b4278164dd3bbea2cb7f48ded61bee5"},{url:"reference/config/index.html",revision:"89f15ded6677ba5cd07c1aefef2502fa"},{url:"reference/plugin/dev/api.html",revision:"b2b86640c763fb698cb8e1398e1eb1b6"},{url:"reference/plugin/dev/index.html",revision:"eaefda6fa6b7efdeddd36bc7a82f258d"},{url:"reference/plugin/index.html",revision:"97946c029e81046db076a43988015ee4"},{url:"reference/plugin/plugins/access.html",revision:"b11813755e563758a75e423955e426c3"},{url:"reference/plugin/plugins/editor.html",revision:"7dd49fe1883166d191d58f13aba60f12"},{url:"reference/plugin/plugins/enums.html",revision:"463373f1356f7dc0384206e5965cf9b7"},{url:"reference/plugin/plugins/icon.html",revision:"4f8e519d28021f387eae056299dd7d5f"},{url:"reference/plugin/plugins/jest.html",revision:"05b1344dc081f408abe85899082b2f0a"},{url:"reference/plugin/plugins/layout.html",revision:"98fb5a46867a01dcd47e01b7905af37a"},{url:"reference/plugin/plugins/locale.html",revision:"52454f99f94c99a82b948de1b7f2600a"},{url:"reference/plugin/plugins/model.html",revision:"6146b5ed5b1f99196a3b09746f00da30"},{url:"reference/plugin/plugins/pinia.html",revision:"c9ad911d2c6969ef92d25036056f39d8"},{url:"reference/plugin/plugins/qiankun.html",revision:"cbe78fd989995b179e9d69588bd99e9f"},{url:"reference/plugin/plugins/request.html",revision:"92c9ca49e90f0f9b42eb9b7817c9c155"},{url:"reference/plugin/plugins/sass.html",revision:"1b27920d2113c3c7430433a7c6d97e06"},{url:"reference/plugin/plugins/vuex.html",revision:"2fa5329122fe2412730f300301b11d4e"},{url:"reference/plugin/plugins/watermark.html",revision:"eb2ce2a7347da64eb7df9ba1b5a4fd91"},{url:"reference/plugin/plugins/windicss.html",revision:"0c0679b9702cf860fda3ee44be2eb96e"},{url:"side.png",revision:"a5bf932a270e116563f7e1da8968d493"},{url:"top.png",revision:"b282c6a45571a8a0aa710c044b7e4893"}],{})})); diff --git a/workbox-6da860f9.js b/workbox-6da860f9.js deleted file mode 100644 index 9321bc2b..00000000 --- a/workbox-6da860f9.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports"],(function(t){"use strict";try{self["workbox:core:6.5.3"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:6.5.3"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class i{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class r extends i{constructor(t,e,s){super((({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)}),e,s)}}class o{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",(t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map((e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})})));t.waitUntil(s),t.ports&&t.ports[0]&&s.then((()=>t.ports[0].postMessage(!0)))}}))}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:i,route:r}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let o=r&&r.handler;const c=t.method;if(!o&&this.i.has(c)&&(o=this.i.get(c)),!o)return;let a;try{a=o.handle({url:s,request:t,event:e,params:i})}catch(t){a=Promise.reject(t)}const h=r&&r.catchHandler;return a instanceof Promise&&(this.o||h)&&(a=a.catch((async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:i})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n}))),a}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const i=this.t.get(s.method)||[];for(const r of i){let i;const o=r.match({url:t,sameOrigin:e,request:s,event:n});if(o)return i=o,(Array.isArray(i)&&0===i.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(i=void 0),{route:r,params:i}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let c;const a={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},h=t=>[a.prefix,t,a.suffix].filter((t=>t&&t.length>0)).join("-"),u=t=>t||h(a.precache),l=t=>t||h(a.runtime);function f(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:6.5.3"]&&_()}catch(t){}function w(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),r=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:r.href}}class d{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class p{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.h.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.h=t}}let y;async function g(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const i=t.clone(),r={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=e?e(r):r,c=function(){if(void 0===y){const t=new Response("");if("body"in t)try{new Response(t.body),y=!0}catch(t){y=!1}y=!1}return y}()?i.body:await i.blob();return new Response(c,o)}function R(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class m{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}const v=new Set;try{self["workbox:strategies:6.5.3"]&&_()}catch(t){}function q(t){return"string"==typeof t?new Request(t):t}class U{constructor(t,e){this.u={},Object.assign(this,e),this.event=e.event,this.l=t,this.p=new m,this.g=[],this.R=[...t.plugins],this.m=new Map;for(const t of this.R)this.m.set(t,{});this.event.waitUntil(this.p.promise)}async fetch(t){const{event:e}=this;let n=q(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const i=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const r=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.l.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:r,response:t});return t}catch(t){throw i&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:i.clone(),request:r.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=q(t);let s;const{cacheName:n,matchOptions:i}=this.l,r=await this.getCacheKey(e,"read"),o=Object.assign(Object.assign({},i),{cacheName:n});s=await caches.match(r,o);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:i,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(t,e){const n=q(t);var i;await(i=0,new Promise((t=>setTimeout(t,i))));const r=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(o=r.url,new URL(String(o),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var o;const c=await this.v(e);if(!c)return!1;const{cacheName:a,matchOptions:h}=this.l,u=await self.caches.open(a),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const i=R(e.url,s);if(e.url===i)return t.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),o=await t.keys(e,r);for(const e of o)if(i===R(e.url,s))return t.match(e,n)}(u,r.clone(),["__WB_REVISION__"],h):null;try{await u.put(r,l?c.clone():c)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of v)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:a,oldResponse:f,newResponse:c.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.u[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=q(await t({mode:e,request:n,event:this.event,params:this.params}));this.u[s]=n}return this.u[s]}hasCallback(t){for(const e of this.l.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.l.plugins)if("function"==typeof e[t]){const s=this.m.get(e),n=n=>{const i=Object.assign(Object.assign({},n),{state:s});return e[t](i)};yield n}}waitUntil(t){return this.g.push(t),t}async doneWaiting(){let t;for(;t=this.g.shift();)await t}destroy(){this.p.resolve(null)}async v(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class L extends class{constructor(t={}){this.cacheName=l(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,i=new U(this,{event:e,request:s,params:n}),r=this.q(i,s,e);return[r,this.U(r,i,s,e)]}async q(t,e,n){let i;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(i=await this.L(e,t),!i||"error"===i.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const r of t.iterateCallbacks("handlerDidError"))if(i=await r({error:s,event:n,request:e}),i)break;if(!i)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))i=await s({event:n,request:e,response:i});return i}async U(t,e,s,n){let i,r;try{i=await t}catch(r){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:i}),await e.doneWaiting()}catch(t){t instanceof Error&&(r=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:i,error:r}),e.destroy(),r)throw r}}{constructor(t={}){t.cacheName=u(t.cacheName),super(t),this._=!1!==t.fallbackToNetwork,this.plugins.push(L.copyRedirectedCacheableResponsesPlugin)}async L(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.C(t,e):await this.O(t,e))}async O(t,e){let n;const i=e.params||{};if(!this._)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,r=t.integrity,o=!r||r===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?r||s:void 0})),s&&o&&"no-cors"!==t.mode&&(this.N(),await e.cachePut(t,n.clone()))}return n}async C(t,e){this.N();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}N(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==L.copyRedirectedCacheableResponsesPlugin&&(n===L.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(L.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}L.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},L.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await g(t):t};class b{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.k=new Map,this.K=new Map,this.T=new Map,this.l=new L({cacheName:u(t),plugins:[...e,new p({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.l}precache(t){this.addToCacheList(t),this.W||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.W=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=w(n),r="string"!=typeof n&&n.revision?"reload":"default";if(this.k.has(i)&&this.k.get(i)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.k.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.T.has(t)&&this.T.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:i});this.T.set(t,n.integrity)}if(this.k.set(i,t),this.K.set(i,r),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return f(t,(async()=>{const e=new d;this.strategy.plugins.push(e);for(const[e,s]of this.k){const n=this.T.get(s),i=this.K.get(e),r=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(t){return f(t,(async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.k.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this.k}getCachedURLs(){return[...this.k.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.k.get(e.href)}getIntegrityForCacheKey(t){return this.T.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}let C;const E=()=>(C||(C=new b),C);class O extends i{constructor(t,e){super((({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const r=new URL(t,location.href);r.hash="",yield r.href;const o=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some((t=>t.test(s)))&&t.searchParams.delete(s);return t}(r,e);if(yield o.href,s&&o.pathname.endsWith("/")){const t=new URL(o.href);t.pathname+=s,yield t.href}if(n){const t=new URL(o.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:r});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}}),t.strategy)}}function x(t){const e=E();!function(t,e,n){let a;if("string"==typeof t){const s=new URL(t,location.href);a=new i((({url:t})=>t.href===s.href),e,n)}else if(t instanceof RegExp)a=new r(t,e,n);else if("function"==typeof t)a=new i(t,e,n);else{if(!(t instanceof i))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});a=t}(c||(c=new o,c.addFetchListener(),c.addCacheListener()),c).registerRoute(a)}(new O(e,t))}t.precacheAndRoute=function(t,e){!function(t){E().precache(t)}(t),x(e)}})); diff --git a/workbox-d249b2c8.js b/workbox-d249b2c8.js new file mode 100644 index 00000000..e730af9a --- /dev/null +++ b/workbox-d249b2c8.js @@ -0,0 +1 @@ +define(["exports"],(function(t){"use strict";try{self["workbox:core:6.5.3"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:6.5.3"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class i{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class r extends i{constructor(t,e,s){super((({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)}),e,s)}}class o{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",(t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map((e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})})));t.waitUntil(s),t.ports&&t.ports[0]&&s.then((()=>t.ports[0].postMessage(!0)))}}))}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:i,route:r}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let o=r&&r.handler;const c=t.method;if(!o&&this.i.has(c)&&(o=this.i.get(c)),!o)return;let a;try{a=o.handle({url:s,request:t,event:e,params:i})}catch(t){a=Promise.reject(t)}const h=r&&r.catchHandler;return a instanceof Promise&&(this.o||h)&&(a=a.catch((async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:i})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n}))),a}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const i=this.t.get(s.method)||[];for(const r of i){let i;const o=r.match({url:t,sameOrigin:e,request:s,event:n});if(o)return i=o,(Array.isArray(i)&&0===i.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(i=void 0),{route:r,params:i}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let c;const a=()=>(c||(c=new o,c.addFetchListener(),c.addCacheListener()),c);const h={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},u=t=>[h.prefix,t,h.suffix].filter((t=>t&&t.length>0)).join("-"),l=t=>t||u(h.precache),f=t=>t||u(h.runtime);function w(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:6.5.3"]&&_()}catch(t){}function d(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),r=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:r.href}}class p{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class y{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.h.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.h=t}}let g;async function R(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const i=t.clone(),r={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=e?e(r):r,c=function(){if(void 0===g){const t=new Response("");if("body"in t)try{new Response(t.body),g=!0}catch(t){g=!1}g=!1}return g}()?i.body:await i.blob();return new Response(c,o)}function m(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class v{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}const q=new Set;try{self["workbox:strategies:6.5.3"]&&_()}catch(t){}function U(t){return"string"==typeof t?new Request(t):t}class L{constructor(t,e){this.u={},Object.assign(this,e),this.event=e.event,this.l=t,this.p=new v,this.g=[],this.R=[...t.plugins],this.m=new Map;for(const t of this.R)this.m.set(t,{});this.event.waitUntil(this.p.promise)}async fetch(t){const{event:e}=this;let n=U(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const i=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const r=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.l.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:r,response:t});return t}catch(t){throw i&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:i.clone(),request:r.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=U(t);let s;const{cacheName:n,matchOptions:i}=this.l,r=await this.getCacheKey(e,"read"),o=Object.assign(Object.assign({},i),{cacheName:n});s=await caches.match(r,o);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:i,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(t,e){const n=U(t);var i;await(i=0,new Promise((t=>setTimeout(t,i))));const r=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(o=r.url,new URL(String(o),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var o;const c=await this.v(e);if(!c)return!1;const{cacheName:a,matchOptions:h}=this.l,u=await self.caches.open(a),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const i=m(e.url,s);if(e.url===i)return t.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),o=await t.keys(e,r);for(const e of o)if(i===m(e.url,s))return t.match(e,n)}(u,r.clone(),["__WB_REVISION__"],h):null;try{await u.put(r,l?c.clone():c)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of q)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:a,oldResponse:f,newResponse:c.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.u[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=U(await t({mode:e,request:n,event:this.event,params:this.params}));this.u[s]=n}return this.u[s]}hasCallback(t){for(const e of this.l.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.l.plugins)if("function"==typeof e[t]){const s=this.m.get(e),n=n=>{const i=Object.assign(Object.assign({},n),{state:s});return e[t](i)};yield n}}waitUntil(t){return this.g.push(t),t}async doneWaiting(){let t;for(;t=this.g.shift();)await t}destroy(){this.p.resolve(null)}async v(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class b{constructor(t={}){this.cacheName=f(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,i=new L(this,{event:e,request:s,params:n}),r=this.q(i,s,e);return[r,this.U(r,i,s,e)]}async q(t,e,n){let i;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(i=await this.L(e,t),!i||"error"===i.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const r of t.iterateCallbacks("handlerDidError"))if(i=await r({error:s,event:n,request:e}),i)break;if(!i)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))i=await s({event:n,request:e,response:i});return i}async U(t,e,s,n){let i,r;try{i=await t}catch(r){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:i}),await e.doneWaiting()}catch(t){t instanceof Error&&(r=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:i,error:r}),e.destroy(),r)throw r}}class C extends b{constructor(t={}){t.cacheName=l(t.cacheName),super(t),this._=!1!==t.fallbackToNetwork,this.plugins.push(C.copyRedirectedCacheableResponsesPlugin)}async L(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.C(t,e):await this.O(t,e))}async O(t,e){let n;const i=e.params||{};if(!this._)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,r=t.integrity,o=!r||r===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?r||s:void 0})),s&&o&&"no-cors"!==t.mode&&(this.N(),await e.cachePut(t,n.clone()))}return n}async C(t,e){this.N();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}N(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==C.copyRedirectedCacheableResponsesPlugin&&(n===C.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(C.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}C.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},C.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await R(t):t};class E{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.k=new Map,this.K=new Map,this.T=new Map,this.l=new C({cacheName:l(t),plugins:[...e,new y({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.l}precache(t){this.addToCacheList(t),this.W||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.W=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=d(n),r="string"!=typeof n&&n.revision?"reload":"default";if(this.k.has(i)&&this.k.get(i)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.k.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.T.has(t)&&this.T.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:i});this.T.set(t,n.integrity)}if(this.k.set(i,t),this.K.set(i,r),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return w(t,(async()=>{const e=new p;this.strategy.plugins.push(e);for(const[e,s]of this.k){const n=this.T.get(s),i=this.K.get(e),r=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(t){return w(t,(async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.k.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this.k}getCachedURLs(){return[...this.k.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.k.get(e.href)}getIntegrityForCacheKey(t){return this.T.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}let O;const x=()=>(O||(O=new E),O);class N extends i{constructor(t,e){super((({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const r=new URL(t,location.href);r.hash="",yield r.href;const o=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some((t=>t.test(s)))&&t.searchParams.delete(s);return t}(r,e);if(yield o.href,s&&o.pathname.endsWith("/")){const t=new URL(o.href);t.pathname+=s,yield t.href}if(n){const t=new URL(o.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:r});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}}),t.strategy)}}function k(t){const e=x();!function(t,e,n){let o;if("string"==typeof t){const s=new URL(t,location.href);o=new i((({url:t})=>t.href===s.href),e,n)}else if(t instanceof RegExp)o=new r(t,e,n);else if("function"==typeof t)o=new i(t,e,n);else{if(!(t instanceof i))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});o=t}a().registerRoute(o)}(new N(e,t))}t.precacheAndRoute=function(t,e){!function(t){x().precache(t)}(t),k(e)}}));