123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1">
- <title>项目配置项 | vue-element-plus-admin</title>
- <meta name="description" content="一套基于vue3、element-plus、typesScript、vite的后台集成方案">
- <link rel="stylesheet" href="/assets/style.e8023618.css">
- <link rel="modulepreload" href="/assets/Home.8d63bef0.js">
- <link rel="modulepreload" href="/assets/app.51e46c58.js">
- <link rel="modulepreload" href="/assets/guide_settings.md.6e476ca7.lean.js">
- <link rel="modulepreload" href="/assets/app.51e46c58.js">
- <meta name="author" content="Archer">
- <meta name="keywords" content="vue-element-plus-admin, vitejs, vite, element-plus, vue">
- <link rel="icon" type="image/svg+xml" href="/logo.svg">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
- <meta name="keywords" content="vue-element-plus-admin-doc">
- <link rel="icon" href="/favicon.ico">
- <meta name="twitter:title" content="项目配置项 | vue-element-plus-admin">
- <meta property="og:title" content="项目配置项 | vue-element-plus-admin">
- </head>
- <body>
- <div id="app"><!--[--><div class="theme"><header class="nav-bar" data-v-47437b3e><div class="sidebar-button" data-v-47437b3e><svg class="icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z" class></path></svg></div><a class="nav-bar-title" href="/" aria-label="vue-element-plus-admin, back to home" data-v-47437b3e data-v-3e3fd8b1><img class="logo" src="/logo.png" alt="Logo" data-v-3e3fd8b1> vue-element-plus-admin</a><div class="flex-grow" data-v-47437b3e></div><div class="nav" data-v-47437b3e><nav class="nav-links" data-v-47437b3e data-v-1e870408><!--[--><div class="item" data-v-1e870408><div class="nav-dropdown-link" data-v-1e870408 data-v-312de885><button class="button" data-v-312de885><span class="button-text" data-v-312de885>指南</span><span class="right button-arrow" data-v-312de885></span></button><ul class="dialog" data-v-312de885><!--[--><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/guide/introduction" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>指南</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/dep/i18n" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>深入</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/guide/version" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>v2版本重大更新</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><!--]--></ul></div></div><div class="item" data-v-1e870408><div class="nav-dropdown-link" data-v-1e870408 data-v-312de885><button class="button" data-v-312de885><span class="button-text" data-v-312de885>组件</span><span class="right button-arrow" data-v-312de885></span></button><ul class="dialog" data-v-312de885><!--[--><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/components/introduction" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>介绍</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/components/icon" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>全局组件</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/components/form" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>功能组件</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/components/image-viewer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>函数式组件</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><!--]--></ul></div></div><div class="item" data-v-1e870408><div class="nav-link" data-v-1e870408 data-v-c272f228><a class="item" href="/hooks/useWatermark" data-v-c272f228>常用Hooks <!----></a></div></div><div class="item" data-v-1e870408><div class="nav-link" data-v-1e870408 data-v-c272f228><a class="item" href="/guide/fqa" data-v-c272f228>常见问题 <!----></a></div></div><div class="item" data-v-1e870408><div class="nav-dropdown-link" data-v-1e870408 data-v-312de885><button class="button" data-v-312de885><span class="button-text" data-v-312de885>相关链接</span><span class="right button-arrow" data-v-312de885></span></button><ul class="dialog" data-v-312de885><!--[--><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://element-plus-admin.cn/" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Github 站点预览</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://github.com/kailong321200875/vue-element-plus-admin" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Github 源码</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://github.com/kailong321200875/vue-element-plus-admin-doc" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Github 文档源码</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://github.com/kailong321200875/vue-element-plus-admin/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Github 更新日志</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://kailong110120130.gitee.io/vue-element-plus-admin" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Gitee 站点预览</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://gitee.com/kailong110120130/vue-element-plus-admin" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Gitee 源码</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://gitee.com/kailong110120130/vue-element-plus-admin-doc" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Gitee 文档源码</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://gitee.com/kailong110120130/vue-element-plus-admin/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Gitee 更新日志</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><!--]--></ul></div></div><div class="item" data-v-1e870408><div class="nav-dropdown-link" data-v-1e870408 data-v-312de885><button class="button" data-v-312de885><span class="button-text" data-v-312de885>捐赠</span><span class="right button-arrow" data-v-312de885></span></button><ul class="dialog" data-v-312de885><!--[--><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/donate/donate" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>捐赠</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><!--]--></ul></div></div><!--]--><!----><!-- <div v-if="repo" class="item">
- <NavLink :item="repo" />
- </div> --></nav></div><div class="nav-icons" data-v-47437b3e><div class="item" data-v-47437b3e><button class="nav-btn" aria-label="Toggle Theme" data-v-47437b3e><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1.2em" height="1.2em" preserveaspectratio="xMidYMid meet" viewbox="0 0 24 24" style="display:none;"><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938A7.999 7.999 0 0 0 4 12z" fill="currentColor"></path></svg><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1.2em" height="1.2em" preserveaspectratio="xMidYMid meet" viewbox="0 0 24 24" style=""><path d="M12 18a6 6 0 1 1 0-12a6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8a4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636L5.636 7.05L3.515 4.93zM16.95 18.364l1.414-1.414l2.121 2.121l-1.414 1.414l-2.121-2.121zm2.121-14.85l1.414 1.415l-2.121 2.121l-1.414-1.414l2.121-2.121zM5.636 16.95l1.414 1.414l-2.121 2.121l-1.414-1.414l2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z" fill="currentColor"></path></svg></button></div><div class="item" data-v-47437b3e><a class="nav-btn" href="https://github.com/kailong321200875/vue-element-plus-admin" target="_blank" aria-label="View GitHub Repo" data-v-47437b3e><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1.2em" height="1.2em" preserveaspectratio="xMidYMid meet" viewbox="0 0 24 24" data-v-47437b3e><path d="M5.883 18.653c-.3-.2-.558-.455-.86-.816a50.32 50.32 0 0 1-.466-.579c-.463-.575-.755-.84-1.057-.949a1 1 0 0 1 .676-1.883c.752.27 1.261.735 1.947 1.588c-.094-.117.34.427.433.539c.19.227.33.365.44.438c.204.137.587.196 1.15.14c.023-.382.094-.753.202-1.095C5.38 15.31 3.7 13.396 3.7 9.64c0-1.24.37-2.356 1.058-3.292c-.218-.894-.185-1.975.302-3.192a1 1 0 0 1 .63-.582c.081-.024.127-.035.208-.047c.803-.123 1.937.17 3.415 1.096A11.731 11.731 0 0 1 12 3.315c.912 0 1.818.104 2.684.308c1.477-.933 2.613-1.226 3.422-1.096c.085.013.157.03.218.05a1 1 0 0 1 .616.58c.487 1.216.52 2.297.302 3.19c.691.936 1.058 2.045 1.058 3.293c0 3.757-1.674 5.665-4.642 6.392c.125.415.19.879.19 1.38a300.492 300.492 0 0 1-.012 2.716a1 1 0 0 1-.019 1.958c-1.139.228-1.983-.532-1.983-1.525l.002-.446l.005-.705c.005-.708.007-1.338.007-1.998c0-.697-.183-1.152-.425-1.36c-.661-.57-.326-1.655.54-1.752c2.967-.333 4.337-1.482 4.337-4.66c0-.955-.312-1.744-.913-2.404a1 1 0 0 1-.19-1.045c.166-.414.237-.957.096-1.614l-.01.003c-.491.139-1.11.44-1.858.949a1 1 0 0 1-.833.135A9.626 9.626 0 0 0 12 5.315c-.89 0-1.772.119-2.592.35a1 1 0 0 1-.83-.134c-.752-.507-1.374-.807-1.868-.947c-.144.653-.073 1.194.092 1.607a1 1 0 0 1-.189 1.045C6.016 7.89 5.7 8.694 5.7 9.64c0 3.172 1.371 4.328 4.322 4.66c.865.097 1.201 1.177.544 1.748c-.192.168-.429.732-.429 1.364v3.15c0 .986-.835 1.725-1.96 1.528a1 1 0 0 1-.04-1.962v-.99c-.91.061-1.662-.088-2.254-.485z" fill="currentColor"></path></svg></a></div></div><!--[--><!--]--></header><!--[--><aside class="sidebar" data-v-4668b452><nav class="nav-links nav" data-v-4668b452 data-v-1e870408><!--[--><div class="item" data-v-1e870408><div class="nav-dropdown-link" data-v-1e870408 data-v-312de885><button class="button" data-v-312de885><span class="button-text" data-v-312de885>指南</span><span class="right button-arrow" data-v-312de885></span></button><ul class="dialog" data-v-312de885><!--[--><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/guide/introduction" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>指南</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/dep/i18n" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>深入</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/guide/version" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>v2版本重大更新</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><!--]--></ul></div></div><div class="item" data-v-1e870408><div class="nav-dropdown-link" data-v-1e870408 data-v-312de885><button class="button" data-v-312de885><span class="button-text" data-v-312de885>组件</span><span class="right button-arrow" data-v-312de885></span></button><ul class="dialog" data-v-312de885><!--[--><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/components/introduction" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>介绍</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/components/icon" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>全局组件</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/components/form" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>功能组件</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/components/image-viewer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>函数式组件</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><!--]--></ul></div></div><div class="item" data-v-1e870408><div class="nav-link" data-v-1e870408 data-v-c272f228><a class="item" href="/hooks/useWatermark" data-v-c272f228>常用Hooks <!----></a></div></div><div class="item" data-v-1e870408><div class="nav-link" data-v-1e870408 data-v-c272f228><a class="item" href="/guide/fqa" data-v-c272f228>常见问题 <!----></a></div></div><div class="item" data-v-1e870408><div class="nav-dropdown-link" data-v-1e870408 data-v-312de885><button class="button" data-v-312de885><span class="button-text" data-v-312de885>相关链接</span><span class="right button-arrow" data-v-312de885></span></button><ul class="dialog" data-v-312de885><!--[--><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://element-plus-admin.cn/" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Github 站点预览</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://github.com/kailong321200875/vue-element-plus-admin" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Github 源码</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://github.com/kailong321200875/vue-element-plus-admin-doc" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Github 文档源码</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://github.com/kailong321200875/vue-element-plus-admin/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Github 更新日志</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://kailong110120130.gitee.io/vue-element-plus-admin" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Gitee 站点预览</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://gitee.com/kailong110120130/vue-element-plus-admin" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Gitee 源码</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://gitee.com/kailong110120130/vue-element-plus-admin-doc" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Gitee 文档源码</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item isExternal" href="https://gitee.com/kailong110120130/vue-element-plus-admin/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>Gitee 更新日志</span><span class="icon" data-v-7b16fcd4><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-7b16fcd4><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"></path><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"></polygon></svg></span></a></div></li><!--]--></ul></div></div><div class="item" data-v-1e870408><div class="nav-dropdown-link" data-v-1e870408 data-v-312de885><button class="button" data-v-312de885><span class="button-text" data-v-312de885>捐赠</span><span class="right button-arrow" data-v-312de885></span></button><ul class="dialog" data-v-312de885><!--[--><li class="dialog-item" data-v-312de885><div class="nav-dropdown-link-item" data-v-312de885 data-v-7b16fcd4><a class="item" href="/donate/donate" data-v-7b16fcd4><span class="arrow" data-v-7b16fcd4></span><span class="text" data-v-7b16fcd4>捐赠</span><span class="icon" data-v-7b16fcd4><!----></span></a></div></li><!--]--></ul></div></div><!--]--><!----><!-- <div v-if="repo" class="item">
- <NavLink :item="repo" />
- </div> --></nav><!--[--><!--]--><ul class="sidebar-links" data-v-4668b452><!--[--><li class="sidebar-link"><p class="sidebar-link-item">指南</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="/guide/introduction">介绍</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/guide/">开始</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item active" href="/guide/settings">项目配置</a><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="#环境变量配置">环境变量配置</a><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="#配置项说明">配置项说明</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#env-base">.env.base</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#env-dev">.env.dev</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#env-test">.env.test</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#env-pro">.env.pro</a><!----></li></ul></li><li class="sidebar-link"><a class="sidebar-link-item" href="#项目及主题配置">项目及主题配置</a><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="#配置文件路径">配置文件路径</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#说明">说明</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#如何添加新属性">如何添加新属性</a><!----></li></ul></li><li class="sidebar-link"><a class="sidebar-link-item" href="#多语言配置">多语言配置</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#样式配置">样式配置</a><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="#css-前缀设置">css 前缀设置</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#前缀使用">前缀使用</a><!----></li></ul></li></ul></li><li class="sidebar-link"><a class="sidebar-link-item" href="/guide/router">路由</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/guide/auth">权限</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/guide/mock">Mock&联调</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/guide/component">组件注册</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/guide/design">样式</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/guide/deploy">构建&部署</a><!----></li></ul></li><li class="sidebar-link"><p class="sidebar-link-item">深入</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="/dep/i18n">国际化</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/dep/lint">项目规范</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/dep/dark">黑暗主题</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/dep/create-module">模版生成</a><!----></li></ul></li><li class="sidebar-link"><p class="sidebar-link-item">v2版本重大更新</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="/guide/version">介绍</a><!----></li></ul></li><li class="sidebar-link"><p class="sidebar-link-item">常见问题</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="/guide/fqa">前言</a><!----></li></ul></li><!--]--></ul><!--[--><!--]--></aside><!-- <Slugs /> --><!--]--><!-- TODO: make this button accessible --><div class="sidebar-mask"></div><main class="page" data-v-7abc59e6><div class="container" data-v-7abc59e6><!--[--><!--]--><div class="content" data-v-7abc59e6><div data-v-7abc59e6><h1 id="项目配置项"><a class="header-anchor" href="#项目配置项" aria-hidden="true">#</a> 项目配置项</h1><p>本文将介绍一些常用的项目配置,方便开发者可以根据需求进行定制化改造。</p><h2 id="环境变量配置"><a class="header-anchor" href="#环境变量配置" aria-hidden="true">#</a> 环境变量配置</h2><p>项目的环境变量配置位于项目根目录下的,这里主要配置四个个环境变量,分别为:</p><ul><li><a href="https://github.com/kailong321200875/vue-element-plus-admin/blob/master/.env.base" target="_blank" rel="noopener noreferrer">本地开发环境</a></li><li><a href="https://github.com/kailong321200875/vue-element-plus-admin/blob/master/.env.dev" target="_blank" rel="noopener noreferrer">开发环境</a></li><li><a href="https://github.com/kailong321200875/vue-element-plus-admin/blob/master/.env.test" target="_blank" rel="noopener noreferrer">测试环境</a></li><li><a href="https://github.com/kailong321200875/vue-element-plus-admin/blob/master/.env.pro" target="_blank" rel="noopener noreferrer">生产环境</a></li></ul><p>在开发调试的时候,会读取 <code>.env.base</code> 里面的数据。其他环境亦是如此,根据打包命令的不同,来读取不同的环境变量。</p><p>也许你会疑惑,为什么会有多个环境变量?</p><p>以 <code>生产环境</code> 为例,当我们执行 <code>pnpm run build:pro</code> 时,输出的包是用于线上环境的,所以代码都应该是压缩,我们需要删除掉代码中的 <code>console.log</code> 和 <code>degubber</code>,保证打包后代码的整洁度和不可见性。而其他环境,所以应该保留 <code>console.log</code> 和 <code>degubber</code> 用于调试,这样才能快速定位到问题所在。</p><p>所以环境变量的作用就是为了,在不同环境下有不同的表现。</p><div class="tip custom-block"><p class="custom-block-title">提示</p><ul><li>只有以 <code>VITE_ </code> 开头的变量会被嵌入到项目中,你可以项目代码中这样访问它们:</li></ul><div class="language-js"><pre><code>console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token keyword">import</span><span class="token punctuation">.</span>meta<span class="token punctuation">.</span>env<span class="token punctuation">.</span><span class="token constant">VITE_APP_TITLE</span><span class="token punctuation">)</span>
- </code></pre></div></div><h3 id="配置项说明"><a class="header-anchor" href="#配置项说明" aria-hidden="true">#</a> 配置项说明</h3><h3 id="env-base"><a class="header-anchor" href="#env-base" aria-hidden="true">#</a> .env.base</h3><p>本地开发环境适用</p><div class="language-bash"><pre><code><span class="token comment"># 环境</span>
- NODE_ENV <span class="token operator">=</span> development
- <span class="token comment"># 接口前缀</span>
- VITE_API_BASEPATH <span class="token operator">=</span> base
- <span class="token comment"># 打包路径</span>
- VITE_BASE_PATH <span class="token operator">=</span> /
- <span class="token comment"># 标题</span>
- VITE_APP_TITLE <span class="token operator">=</span> ElementAdmin
- </code></pre></div><h3 id="env-dev"><a class="header-anchor" href="#env-dev" aria-hidden="true">#</a> .env.dev</h3><p>开发环境适用</p><div class="language-bash"><pre><code><span class="token comment"># 环境</span>
- NODE_ENV <span class="token operator">=</span> production
- <span class="token comment"># 接口前缀</span>
- VITE_API_BASEPATH <span class="token operator">=</span> dev
- <span class="token comment"># 打包路径</span>
- VITE_BASE_PATH <span class="token operator">=</span> /dist-dev/
- <span class="token comment"># 是否删除debugger</span>
- VITE_DROP_DEBUGGER <span class="token operator">=</span> <span class="token boolean">false</span>
- <span class="token comment"># 是否删除console.log</span>
- VITE_DROP_CONSOLE <span class="token operator">=</span> <span class="token boolean">false</span>
- <span class="token comment"># 是否sourcemap</span>
- VITE_SOURCEMAP <span class="token operator">=</span> <span class="token boolean">true</span>
- <span class="token comment"># 输出路径</span>
- VITE_OUT_DIR <span class="token operator">=</span> dist-dev
- <span class="token comment"># 标题</span>
- VITE_APP_TITLE <span class="token operator">=</span> ElementAdmin
- </code></pre></div><h3 id="env-test"><a class="header-anchor" href="#env-test" aria-hidden="true">#</a> .env.test</h3><p>测试环境适用</p><div class="language-bash"><pre><code><span class="token comment"># 环境</span>
- NODE_ENV <span class="token operator">=</span> production
- <span class="token comment"># 接口前缀</span>
- VITE_API_BASEPATH <span class="token operator">=</span> <span class="token builtin class-name">test</span>
- <span class="token comment"># 打包路径</span>
- VITE_BASE_PATH <span class="token operator">=</span> /dist-test/
- <span class="token comment"># 是否删除debugger</span>
- VITE_DROP_DEBUGGER <span class="token operator">=</span> <span class="token boolean">false</span>
- <span class="token comment"># 是否删除console.log</span>
- VITE_DROP_CONSOLE <span class="token operator">=</span> <span class="token boolean">false</span>
- <span class="token comment"># 是否sourcemap</span>
- VITE_SOURCEMAP <span class="token operator">=</span> <span class="token boolean">true</span>
- <span class="token comment"># 输出路径</span>
- VITE_OUT_DIR <span class="token operator">=</span> dist-test
- </code></pre></div><h3 id="env-pro"><a class="header-anchor" href="#env-pro" aria-hidden="true">#</a> .env.pro</h3><p>生产环境适用</p><div class="language-bash"><pre><code><span class="token comment"># 环境</span>
- NODE_ENV <span class="token operator">=</span> production
- <span class="token comment"># 接口前缀</span>
- VITE_API_BASEPATH <span class="token operator">=</span> pro
- <span class="token comment"># 打包路径</span>
- VITE_BASE_PATH <span class="token operator">=</span> /
- <span class="token comment"># 是否删除debugger</span>
- VITE_DROP_DEBUGGER <span class="token operator">=</span> <span class="token boolean">true</span>
- <span class="token comment"># 是否删除console.log</span>
- VITE_DROP_CONSOLE <span class="token operator">=</span> <span class="token boolean">true</span>
- <span class="token comment"># 是否sourcemap</span>
- VITE_SOURCEMAP <span class="token operator">=</span> <span class="token boolean">false</span>
- <span class="token comment"># 输出路径</span>
- VITE_OUT_DIR <span class="token operator">=</span> dist-pro
- <span class="token comment"># 标题</span>
- VITE_APP_TITLE <span class="token operator">=</span> ElementAdmin
- </code></pre></div><h2 id="项目及主题配置"><a class="header-anchor" href="#项目及主题配置" aria-hidden="true">#</a> 项目及主题配置</h2><div class="tip custom-block"><p class="custom-block-title">提示</p><p>项目配置文件用于配置项目内展示的内容、布局、主题色等效果。</p></div><h3 id="配置文件路径"><a class="header-anchor" href="#配置文件路径" aria-hidden="true">#</a> 配置文件路径</h3><p><a href="https://github.com/kailong321200875/vue-element-plus-admin/blob/master/src/store/modules/app.ts" target="_blank" rel="noopener noreferrer">src/store/modules/app.ts</a></p><h3 id="说明"><a class="header-anchor" href="#说明" aria-hidden="true">#</a> 说明</h3><p>修改完之后,会添加到全局的状态管理中,方便其他地方使用。</p><div class="language-js"><pre><code><span class="token keyword">export</span> <span class="token keyword">const</span> appModules<span class="token operator">:</span> AppState <span class="token operator">=</span> <span class="token punctuation">{</span>
- sizeMap<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">'default'</span><span class="token punctuation">,</span> <span class="token string">'large'</span><span class="token punctuation">,</span> <span class="token string">'small'</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
- mobile<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 是否是移动端</span>
- title<span class="token operator">:</span> <span class="token keyword">import</span><span class="token punctuation">.</span>meta<span class="token punctuation">.</span>env<span class="token punctuation">.</span><span class="token constant">VITE_APP_TITLE</span> <span class="token keyword">as</span> string<span class="token punctuation">,</span> <span class="token comment">// 标题</span>
- pageLoading<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 路由跳转loading</span>
- breadcrumb<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 面包屑</span>
- breadcrumbIcon<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 面包屑图标</span>
- collapse<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 折叠菜单</span>
- hamburger<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 折叠图标</span>
- screenfull<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 全屏图标</span>
- size<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 尺寸图标</span>
- locale<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 多语言图标</span>
- tagsView<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 标签页</span>
- logo<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// logo</span>
- fixedHeader<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 固定toolheader</span>
- footer<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 显示页脚</span>
- greyMode<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 是否开始灰色模式,用于特殊悼念日</span>
- layout<span class="token operator">:</span> wsCache<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">'layout'</span><span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token string">'classic'</span><span class="token punctuation">,</span> <span class="token comment">// layout布局</span>
- isDark<span class="token operator">:</span> wsCache<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">'isDark'</span><span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 是否是暗黑模式</span>
- currentSize<span class="token operator">:</span> wsCache<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">'default'</span><span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token string">'default'</span><span class="token punctuation">,</span> <span class="token comment">// 组件尺寸</span>
- theme<span class="token operator">:</span> wsCache<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">'theme'</span><span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token punctuation">{</span>
- <span class="token comment">// 主题色</span>
- elColorPrimary<span class="token operator">:</span> <span class="token string">'#409eff'</span><span class="token punctuation">,</span>
- <span class="token comment">// 左侧菜单边框颜色</span>
- leftMenuBorderColor<span class="token operator">:</span> <span class="token string">'inherit'</span><span class="token punctuation">,</span>
- <span class="token comment">// 左侧菜单背景颜色</span>
- leftMenuBgColor<span class="token operator">:</span> <span class="token string">'#001529'</span><span class="token punctuation">,</span>
- <span class="token comment">// 左侧菜单浅色背景颜色</span>
- leftMenuBgLightColor<span class="token operator">:</span> <span class="token string">'#0f2438'</span><span class="token punctuation">,</span>
- <span class="token comment">// 左侧菜单选中背景颜色</span>
- leftMenuBgActiveColor<span class="token operator">:</span> <span class="token string">'var(--el-color-primary)'</span><span class="token punctuation">,</span>
- <span class="token comment">// 左侧菜单收起选中背景颜色</span>
- leftMenuCollapseBgActiveColor<span class="token operator">:</span> <span class="token string">'var(--el-color-primary)'</span><span class="token punctuation">,</span>
- <span class="token comment">// 左侧菜单字体颜色</span>
- leftMenuTextColor<span class="token operator">:</span> <span class="token string">'#bfcbd9'</span><span class="token punctuation">,</span>
- <span class="token comment">// 左侧菜单选中字体颜色</span>
- leftMenuTextActiveColor<span class="token operator">:</span> <span class="token string">'#fff'</span><span class="token punctuation">,</span>
- <span class="token comment">// logo字体颜色</span>
- logoTitleTextColor<span class="token operator">:</span> <span class="token string">'#fff'</span><span class="token punctuation">,</span>
- <span class="token comment">// logo边框颜色</span>
- logoBorderColor<span class="token operator">:</span> <span class="token string">'inherit'</span><span class="token punctuation">,</span>
- <span class="token comment">// 头部背景颜色</span>
- topHeaderBgColor<span class="token operator">:</span> <span class="token string">'#fff'</span><span class="token punctuation">,</span>
- <span class="token comment">// 头部字体颜色</span>
- topHeaderTextColor<span class="token operator">:</span> <span class="token string">'inherit'</span><span class="token punctuation">,</span>
- <span class="token comment">// 头部悬停颜色</span>
- topHeaderHoverColor<span class="token operator">:</span> <span class="token string">'#f6f6f6'</span><span class="token punctuation">,</span>
- <span class="token comment">// 头部边框颜色</span>
- topToolBorderColor<span class="token operator">:</span> <span class="token string">'#eee'</span>
- <span class="token punctuation">}</span>
- <span class="token punctuation">}</span>
- </code></pre></div><h3 id="如何添加新属性"><a class="header-anchor" href="#如何添加新属性" aria-hidden="true">#</a> 如何添加新属性</h3><p>如果想要添加新的全局配置属性,需要在 <a href="https://github.com/kailong321200875/vue-element-plus-admin/blob/master/src/store/modules/app.ts" target="_blank" rel="noopener noreferrer">src/store/modules/app.ts</a> 中 <code>AppState</code> 添加对应的类型,并在 <code>appModules</code> 对象中,赋予新属性的默认值。</p><h2 id="多语言配置"><a class="header-anchor" href="#多语言配置" aria-hidden="true">#</a> 多语言配置</h2><p>用于配置多语言信息</p><p>在 <a href="https://github.com/kailong321200875/vue-element-plus-admin/blob/master/src/store/modules/locale.ts" target="_blank" rel="noopener noreferrer">src/store/modules/locale.ts</a> 内配置</p><div class="language-ts"><pre><code><span class="token keyword">import</span> <span class="token punctuation">{</span> useCache <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@/hooks/web/useCache'</span>
- <span class="token keyword">import</span> zhCn <span class="token keyword">from</span> <span class="token string">'element-plus/lib/locale/lang/zh-cn'</span>
- <span class="token keyword">import</span> en <span class="token keyword">from</span> <span class="token string">'element-plus/lib/locale/lang/en'</span>
- <span class="token keyword">const</span> <span class="token punctuation">{</span> wsCache <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token function">useCache</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
- <span class="token keyword">export</span> <span class="token keyword">const</span> elLocaleMap <span class="token operator">=</span> <span class="token punctuation">{</span>
- <span class="token string">'zh-CN'</span><span class="token operator">:</span> zhCn<span class="token punctuation">,</span>
- en<span class="token operator">:</span> en
- <span class="token punctuation">}</span>
- <span class="token keyword">export</span> <span class="token keyword">interface</span> <span class="token class-name">LocaleState</span> <span class="token punctuation">{</span>
- currentLocale<span class="token operator">:</span> LocaleDropdownType
- localeMap<span class="token operator">:</span> LocaleDropdownType<span class="token punctuation">[</span><span class="token punctuation">]</span>
- <span class="token punctuation">}</span>
- <span class="token keyword">export</span> <span class="token keyword">const</span> localeModules<span class="token operator">:</span> LocaleState <span class="token operator">=</span> <span class="token punctuation">{</span>
- currentLocale<span class="token operator">:</span> <span class="token punctuation">{</span>
- lang<span class="token operator">:</span> wsCache<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">'lang'</span><span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token string">'zh-CN'</span><span class="token punctuation">,</span>
- elLocale<span class="token operator">:</span> elLocaleMap<span class="token punctuation">[</span>wsCache<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">'lang'</span><span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token string">'zh-CN'</span><span class="token punctuation">]</span>
- <span class="token punctuation">}</span><span class="token punctuation">,</span>
- <span class="token comment">// 多语言</span>
- localeMap<span class="token operator">:</span> <span class="token punctuation">[</span>
- <span class="token punctuation">{</span>
- lang<span class="token operator">:</span> <span class="token string">'zh-CN'</span><span class="token punctuation">,</span>
- name<span class="token operator">:</span> <span class="token string">'简体中文'</span>
- <span class="token punctuation">}</span><span class="token punctuation">,</span>
- <span class="token punctuation">{</span>
- lang<span class="token operator">:</span> <span class="token string">'en'</span><span class="token punctuation">,</span>
- name<span class="token operator">:</span> <span class="token string">'English'</span>
- <span class="token punctuation">}</span>
- <span class="token punctuation">]</span>
- <span class="token punctuation">}</span>
- </code></pre></div><h2 id="样式配置"><a class="header-anchor" href="#样式配置" aria-hidden="true">#</a> 样式配置</h2><h3 id="css-前缀设置"><a class="header-anchor" href="#css-前缀设置" aria-hidden="true">#</a> css 前缀设置</h3><p>用于修改项目内组件及 <code>element-plus</code> 组件的 <code>class</code> 前缀。</p><p>由于 <code>element-plus</code> 的组件还没有全部采用动态配置前缀,所以目前还是使用 <code>el</code> 前缀。</p><ul><li>在 <a href="https://github.com/kailong321200875/vue-element-plus-admin/blob/master/src/styles/variables.module.less" target="_blank" rel="noopener noreferrer">src/styles/variables.module.less</a> 内配置</li></ul><div class="language-less"><pre><code><span class="token comment">// 命名空间</span>
- <span class="token variable">@namespace<span class="token punctuation">:</span></span> v<span class="token punctuation">;</span>
- <span class="token comment">// el命名空间</span>
- <span class="token variable">@elNamespace<span class="token punctuation">:</span></span> el<span class="token punctuation">;</span>
- <span class="token comment">// 导出变量</span>
- <span class="token selector">:export</span> <span class="token punctuation">{</span>
- <span class="token property">namespace</span><span class="token punctuation">:</span> <span class="token variable">@namespace</span><span class="token punctuation">;</span>
- <span class="token property">elNamespace</span><span class="token punctuation">:</span> <span class="token variable">@elNamespace</span><span class="token punctuation">;</span>
- <span class="token punctuation">}</span>
- </code></pre></div><h3 id="前缀使用"><a class="header-anchor" href="#前缀使用" aria-hidden="true">#</a> 前缀使用</h3><p><strong>在 css 内</strong></p><div class="language-vue"><pre><code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>style</span> <span class="token attr-name">lang</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>less<span class="token punctuation">"</span></span> <span class="token attr-name">scoped</span><span class="token punctuation">></span></span><span class="token style"><span class="token language-css">
- <span class="token comment">/* namespace已经全局注入,不需要额外在引入 */</span>
- <span class="token atrule"><span class="token rule">@prefix-cls</span><span class="token punctuation">:</span> ~'@</span><span class="token punctuation">{</span>namespace<span class="token punctuation">}</span>-app'<span class="token punctuation">;</span>
- <span class="token selector">.@</span><span class="token punctuation">{</span>prefix-cls<span class="token punctuation">}</span> <span class="token punctuation">{</span>
- <span class="token property">width</span><span class="token punctuation">:</span> 100%<span class="token punctuation">;</span>
- <span class="token punctuation">}</span>
- </span></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>style</span><span class="token punctuation">></span></span>
- </code></pre></div><p><strong>在 vue/ts 内</strong></p><div class="language-ts"><pre><code><span class="token keyword">import</span> <span class="token punctuation">{</span> useDesign <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'/@/hooks/web/useDesign'</span>
- <span class="token keyword">const</span> <span class="token punctuation">{</span> prefixCls <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token function">useDesign</span><span class="token punctuation">(</span><span class="token string">'app'</span><span class="token punctuation">)</span>
- <span class="token comment">// prefixCls => v-app</span>
- </code></pre></div></div></div><footer class="page-footer" data-v-7abc59e6 data-v-22e60b1a><div class="edit" data-v-22e60b1a><div class="edit-link" data-v-22e60b1a data-v-045573c2><a class="link" href="https://github.com/kailong321200875/vue-element-plus-admin-doc/edit/master/guide/settings.md" target="_blank" rel="noopener noreferrer" data-v-045573c2>为此页提供修改建议 <svg class="icon outbound icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-045573c2><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"></path><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"></polygon></svg></a></div></div><div class="updated" data-v-22e60b1a><!----></div></footer><div class="next-and-prev-link" data-v-7abc59e6 data-v-0facf926><div class="container" data-v-0facf926><div class="prev" data-v-0facf926><a class="link" href="/guide/" data-v-0facf926><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" class="icon icon-prev" data-v-0facf926><path d="M19,11H7.4l5.3-5.3c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0l-7,7c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.2-0.1,0.5,0,0.8c0.1,0.1,0.1,0.2,0.2,0.3l7,7c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L7.4,13H19c0.6,0,1-0.4,1-1S19.6,11,19,11z"></path></svg><span class="text" data-v-0facf926>开始</span></a></div><div class="next" data-v-0facf926><a class="link" href="/guide/router" data-v-0facf926><span class="text" data-v-0facf926>路由</span><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" class="icon icon-next" data-v-0facf926><path d="M19.9,12.4c0.1-0.2,0.1-0.5,0-0.8c-0.1-0.1-0.1-0.2-0.2-0.3l-7-7c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l5.3,5.3H5c-0.6,0-1,0.4-1,1s0.4,1,1,1h11.6l-5.3,5.3c-0.4,0.4-0.4,1,0,1.4c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3l7-7C19.8,12.6,19.9,12.5,19.9,12.4z"></path></svg></a></div></div></div><!--[--><!--]--></div></main></div><!----><!--]--></div>
- <script>__VP_HASH_MAP__ = JSON.parse("{\"readme.md\":\"6eae9e86\",\"index.md\":\"c755561e\",\"components_avatars.md\":\"2c3d0baf\",\"components_button.md\":\"0430e5c7\",\"components_content-detail-wrap.md\":\"2d7c311e\",\"components_count-to.md\":\"af12b562\",\"components_descriptions.md\":\"8008497d\",\"components_dialog.md\":\"189b3e63\",\"components_echart.md\":\"48a3cc09\",\"components_editor.md\":\"d52df9ff\",\"components_error.md\":\"d3318a72\",\"components_footer.md\":\"ba498476\",\"components_form.md\":\"1db28135\",\"components_highlight.md\":\"00a3b626\",\"components_i-agree.md\":\"0cb8ef29\",\"components_icon-picker.md\":\"d6c2b409\",\"components_icon.md\":\"6b2d9abc\",\"components_image-viewer.md\":\"aca71661\",\"components_infotip.md\":\"3481943a\",\"components_input-password.md\":\"7a7c7757\",\"components_introduction.md\":\"c650023e\",\"components_json-editor.md\":\"09f19a8e\",\"components_permission.md\":\"5db4fab9\",\"components_qrcode.md\":\"a46b6363\",\"components_search.md\":\"bb143d26\",\"components_sticky.md\":\"efee741b\",\"components_table.md\":\"4b5c9118\",\"components_video-player.md\":\"6976a4b8\",\"components_video-viewer.md\":\"2276a156\",\"components_waterfall.md\":\"b5de9a16\",\"dep_create-module.md\":\"a4058b7f\",\"dep_dark.md\":\"30a52430\",\"dep_i18n.md\":\"03d8c9e2\",\"dep_lint.md\":\"6eaf183b\",\"donate_donate.md\":\"0ed1e9e3\",\"guide_auth.md\":\"5db6d54f\",\"guide_component.md\":\"8c7f03c8\",\"guide_deploy.md\":\"6cc0cffb\",\"guide_design.md\":\"60ce830a\",\"guide_fqa.md\":\"35588af1\",\"guide_index.md\":\"f04946f9\",\"guide_introduction.md\":\"32d0684d\",\"guide_mock.md\":\"514c515d\",\"guide_router.md\":\"ac437d23\",\"guide_settings.md\":\"6e476ca7\",\"guide_version.md\":\"ba3a4914\",\"hooks_useclipboard.md\":\"58247a15\",\"hooks_usecrudschemas.md\":\"2ecc0a43\",\"hooks_usenetwork.md\":\"f87e4dc0\",\"hooks_usestorage.md\":\"dec27e27\",\"hooks_usetagsview.md\":\"627f18d8\",\"hooks_usewatermark.md\":\"d89d552b\"}")</script>
- <script type="module" async src="/assets/app.51e46c58.js"></script>
- </body>
- </html>
|