mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-17 16:13:36 +08:00
Deploying to dist from @ XiaoDaiGua-Ray/ray-template@0e688a34bf 🚀
This commit is contained in:
parent
06b952e314
commit
1e5cda83c1
File diff suppressed because it is too large
Load Diff
1
css/account-profile-B6oQwLvV.css
Normal file
1
css/account-profile-B6oQwLvV.css
Normal file
File diff suppressed because one or more lines are too long
BIN
css/account-profile-B6oQwLvV.css.gz
Normal file
BIN
css/account-profile-B6oQwLvV.css.gz
Normal file
Binary file not shown.
1
css/directives-DQUqUncq.css
Normal file
1
css/directives-DQUqUncq.css
Normal file
File diff suppressed because one or more lines are too long
BIN
css/directives-DQUqUncq.css.gz
Normal file
BIN
css/directives-DQUqUncq.css.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{R as p}from"./chunks/theme.jIEdD8pU.js";import{R as s,ar as i,as as u,at as c,au as l,av as f,aw as d,ax as m,ay as h,az as A,aA as g,d as v,u as w,v as y,s as C,aB as R,aC as P,aD as b,a2 as E}from"./chunks/framework.D8G7yXPy.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=w();return y(()=>{C(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&R(),P(),b(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=x(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return g(S)}function x(){let e=s;return h(a=>{let t=A(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};
|
||||
import{R as p}from"./chunks/theme.D3rTNXiF.js";import{R as s,ar as i,as as u,at as c,au as l,av as f,aw as d,ax as m,ay as h,az as A,aA as g,d as v,u as w,v as y,s as C,aB as R,aC as P,aD as b,a2 as E}from"./chunks/framework.D8G7yXPy.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=w();return y(()=>{C(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&R(),P(),b(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=x(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return g(S)}function x(){let e=s;return h(a=>{let t=A(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};
|
||||
1
docs/assets/chunks/@localSearchIndexroot.AXIXw8IN.js
Normal file
1
docs/assets/chunks/@localSearchIndexroot.AXIXw8IN.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,8 +1,8 @@
|
||||
import{_ as e,o as t,c as s,a3 as d}from"./chunks/framework.D8G7yXPy.js";const m=JSON.parse('{"title":"v6 Monorepo 架构","description":"","frontmatter":{},"headers":[],"relativePath":"guide/architecture.md","filePath":"guide/architecture.md"}'),o={name:"guide/architecture.md"};function r(p,a,i,n,c,l){return t(),s("div",null,[...a[0]||(a[0]=[d(`<h1 id="v6-monorepo-架构" tabindex="-1">v6 Monorepo 架构 <a class="header-anchor" href="#v6-monorepo-架构" aria-label="Permalink to "v6 Monorepo 架构""></a></h1><p>Ray Template 6.0.0 把后台应用、官网文档和共享能力放到同一个 pnpm workspace。<strong>Ray Admin</strong> 是完整后台,官网则按页加载同一套组件和工具做交互示例。</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>ray-template/</span></span>
|
||||
import{_ as a,o as t,c as s,a3 as d}from"./chunks/framework.D8G7yXPy.js";const m=JSON.parse('{"title":"v6 Monorepo 架构","description":"","frontmatter":{},"headers":[],"relativePath":"guide/architecture.md","filePath":"guide/architecture.md"}'),o={name:"guide/architecture.md"};function r(p,e,c,i,n,l){return t(),s("div",null,[...e[0]||(e[0]=[d(`<h1 id="v6-monorepo-架构" tabindex="-1">v6 Monorepo 架构 <a class="header-anchor" href="#v6-monorepo-架构" aria-label="Permalink to "v6 Monorepo 架构""></a></h1><p>Ray Template 6.0.0 把后台应用、官网文档和共享能力放到同一个 pnpm workspace。<strong>Ray Admin</strong> 是完整后台,官网则按页加载同一套组件和工具做交互示例。</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>ray-template/</span></span>
|
||||
<span class="line"><span>├── apps/</span></span>
|
||||
<span class="line"><span>│ ├── admin/ # Ray Admin:登录、会话、路由和业务页面</span></span>
|
||||
<span class="line"><span>│ └── docs/ # VitePress:指南、API 与交互示例</span></span>
|
||||
<span class="line"><span>├── packages/ # 两个应用共用的八个私有 workspace 包</span></span>
|
||||
<span class="line"><span>├── packages/ # 十个私有 workspace 包,按运行时边界复用</span></span>
|
||||
<span class="line"><span>├── harness/ # 任务入口与验收命令</span></span>
|
||||
<span class="line"><span>└── pnpm-lock.yaml # 工作区共用锁文件</span></span></code></pre></div><h2 id="各包负责什么" tabindex="-1">各包负责什么 <a class="header-anchor" href="#各包负责什么" aria-label="Permalink to "各包负责什么""></a></h2><table tabindex="0"><thead><tr><th>包</th><th>公开能力与使用方式</th></tr></thead><tbody><tr><td><code>@ray-template/utils</code></td><td>精度运算、对象和类型处理、文件工具、接收存储实现的 JSON 工具。精度运算从 <code>/precision</code> 导入。</td></tr><tr><td><code>@ray-template/composables</code></td><td>设备宽度、元素全屏、截图、打印和其他独立 Vue Hooks,例如 <code>/useElementFullscreen</code>。</td></tr><tr><td><code>@ray-template/directives</code></td><td>复制、防抖、节流、省略、水波纹等指令,可单独导入或统一注册。</td></tr><tr><td><code>@ray-template/icons</code></td><td>SVG 资源、图标名称类型和资源查找。组件和路由配置使用同一套名称。</td></tr><tr><td><code>@ray-template/ui</code></td><td>组件、样式、主题与类型。通过 <code>/table-pro</code>、<code>/barcode</code> 或 <code>/chart</code> 等入口按需导入。</td></tr><tr><td><code>@ray-template/http</code></td><td><code>createHttpClient</code> 创建实例与独立的取消器。宿主提供地址、请求头和拦截器。</td></tr><tr><td><code>@ray-template/routing</code></td><td>路由 Schema、配置校验、路由展开和菜单处理。宿主提供页面注册表。</td></tr><tr><td><code>@ray-template/admin-shell</code></td><td>布局、顶部导航、标签、设置和路由过渡。宿主提供菜单、选中状态、偏好和内容。</td></tr></tbody></table><p>共享包通过 <code>package.json</code> 的 <code>exports</code> 暴露入口,只依赖自己声明的包。<code>pnpm packages:check</code> 检查跨包导入和依赖循环。应用的登录、路由守卫、业务 API、Pinia 实例和语言加载由 <code>apps/admin</code> 负责。</p><h2 id="ray-admin-怎么组装" tabindex="-1">Ray Admin 怎么组装 <a class="header-anchor" href="#ray-admin-怎么组装" aria-label="Permalink to "Ray Admin 怎么组装""></a></h2><p><code>apps/admin/src/main.ts</code> 安装 Pinia、国际化、路由和指令。应用入口为组件提供主题、翻译、图标和列偏好存储,路由层把注册的页面交给后台外壳。登录、角色和会话由应用处理,真实业务的服务端负责接口授权。</p><p>以 TablePro 为例,组件负责展示、搜索、分页与请求状态。后台传入业务查询,文档传入可取消的模拟查询。两边从同一个入口导入:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { RTablePro } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@ray-template/ui/table-pro'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { add } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@ray-template/utils/precision'</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/main.ts" target="_blank" rel="noreferrer">后台应用入口</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/App.tsx" target="_blank" rel="noreferrer">应用组装</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/docs/architecture.md" target="_blank" rel="noreferrer">完整工程地图</a></p><h2 id="文档怎样运行组件" tabindex="-1">文档怎样运行组件 <a class="header-anchor" href="#文档怎样运行组件" aria-label="Permalink to "文档怎样运行组件""></a></h2><p><code>apps/docs/examples</code> 保存实际运行的 Vue 示例。Markdown 引用同一个文件展示源码。TablePro 使用本地数据或可控的模拟请求;布局实验在独立预览框内运行,使用自己的内存路由和主题状态。</p><p><a href="./../reference/utils/core.html#交互示例">精度运算</a> · <a href="./../reference/components/barcode.html#交互示例">RBarcode</a> · <a href="./../reference/table-pro.html#交互示例">TablePro</a> · <a href="./layout.html#在线布局实验">布局实验</a></p><h2 id="构建与部署" tabindex="-1">构建与部署 <a class="header-anchor" href="#构建与部署" aria-label="Permalink to "构建与部署""></a></h2><p><code>pnpm dev</code> 启动后台,<code>pnpm docs:dev</code> 启动文档。<code>pnpm build</code> 输出后台,<code>pnpm docs:build</code> 输出文档,<code>pnpm pages:build</code> 组装两者到 <code>dist/pages</code>。官方部署地址分别是 <code>/ray-template/</code> 和 <code>/ray-template/docs/</code>。<a href="./tooling.html">构建与部署指南</a></p><p>如果当前项目基于 v5,请先看<a href="./../migration.html">版本分界</a>,再决定是否接入 v6。</p>`,17)])])}const b=e(o,[["render",r]]);export{m as __pageData,b as default};
|
||||
<span class="line"><span>└── pnpm-lock.yaml # 工作区共用锁文件</span></span></code></pre></div><h2 id="各包负责什么" tabindex="-1">各包负责什么 <a class="header-anchor" href="#各包负责什么" aria-label="Permalink to "各包负责什么""></a></h2><table tabindex="0"><thead><tr><th>包</th><th>公开能力与使用方式</th></tr></thead><tbody><tr><td><code>@ray-template/utils</code></td><td>精度运算、对象和类型处理、文件工具、接收存储实现的 JSON 工具。精度运算从 <code>/precision</code> 导入。</td></tr><tr><td><code>@ray-template/composables</code></td><td>设备宽度、元素全屏、截图、打印和其他独立 Vue Hooks,例如 <code>/useElementFullscreen</code>。</td></tr><tr><td><code>@ray-template/directives</code></td><td>复制、防抖、节流、省略、水波纹等指令,可单独导入或统一注册。</td></tr><tr><td><code>@ray-template/icons</code></td><td>SVG 资源、图标名称类型和资源查找。组件和路由配置使用同一套名称。</td></tr><tr><td><code>@ray-template/ui</code></td><td>组件、样式、主题与类型。通过 <code>/table-pro</code>、<code>/barcode</code> 或 <code>/chart</code> 等入口按需导入。</td></tr><tr><td><code>@ray-template/http</code></td><td><code>createHttpClient</code> 创建实例与独立的取消器。宿主提供地址、请求头和拦截器。</td></tr><tr><td><code>@ray-template/api-contracts</code></td><td>通用请求与响应、Valibot 校验、路由 Schema 和 OpenAPI;不依赖浏览器或服务端框架。</td></tr><tr><td><code>@ray-template/demo-data</code></td><td>Mock 与后端演示共用的数据、查询辅助和初始路由,调用方决定是否启用。</td></tr><tr><td><code>@ray-template/routing</code></td><td>路由 Schema 兼容入口、浏览器路由展开和菜单处理。宿主提供页面注册表。</td></tr><tr><td><code>@ray-template/admin-shell</code></td><td>布局、顶部导航、标签、设置和路由过渡。宿主提供菜单、选中状态、偏好和内容。</td></tr></tbody></table><p>共享包通过 <code>package.json</code> 的 <code>exports</code> 暴露入口,只依赖自己声明的包。<code>pnpm packages:check</code> 检查跨包导入和依赖循环。应用的登录、路由守卫、业务 API、Pinia 实例和语言加载由 <code>apps/admin</code> 负责。</p><p>应用不能作为其他工作区的依赖;包通过 <code>rayTemplate.runtime</code> 标明 <code>browser</code>、<code>server</code> 或 <code>universal</code>。通用包只依赖通用包,浏览器与服务端通过 HTTP 和共享契约交互。路由 Schema 的权威来源是 <code>packages/api-contracts/src/routes.ts</code>,旧 routing 入口保留转导出。源码发行方式见<a href="./distributions.html">发行版本与快速启动</a>。</p><p>可选的 <code>apps/server</code> 独立构建和运行,内部业务模块使用 NestJS、PostgreSQL 和 Redis。前端不会导入其控制器、数据库模型或配置。纯前端导出会移除整个服务端工作区及专属依赖。</p><h2 id="ray-admin-怎么组装" tabindex="-1">Ray Admin 怎么组装 <a class="header-anchor" href="#ray-admin-怎么组装" aria-label="Permalink to "Ray Admin 怎么组装""></a></h2><p><code>apps/admin/src/main.ts</code> 安装 Pinia、国际化、路由和指令。应用入口为组件提供主题、翻译、图标和列偏好存储,路由层把注册的页面交给后台外壳。登录、角色和会话由应用处理,真实业务的服务端负责接口授权。</p><p>以 TablePro 为例,组件负责展示、搜索、分页与请求状态。后台传入业务查询,文档传入可取消的模拟查询。两边从同一个入口导入:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { RTablePro } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@ray-template/ui/table-pro'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { add } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@ray-template/utils/precision'</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/main.ts" target="_blank" rel="noreferrer">后台应用入口</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/App.tsx" target="_blank" rel="noreferrer">应用组装</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/docs/architecture.md" target="_blank" rel="noreferrer">完整工程地图</a></p><h2 id="文档怎样运行组件" tabindex="-1">文档怎样运行组件 <a class="header-anchor" href="#文档怎样运行组件" aria-label="Permalink to "文档怎样运行组件""></a></h2><p><code>apps/docs/examples</code> 保存实际运行的 Vue 示例。Markdown 引用同一个文件展示源码。TablePro 使用本地数据或可控的模拟请求;布局实验在独立预览框内运行,使用自己的内存路由和主题状态。</p><p><a href="./../reference/utils/core.html#交互示例">精度运算</a> · <a href="./../reference/components/barcode.html#交互示例">RBarcode</a> · <a href="./../reference/table-pro.html#交互示例">TablePro</a> · <a href="./layout.html#在线布局实验">布局实验</a></p><h2 id="构建与部署" tabindex="-1">构建与部署 <a class="header-anchor" href="#构建与部署" aria-label="Permalink to "构建与部署""></a></h2><p><code>pnpm dev</code> 启动后台,<code>pnpm docs:dev</code> 启动文档。<code>pnpm build</code> 输出后台,<code>pnpm docs:build</code> 输出文档,<code>pnpm pages:build</code> 组装两者到 <code>dist/pages</code>。官方部署地址分别是 <code>/ray-template/</code> 和 <code>/ray-template/docs/</code>。<a href="./tooling.html">构建与部署指南</a></p><p>如果当前项目基于 v5,请先看<a href="./../migration.html">版本分界</a>,再决定是否接入 v6。</p>`,19)])])}const b=a(o,[["render",r]]);export{m as __pageData,b as default};
|
||||
@ -1 +1 @@
|
||||
import{_ as e,o as t,c as s,a3 as d}from"./chunks/framework.D8G7yXPy.js";const m=JSON.parse('{"title":"v6 Monorepo 架构","description":"","frontmatter":{},"headers":[],"relativePath":"guide/architecture.md","filePath":"guide/architecture.md"}'),o={name:"guide/architecture.md"};function r(p,a,i,n,c,l){return t(),s("div",null,[...a[0]||(a[0]=[d("",17)])])}const b=e(o,[["render",r]]);export{m as __pageData,b as default};
|
||||
import{_ as a,o as t,c as s,a3 as d}from"./chunks/framework.D8G7yXPy.js";const m=JSON.parse('{"title":"v6 Monorepo 架构","description":"","frontmatter":{},"headers":[],"relativePath":"guide/architecture.md","filePath":"guide/architecture.md"}'),o={name:"guide/architecture.md"};function r(p,e,c,i,n,l){return t(),s("div",null,[...e[0]||(e[0]=[d("",19)])])}const b=a(o,[["render",r]]);export{m as __pageData,b as default};
|
||||
@ -1 +0,0 @@
|
||||
import{o as a,c as e,j as i,a as t,k as d,g as n,a3 as p}from"./chunks/framework.D8G7yXPy.js";const h=["href"],c=JSON.parse('{"title":"服务端接入与标准契约","description":"","frontmatter":{},"headers":[],"relativePath":"guide/backend.md","filePath":"guide/backend.md"}'),l={name:"guide/backend.md"},E=Object.assign(l,{setup(o){return(k,s)=>(a(),e("div",null,[s[0]||(s[0]=i("h1",{id:"服务端接入与标准契约",tabindex:"-1"},[t("服务端接入与标准契约 "),i("a",{class:"header-anchor",href:"#服务端接入与标准契约","aria-label":'Permalink to "服务端接入与标准契约"'},"")],-1)),s[1]||(s[1]=i("p",null,"登录、会话、用户管理与路由管理使用同一套 HTTP API。开发环境与静态在线演示都由 MSW 在网络层模拟响应;页面和 Store 不直接读取 Mock 数据库。接入自有服务端时,保留页面与调用方法,替换接口地址和实现即可。",-1)),i("p",null,[i("a",{href:d(n)("/contracts/admin-api.json"),target:"_blank",rel:"noreferrer"},"下载 OpenAPI 3.1 契约",8,h)]),s[2]||(s[2]=p("",36))]))}});export{c as __pageData,E as default};
|
||||
File diff suppressed because one or more lines are too long
1
docs/assets/guide_backend.md.DpcumSyL.lean.js
Normal file
1
docs/assets/guide_backend.md.DpcumSyL.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{o as a,c as t,j as i,a as e,k as d,g as n,a3 as o}from"./chunks/framework.D8G7yXPy.js";const p=["href"],c=JSON.parse('{"title":"服务端接入与标准契约","description":"","frontmatter":{},"headers":[],"relativePath":"guide/backend.md","filePath":"guide/backend.md"}'),h={name:"guide/backend.md"},E=Object.assign(h,{setup(l){return(k,s)=>(a(),t("div",null,[s[0]||(s[0]=i("h1",{id:"服务端接入与标准契约",tabindex:"-1"},[e("服务端接入与标准契约 "),i("a",{class:"header-anchor",href:"#服务端接入与标准契约","aria-label":'Permalink to "服务端接入与标准契约"'},"")],-1)),s[1]||(s[1]=i("p",null,[e("登录、会话、用户管理与路由管理使用同一套 HTTP API。源码发行和启动方式见"),i("a",{href:"./distributions.html"},"发行版本与快速启动"),e("。开发环境与静态在线演示都由 MSW 在网络层模拟响应;页面和 Store 不直接读取 Mock 数据库。接入自有服务端时,保留页面与调用方法,替换接口地址和实现即可。")],-1)),i("p",null,[i("a",{href:d(n)("/contracts/admin-api.json"),target:"_blank",rel:"noreferrer"},"下载 OpenAPI 3.1 契约",8,p)]),s[2]||(s[2]=o("",44))]))}});export{c as __pageData,E as default};
|
||||
5
docs/assets/guide_distributions.md.CquuxHZi.js
Normal file
5
docs/assets/guide_distributions.md.CquuxHZi.js
Normal file
@ -0,0 +1,5 @@
|
||||
import{_ as s,o as a,c as d,a3 as i}from"./chunks/framework.D8G7yXPy.js";const k=JSON.parse('{"title":"发行版本与快速启动","description":"","frontmatter":{},"headers":[],"relativePath":"guide/distributions.md","filePath":"guide/distributions.md"}'),o={name:"guide/distributions.md"};function t(c,e,p,l,n,r){return a(),d("div",null,[...e[0]||(e[0]=[i(`<h1 id="发行版本与快速启动" tabindex="-1">发行版本与快速启动 <a class="header-anchor" href="#发行版本与快速启动" aria-label="Permalink to "发行版本与快速启动""></a></h1><p>同一套前端通过源码导出提供独立使用方式。Admin、文档和公共包之间保留明确依赖边界,Mock 与自有后端遵循同一套 API 契约。源码归档包含可编辑的工程文件,需要安装依赖并构建后运行。</p><h2 id="纯前端发行包" tabindex="-1">纯前端发行包 <a class="header-anchor" href="#纯前端发行包" aria-label="Permalink to "纯前端发行包""></a></h2><p>在仓库根目录执行:</p><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pnpm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dist:frontend</span></span></code></pre></div><p>输出目录为 <code>dist/distributions/</code>,包含 <code>ray-template-frontend-<version>/</code> 和同名 <code>.tar.gz</code>。解压后进入源码目录,使用仓库指定的 Node.js 26.13.0 与 pnpm 12.16.1:</p><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pnpm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --frozen-lockfile</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pnpm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dev</span></span></code></pre></div><p>默认打开 <code>/ray-template/</code>,通过 MSW 体验登录、用户管理、路由和其他示例。纯前端包保留 Admin、文档、10 个共享包及必要工具;不包含后端工作区、数据库驱动、Redis 客户端、服务端启动脚本或数据库配置。前端开发、构建和文档使用不需要 Docker。</p><p>接入自己的服务时配置 <code>VITE_API_BASE_URL</code>、<code>VITE_API_MOCK=false</code>,具体协议见<a href="./backend.html">服务端接入</a>。这些前端变量会进入浏览器产物,只能放公开配置。</p><h2 id="发行物追溯" tabindex="-1">发行物追溯 <a class="header-anchor" href="#发行物追溯" aria-label="Permalink to "发行物追溯""></a></h2><p>归档内的 <code>distribution.json</code> 记录:</p><ul><li>发行类型和版本。</li><li>来源 Git 提交及是否含未提交改动;没有 Git 信息时保留已知的来源信息。</li><li>实际包含的 workspace 清单和源码文件数量。</li><li>导出内容的 SHA-256 摘要。</li></ul><p>导出会按依赖图保留所需工作区、裁剪锁文件、移除不可用命令与专属说明,并排除 <code>.git</code>、<code>node_modules</code>、本地环境配置、凭据、构建结果和临时验证资料。<code>pnpm dist:check</code> 检查导出计划和依赖完整性;干净环境中的安装、构建、运行需要另行验证。</p><p>导出命令只生成本地源码目录和归档。</p><h2 id="全栈发行包" tabindex="-1">全栈发行包 <a class="header-anchor" href="#全栈发行包" aria-label="Permalink to "全栈发行包""></a></h2><p>在完整仓库运行:</p><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pnpm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dist:fullstack</span></span></code></pre></div><p>同一目录会生成 <code>ray-template-fullstack-<version>/</code> 与同名 <code>.tar.gz</code>。它包含相同的前端源码以及 <code>apps/server</code>、数据库迁移、Redis 配置和启动工具。后端采用 NestJS 12.3.3、Prisma 7.10.1、PostgreSQL 18,Redis 客户端为 6.3.1;Compose 配置使用 Redis 8.2.11。具体锁定版本以发行包清单和锁文件为准。</p><h3 id="本地开发" tabindex="-1">本地开发 <a class="header-anchor" href="#本地开发" aria-label="Permalink to "本地开发""></a></h3><p>安装依赖并准备 Docker Compose,然后运行:</p><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pnpm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fullstack:setup</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pnpm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dev:full</span></span></code></pre></div><p><code>setup</code> 首次创建 <code>apps/server/.env.local</code>,生成数据库、Redis、管理员随机密码和 JWT 签名密钥,启动 PostgreSQL 与 Redis,执行迁移并初始化管理员。配置文件按私有文件创建;请在本机读取初始用户名和密码,勿提交、上传或放进前端变量。Mock 的 <code>123456</code> 只用于前端演示。</p><p>再次执行 <code>setup</code> 会复用配置、保留已有账号和数据库内容。<code>dev:full</code> 等待后端就绪后再启动前端,通过 Vite 将同源 <code>/api/</code> 请求代理给后端,并关闭 Mock。默认地址为 <code>http://127.0.0.1:9527/ray-template/</code>;可用 <code>ADMIN_DEV_PORT</code> 和 <code>PORT</code> 分别指定前端和后端端口。按 <code>Ctrl+C</code> 关闭开发进程;<code>pnpm fullstack:stop</code> 停止 Compose 服务并保留数据卷。</p><h3 id="使用已有数据库与-redis" tabindex="-1">使用已有数据库与 Redis <a class="header-anchor" href="#使用已有数据库与-redis" aria-label="Permalink to "使用已有数据库与 Redis""></a></h3><p>将 <code>DATABASE_URL</code> 和 <code>REDIS_URL</code> 放入当前进程的安全环境中,然后执行:</p><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pnpm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fullstack:setup</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --external</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pnpm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dev:full</span></span></code></pre></div><p><code>--external</code> 跳过 Docker 服务启动,仍执行迁移和初始化。已有 <code>apps/server/.env.local</code> 时保留该文件,进程环境优先。应使用为本项目准备的数据库;迁移和初始化会创建或更新本项目的数据结构。停止外部数据服务由其部署环境负责。</p><h3 id="创建真实登录账号" tabindex="-1">创建真实登录账号 <a class="header-anchor" href="#创建真实登录账号" aria-label="Permalink to "创建真实登录账号""></a></h3><p>在用户管理新增资料后,有 <code>users:credentials</code> 权限的管理员可以为该账号点击 <strong>设置密码</strong>。已登录用户可在头像菜单的 <strong>个人信息</strong> 页面修改自己的密码,需要输入当前密码。改密或重设会撤销该账号的所有会话。密码要求 12–128 个字符。</p><p>无法登录时,运维可通过安全环境提供 <code>CREDENTIAL_USERNAME</code> 与 <code>CREDENTIAL_PASSWORD</code>,再执行 <code>pnpm server:credential:set</code>。该命令适用于直接访问项目数据库的运维终端。重复执行 <code>setup</code> 不会创建改名前的账号,也不会重置密码。不要把密码写进命令行、终端记录或 AI 对话。</p><h3 id="服务与运行检查" tabindex="-1">服务与运行检查 <a class="header-anchor" href="#服务与运行检查" aria-label="Permalink to "服务与运行检查""></a></h3><table tabindex="0"><thead><tr><th>命令或接口</th><th>用途</th></tr></thead><tbody><tr><td><code>pnpm server:build</code></td><td>生成 Prisma Client 并构建独立服务端产物</td></tr><tr><td><code>pnpm server:start</code></td><td>从服务端构建产物启动</td></tr><tr><td><code>pnpm server:check</code></td><td>服务端类型、单元/平台测试和构建</td></tr><tr><td><code>pnpm server:test:integration</code></td><td>使用 <code>TEST_DATABASE_URL</code>、<code>TEST_REDIS_URL</code> 验证真实存储与 HTTP 行为</td></tr><tr><td><code>GET /api/health/live</code></td><td>进程存活检查</td></tr><tr><td><code>GET /api/health/ready</code></td><td>PostgreSQL 与 Redis 就绪检查</td></tr></tbody></table><p>全栈包含配置校验、接口授权、会话撤销、Redis 限流、安全响应头、CORS、请求 ID、脱敏日志和操作审计。Redis 不可用时管理接口返回 503,不切换到每进程的临时认证或限流数据。缓存只用于可重建的演示读取结果,权限和会话每次从数据库核验。</p><p>生产模式默认关闭演示接口,并从后端提供的运行菜单中移除演示页面。路由编辑器仍可维护完整配置。真实后端请求失败不会回退到 Mock。</p><h3 id="容器启动" tabindex="-1">容器启动 <a class="header-anchor" href="#容器启动" aria-label="Permalink to "容器启动""></a></h3><p>准备仓库指定的 Node.js 26.13.0,以及已启动的 Docker 和 Compose v2 插件(<code>docker compose version</code>、<code>docker info</code> 均应成功)。从解压后的全栈源码或完整仓库根目录运行:</p><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">node</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> scripts/fullstack.mjs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> up</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 使用 pnpm 时,也可以运行 pnpm fullstack:up</span></span></code></pre></div><p>此命令创建私有配置、构建 Admin 和 API、启动 PostgreSQL 与 Redis、执行迁移和初始化,等服务就绪后打印本机入口。宿主机无需预先安装前端依赖。默认入口为 <code>http://127.0.0.1:8080/ray-template/</code>,可通过 <code>APP_PORT</code> 改端口。使用 <code>node scripts/fullstack.mjs stop</code> 停止服务,数据卷保留。多个隔离实例要为每份配置指定不同的 <code>RAY_COMPOSE_PROJECT</code>、宿主机端口和 <code>APP_PROXY_NETWORK</code>。</p><p>Nginx 将同源 <code>/api/</code> 转发给后端。默认只在回环地址暴露宿主机端口,生产模式关闭演示(可用 <code>APP_DEMO_ENABLED=true</code> 显式开启)。外部 HTTPS 入口设置 <code>APP_ORIGINS</code> 为实际浏览器来源、<code>APP_SESSION_COOKIE_SECURE=true</code>,保留同源的 <code>/ray-template/</code> 和 <code>/api/</code>。示例 Nginx 会覆盖转发头;如再接外层反代,应在 Nginx 的 real IP 设置中只信任实际上一跳,并验证转发头无法伪造限流地址。代理网段冲突时,修改 <code>APP_PROXY_NETWORK</code>(例如 <code>172.30.68</code>)。容器连接外部数据库或 Redis 时,用正确编码的 <code>APP_DATABASE_URL</code>、<code>APP_REDIS_URL</code> 指定目标;已有服务的本机开发走 <code>setup --external</code>。</p><h3 id="给部署者和-ai-的验收清单" tabindex="-1">给部署者和 AI 的验收清单 <a class="header-anchor" href="#给部署者和-ai-的验收清单" aria-label="Permalink to "给部署者和 AI 的验收清单""></a></h3><ol><li>先确认发行物含 <code>apps/server</code>、<code>deploy/compose.yaml</code> 和 <code>scripts/fullstack.mjs</code>。默认选容器方式;需要热更新时走本地开发;已有 PostgreSQL、Redis 时用专用数据库和 Redis 前缀。端口占用就换 <code>APP_PORT</code>(容器)或 <code>PORT</code>、<code>ADMIN_DEV_PORT</code>(本机开发);数据库和 Redis 映射分别用 <code>POSTGRES_PORT</code>、<code>REDIS_PORT</code>。</li><li>准备 PostgreSQL 迁移权限、Redis 连接以及服务端私有配置。部署副本共享同一个 <code>JWT_SECRET</code>(32 个随机字节的 base64url 编码),不同环境使用不同密钥。升级旧工作区可重跑 <code>setup</code> 或 <code>up</code> 补齐缺少的密钥;先备份 PostgreSQL,再应用迁移,旧令牌需重新登录。初始化配置中的密码只用于第一次建号。</li><li>验证 <code>GET /api/health/live</code>、<code>GET /api/health/ready</code> 均返回 200,匿名 <code>GET /api/admin/route-config</code> 返回 401。登录后检查用户管理、个人信息和路由管理;为测试账号设置密码,并确认只读账号不能调用写接口。空菜单账号仍应能打开个人信息。</li><li>如只有存活检查通过,用 Compose 的 <code>ps -a</code>、<code>logs initialize server</code> 检查迁移、初始化与连接。命令需使用 <code>--env-file apps/server/.env.local -f deploy/compose.yaml --profile app -p <项目名></code>。只看脱敏日志,不回显环境文件。若浏览器登录后仍返回 401,检查实际访问源、同源代理和 Cookie 的 Secure 设置。对外部署还要验证目标环境的 HTTPS、备份恢复与代理限流。</li></ol><p><code>node deploy/smoke.mjs</code> 使用独立的临时 Compose 项目检查迁移、构建、登录、路由、CORS、演示开关和代理限流,并只清理它创建的测试资源。</p><h3 id="生成分支与-release-资产" tabindex="-1">生成分支与 Release 资产 <a class="header-anchor" href="#生成分支与-release-资产" aria-label="Permalink to "生成分支与 Release 资产""></a></h3><p>维护者在 GitHub Actions 从 <code>main</code> 手动运行 <strong>Source distributions</strong>。默认只验证并上传本次运行的归档。要更新生成的 <code>frontend</code> 分支,选择 <code>sync_frontend</code>;该分支从主线导出,不用于独立开发。要给已有 Release 附加两个源码包及 SHA-256 校验文件,另行填写 <code>release_tag</code>。工作流检查标签版本及提交、验证归档,并保留已上传的同名资产。</p>`,44)])])}const u=s(o,[["render",t]]);export{k as __pageData,u as default};
|
||||
1
docs/assets/guide_distributions.md.CquuxHZi.lean.js
Normal file
1
docs/assets/guide_distributions.md.CquuxHZi.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as s,o as a,c as d,a3 as i}from"./chunks/framework.D8G7yXPy.js";const k=JSON.parse('{"title":"发行版本与快速启动","description":"","frontmatter":{},"headers":[],"relativePath":"guide/distributions.md","filePath":"guide/distributions.md"}'),o={name:"guide/distributions.md"};function t(c,e,p,l,n,r){return a(),d("div",null,[...e[0]||(e[0]=[i("",44)])])}const u=s(o,[["render",t]]);export{k as __pageData,u as default};
|
||||
@ -18,7 +18,7 @@ import{_ as i,o as a,c as n,a3 as t}from"./chunks/framework.D8G7yXPy.js";const o
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><p>默认行标识取 <code>id</code> 或 <code>key</code>。自定义标识字段时传 <code>rowKey</code>。示例中的列标题为中文,提供中英文界面时也要将列标题和查询提示加入语言包。</p><h2 id="接入菜单" tabindex="-1">接入菜单 <a class="header-anchor" href="#接入菜单" aria-label="Permalink to "接入菜单""></a></h2><p>先在 <code>apps/admin/src/router/config/views.ts</code> 的 <code>views</code> 中登记组件白名单:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">orders</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: { </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">load</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'@/views/orders'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">), </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Orders'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span></code></pre></div><p>在 Mock 初始路由 JSON <code>apps/admin/src/mocks/data/routes.json</code> 中加入以下记录,或由自己的路由接口返回:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><p>默认行标识取 <code>id</code> 或 <code>key</code>。自定义标识字段时传 <code>rowKey</code>。示例中的列标题为中文,提供中英文界面时也要将列标题和查询提示加入语言包。</p><h2 id="接入菜单" tabindex="-1">接入菜单 <a class="header-anchor" href="#接入菜单" aria-label="Permalink to "接入菜单""></a></h2><p>先在 <code>apps/admin/src/router/config/views.ts</code> 的 <code>views</code> 中登记组件白名单:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">orders</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: { </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">load</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'@/views/orders'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">), </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Orders'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span></code></pre></div><p>在 Mock 初始路由 JSON <code>packages/demo-data/src/routes.json</code> 中加入以下记录,或由自己的路由接口返回:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"/orders"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "name"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Orders"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "component"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"orders"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
@ -190,4 +190,4 @@ import{o as a,c as n,a3 as i,j as h,k,g as l}from"./chunks/framework.D8G7yXPy.js
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> contentWidth: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'fixed'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> contentMaxWidth: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1200</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> contentPadding: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">16</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><p>最大宽度范围是 640–2560px,间距为 0–48px。顶栏和页脚可固定或随内容滚动。旧设置补齐默认值,布局恢复默认只重置 <code>layoutConfig</code>。</p><h2 id="菜单图标" tabindex="-1">菜单图标 <a class="header-anchor" href="#菜单图标" aria-label="Permalink to "菜单图标""></a></h2><p>展开侧栏、移动端抽屉和顶部导航默认使用 20 px 的图标;折叠侧栏默认 22 px,方便只凭图形辨认菜单。线性图标跟随菜单状态和明暗主题变色。可在「偏好设置 → 菜单」调整「图标尺寸」与「折叠图标尺寸」,修改即时生效。</p><h2 id="替换布局区域" tabindex="-1">替换布局区域 <a class="header-anchor" href="#替换布局区域" aria-label="Permalink to "替换布局区域""></a></h2><p><code>RLayout</code> 提供 <code>header</code>、<code>sidebar</code>、<code>tabs</code>、<code>footer</code> 和 <code>default</code> 插槽。模式和显隐开关仍生效,例如顶部导航模式不会渲染侧栏。替换 <code>default</code> 内容时,需要自行接入所需的路由缓存和请求取消。</p><h2 id="状态放在哪里" tabindex="-1">状态放在哪里 <a class="header-anchor" href="#状态放在哪里" aria-label="Permalink to "状态放在哪里""></a></h2><table tabindex="0"><thead><tr><th>状态</th><th>入口</th><th>刷新后的行为</th></tr></thead><tbody><tr><td>加载、移动抽屉、内容最大化、重载</td><td><code>useRuntimeGetters</code> / <code>useRuntimeActions</code></td><td>运行态,不持久化</td></tr><tr><td>布局、主题、语言等偏好</td><td><code>useSettingGetters</code> / <code>useSettingActions</code></td><td>沿用设置缓存;旧值补默认配置</td></tr><tr><td>锁屏</td><td>锁屏 Store</td><td>保留历史布尔值格式和跨标签同步</td></tr></tbody></table><p>新增共享状态按职责放到 <code>apps/admin/src/store/modules</code>,对外用 Store hooks。持久化使用 <code>pick</code> / <code>omit</code> 选择字段;检查历史 key 和序列化格式再变更。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/layout/README.md" target="_blank" rel="noreferrer">布局说明与插槽</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/README.md" target="_blank" rel="noreferrer">状态实现与持久化</a></p><p>更细的状态字段与更新动作见 <a href="./../reference/store/setting.html">Setting Store</a>、<a href="./../reference/store/runtime.html">Runtime Store</a> 和 <a href="./../reference/hooks/layout.html">布局 Hooks</a>。</p><h2 id="最近访问和收藏" tabindex="-1">最近访问和收藏 <a class="header-anchor" href="#最近访问和收藏" aria-label="Permalink to "最近访问和收藏""></a></h2><p>桌面搜索支持 Ctrl/Command + K。输入页面名称查找,点击星标收藏;空关键词时显示收藏与最近访问,方向键、回车和 Tab 可操作。记录按会话用户 id 隔离,刷新后恢复;清空记录保留收藏。缓存只存菜单路径,展示时重新依据当前菜单和权限筛选,语言切换沿用当前翻译。窄屏继续使用导航抽屉。</p><p>内容页需要撑满工作区时,先复用布局的 <code>--layout-content-height</code>、<code>RTablePro autoHeight</code> 和 <code>--r-table-height</code>,以及 Naive UI 的 <code>NCard contentScrollable</code> / <code>NScrollbar</code>。父容器提供确定高度,Flex/Grid 子项设置 <code>min-block-size: 0</code> 后再承载内部滚动;单纯填充与滚动无需新增通用组件。用户管理页展示了左右独立滚动与窄屏上下排布。</p>`,16))]))}});export{r as __pageData,g as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><p>最大宽度范围是 640–2560px,间距为 0–48px。顶栏和页脚可固定或随内容滚动。旧设置补齐默认值,布局恢复默认只重置 <code>layoutConfig</code>。</p><h2 id="菜单图标" tabindex="-1">菜单图标 <a class="header-anchor" href="#菜单图标" aria-label="Permalink to "菜单图标""></a></h2><p>展开侧栏、移动端抽屉和顶部导航默认使用 20 px 的图标;折叠侧栏默认 22 px,方便只凭图形辨认菜单。线性图标跟随菜单状态和明暗主题变色。可在「偏好设置 → 菜单」调整「图标尺寸」与「折叠图标尺寸」,修改即时生效。</p><h2 id="替换布局区域" tabindex="-1">替换布局区域 <a class="header-anchor" href="#替换布局区域" aria-label="Permalink to "替换布局区域""></a></h2><p><code>RLayout</code> 提供 <code>header</code>、<code>sidebar</code>、<code>tabs</code>、<code>footer</code> 和 <code>default</code> 插槽。模式和显隐开关仍生效,例如顶部导航模式不会渲染侧栏。替换 <code>default</code> 内容时,需要自行接入所需的路由缓存和请求取消。</p><h2 id="状态放在哪里" tabindex="-1">状态放在哪里 <a class="header-anchor" href="#状态放在哪里" aria-label="Permalink to "状态放在哪里""></a></h2><table tabindex="0"><thead><tr><th>状态</th><th>入口</th><th>刷新后的行为</th></tr></thead><tbody><tr><td>加载、移动抽屉、内容最大化、重载</td><td><code>useRuntimeGetters</code> / <code>useRuntimeActions</code></td><td>运行态,不持久化</td></tr><tr><td>布局、主题、语言等偏好</td><td><code>useSettingGetters</code> / <code>useSettingActions</code></td><td>沿用设置缓存;旧值补默认配置</td></tr><tr><td>锁屏</td><td>锁屏 Store</td><td>保留历史布尔值格式和跨标签同步</td></tr></tbody></table><p>新增共享状态按职责放到 <code>apps/admin/src/store/modules</code>,对外用 Store hooks。持久化使用 <code>pick</code> / <code>omit</code> 选择字段;检查历史 key 和序列化格式再变更。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/layout/README.md" target="_blank" rel="noreferrer">布局说明与插槽</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/README.md" target="_blank" rel="noreferrer">状态实现与持久化</a></p><p>更细的状态字段与更新动作见 <a href="./../reference/store/setting.html">Setting Store</a>、<a href="./../reference/store/runtime.html">Runtime Store</a> 和 <a href="./../reference/hooks/layout.html">布局 Hooks</a>。</p><h2 id="最近访问和收藏" tabindex="-1">最近访问和收藏 <a class="header-anchor" href="#最近访问和收藏" aria-label="Permalink to "最近访问和收藏""></a></h2><p>桌面搜索支持 Ctrl/Command + K。输入页面名称查找,点击星标收藏;空关键词时显示收藏与最近访问,方向键、回车和 Tab 可操作。记录按会话用户 id 隔离,刷新后恢复;清空记录保留收藏。缓存只存菜单路径,展示时重新依据当前菜单和权限筛选,语言切换沿用当前翻译。窄屏继续使用导航抽屉。</p><p>内容页需要撑满工作区时,先复用布局的 <code>--layout-content-height</code>、<code>RTablePro autoHeight</code> 和 <code>--r-table-height</code>,以及 Naive UI 的 <code>NCard contentScrollable</code> / <code>NScrollbar</code>。父容器提供确定高度,Flex/Grid 子项设置 <code>min-block-size: 0</code> 后再承载内部滚动;单纯填充与滚动无需新增通用组件。用户管理页展示了左右独立滚动与窄屏上下排布。</p>`,16))]))}});export{r as __pageData,g as default};
|
||||
@ -166,11 +166,11 @@ import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> signal,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> cancelConfig: { cancel: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>默认取消器按 URL、方法、参数和请求体识别重复请求,默认布局在路由更新前取消受管理的请求。示例将信号交给 TablePro 管理,所以关闭模板的默认注入;否则默认取消器会替换调用方传入的 signal。后台任务禁用默认取消后,需要自行管理生命周期。</p><h2 id="配置与拦截器" tabindex="-1">配置与拦截器 <a class="header-anchor" href="#配置与拦截器" aria-label="Permalink to "配置与拦截器""></a></h2><ul><li><code>apps/admin/src/app-config/request-config.ts</code>:统一修改 <code>baseURL</code>、超时和默认 headers。</li><li><code>apps/admin/src/axios/axios-interceptor/{request,response}/provider.ts</code>:登记插件;请求头、鉴权响应等放入对应的 <code>plugins</code>。</li><li><code>useRequest</code> 包装同一请求实例,放在有效的 Vue effect 作用域内使用。</li></ul><h2 id="从演示切到真实服务" tabindex="-1">从演示切到真实服务 <a class="header-anchor" href="#从演示切到真实服务" aria-label="Permalink to "从演示切到真实服务""></a></h2><p>开发、生产预览和 GitHub Pages 共用 MSW HTTP Mock。登录、用户、路由、人员表格、路由示例详情、搜索业务选项、图表与请求示例都通过 API 层发送请求,在线演示由应用 base 下的 Service Worker 响应;不再在生产环境直接调用本地数据函数。选择本地筛选的表格示例,也先通过接口取得数据,再由组件完成本地排序、分页与筛选。请求/响应类型与运行时 Schema 统一放在 <code>@ray-template/api-contracts</code>,HTTP 传输能力由 <code>@ray-template/http</code> 提供。</p><p>设置 <code>VITE_API_MOCK=false</code> 和 <code>VITE_API_BASE_URL</code> 后,请求直达自己的服务端。完整请求/响应结构、错误码、会话、权限码及可下载 OpenAPI 见<a href="./backend.html">服务端接入指南</a>。Mock 持久化仅属于当前浏览器,多用户共享数据和正式会话由真实后端负责。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/axios/instance.ts" target="_blank" rel="noreferrer">请求实例</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/api/admin/index.ts" target="_blank" rel="noreferrer">业务 API</a></p><h2 id="userequest-与手动执行" tabindex="-1">useRequest 与手动执行 <a class="header-anchor" href="#userequest-与手动执行" aria-label="Permalink to "useRequest 与手动执行""></a></h2><p><code>useRequest<Response>(fetchOptions, options?)</code> 从 <code>@/axios</code> 导入,使用模板 Axios 实例执行同一份配置。<code>options</code> 传给 vue-hooks-plus,例如 <code>manual</code>、成功和失败回调。返回的数据、错误、加载状态与运行方法来自上游 Hook。应用在 <code>setup</code> 或有效 effect scope 内创建它。</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { useRequest } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@/axios'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>默认取消器按 URL、方法、参数和请求体识别重复请求,默认布局在路由更新前取消受管理的请求。示例将信号交给 TablePro 管理,所以关闭模板的默认注入;否则默认取消器会替换调用方传入的 signal。后台任务禁用默认取消后,需要自行管理生命周期。</p><h2 id="配置与拦截器" tabindex="-1">配置与拦截器 <a class="header-anchor" href="#配置与拦截器" aria-label="Permalink to "配置与拦截器""></a></h2><ul><li><code>apps/admin/src/app-config/request-config.ts</code>:统一修改 <code>baseURL</code>、超时和默认 headers。</li><li><code>apps/admin/src/axios/axios-interceptor/{request,response}/provider.ts</code>:登记插件;请求头、鉴权响应等放入对应的 <code>plugins</code>。</li><li><code>useRequest</code> 包装同一请求实例,放在有效的 Vue effect 作用域内使用。</li></ul><h2 id="从演示切到真实服务" tabindex="-1">从演示切到真实服务 <a class="header-anchor" href="#从演示切到真实服务" aria-label="Permalink to "从演示切到真实服务""></a></h2><p>开发、生产预览和 GitHub Pages 共用 MSW HTTP Mock。登录、用户、路由、人员表格、路由示例详情、搜索业务选项、图表与请求示例都通过 API 层发送请求,在线演示由应用 base 下的 Service Worker 响应;不再在生产环境直接调用本地数据函数。选择本地筛选的表格示例,也先通过接口取得数据,再由组件完成本地排序、分页与筛选。请求/响应类型与运行时 Schema 统一放在 <code>@ray-template/api-contracts</code>,HTTP 传输能力由 <code>@ray-template/http</code> 提供。</p><p>设置 <code>VITE_API_MOCK=false</code> 和 <code>VITE_API_BASE_URL</code> 后,请求直达自己的服务端。完整请求/响应结构、错误码、会话、权限码及可下载 OpenAPI 见<a href="./backend.html">服务端接入指南</a>。Mock 持久化仅属于当前浏览器,多用户共享数据和正式会话由真实后端负责。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/axios/instance.ts" target="_blank" rel="noreferrer">请求实例</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/api/admin/index.ts" target="_blank" rel="noreferrer">业务 API</a></p><h2 id="userequest-与手动执行" tabindex="-1">useRequest 与手动执行 <a class="header-anchor" href="#userequest-与手动执行" aria-label="Permalink to "useRequest 与手动执行""></a></h2><p><code>useRequest<Response>(fetchOptions, options?)</code> 从 <code>@/axios</code> 导入,使用模板 Axios 实例执行同一份配置。<code>options</code> 传给 vue-hooks-plus,例如 <code>manual</code>、成功和失败回调。返回的数据、错误、加载状态与运行方法来自上游 Hook。应用在 <code>setup</code> 或有效 effect scope 内创建它。</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { useRequest } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@/axios'</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useOrderSummary</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useRequest</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><{ </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">total</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }>(</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { url: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'/api/orders/summary'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, method: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'get'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { manual: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>调用 <code>run()</code> 触发手动加载。这个包装的请求函数从 <code>fetchOptions</code> 读取配置,不会把 <code>run(...)</code> 参数自动映射成请求体或 query;需要动态 service 时用同入口导出的 <code>useHookPlusRequest(service, options?)</code>,在 service 中调用 <code>request</code>。错误提示由业务配置或响应拦截器负责,当前默认拦截器不消费 <code>responseSuccessMessage</code> / <code>responseErrorMessage</code> 两个类型字段。</p><p>默认仅向已配置的 API 基址注入 <code>Authorization: Bearer <token></code>,不覆盖调用方提供的认证头。模板 Axios 实例用来请求自己的业务接口;第三方地址使用明确配置的独立客户端。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/axios/index.ts" target="_blank" rel="noreferrer">请求 Hook</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/http/src/types.ts" target="_blank" rel="noreferrer">请求配置类型</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/axios/axios-interceptor/request/plugins/request-headers.ts" target="_blank" rel="noreferrer">头注入实现</a></p>`,16))]))}});export{r as __pageData,d as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>调用 <code>run()</code> 触发手动加载。这个包装的请求函数从 <code>fetchOptions</code> 读取配置,不会把 <code>run(...)</code> 参数自动映射成请求体或 query;需要动态 service 时用同入口导出的 <code>useHookPlusRequest(service, options?)</code>,在 service 中调用 <code>request</code>。错误提示由业务配置或响应拦截器负责,当前默认拦截器不消费 <code>responseSuccessMessage</code> / <code>responseErrorMessage</code> 两个类型字段。</p><p>默认仅向已配置的 API 基址注入 <code>Authorization: Bearer <token></code>,不覆盖调用方提供的认证头。模板 Axios 实例用来请求自己的业务接口;第三方地址使用明确配置的独立客户端。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/axios/index.ts" target="_blank" rel="noreferrer">请求 Hook</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/http/src/types.ts" target="_blank" rel="noreferrer">请求配置类型</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/axios/axios-interceptor/request/plugins/request-headers.ts" target="_blank" rel="noreferrer">头注入实现</a></p>`,16))]))}});export{r as __pageData,d as default};
|
||||
75
docs/assets/guide_routing.md.DBR7uJLR.js
Normal file
75
docs/assets/guide_routing.md.DBR7uJLR.js
Normal file
File diff suppressed because one or more lines are too long
2
docs/assets/guide_routing.md.DBR7uJLR.lean.js
Normal file
2
docs/assets/guide_routing.md.DBR7uJLR.lean.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,8 +1,8 @@
|
||||
import{_ as s,o as i,c as e,a3 as t}from"./chunks/framework.D8G7yXPy.js";const c=JSON.parse('{"title":"快速开始","description":"","frontmatter":{},"headers":[],"relativePath":"guide/start.md","filePath":"guide/start.md"}'),n={name:"guide/start.md"};function l(p,a,h,r,k,o){return i(),e("div",null,[...a[0]||(a[0]=[t(`<h1 id="快速开始" tabindex="-1">快速开始 <a class="header-anchor" href="#快速开始" aria-label="Permalink to "快速开始""></a></h1><p>本文使用 Ray Template v6。v5 项目请先查看<a href="./../migration.html">版本分界</a>。</p><h2 id="启动工作台" tabindex="-1">启动工作台 <a class="header-anchor" href="#启动工作台" aria-label="Permalink to "启动工作台""></a></h2><p>准备 Node.js 26.13.0 和 pnpm 12.16.1。以下以 nvm 为例:</p><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clone</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/XiaoDaiGua-Ray/ray-template.git</span></span>
|
||||
import{_ as s,o as i,c as t,a3 as e}from"./chunks/framework.D8G7yXPy.js";const c=JSON.parse('{"title":"快速开始","description":"","frontmatter":{},"headers":[],"relativePath":"guide/start.md","filePath":"guide/start.md"}'),n={name:"guide/start.md"};function l(p,a,h,r,o,k){return i(),t("div",null,[...a[0]||(a[0]=[e(`<h1 id="快速开始" tabindex="-1">快速开始 <a class="header-anchor" href="#快速开始" aria-label="Permalink to "快速开始""></a></h1><p>本文使用 Ray Template v6。v5 项目请先查看<a href="./../migration.html">版本分界</a>。</p><p>可以选择独立的纯前端源码发行包;完整源码还提供可选的后端接入流程,见<a href="./distributions.html">发行版本与快速启动</a>。</p><h2 id="启动工作台" tabindex="-1">启动工作台 <a class="header-anchor" href="#启动工作台" aria-label="Permalink to "启动工作台""></a></h2><p>准备 Node.js 26.13.0 和 pnpm 12.16.1。以下以 nvm 为例:</p><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clone</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/XiaoDaiGua-Ray/ray-template.git</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ray-template</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">nvm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">nvm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> use</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">npm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --global</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pnpm@12.16.1</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pnpm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --frozen-lockfile</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pnpm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> env:check</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pnpm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dev</span></span></code></pre></div><p>打开 <a href="http://127.0.0.1:9527/ray-template/" target="_blank" rel="noreferrer">http://127.0.0.1:9527/ray-template/</a>,如果端口被占用,以 Vite 输出的地址为准。使用预填表单登录,再打开「表格 → 远端查询与分页」或「布局实验室」。也可直接体验<a href="https://xiaodaigua-ray.github.io/ray-template/" target="_blank" rel="noreferrer">在线演示</a>。</p><div class="warning custom-block"><p class="custom-block-title">演示与真实业务</p><p>预填表单、会话和 Mock 用于展示前端工作流。对外部署真实业务前,接入自己的认证、服务端权限校验和 API。</p></div><h2 id="启动文档" tabindex="-1">启动文档 <a class="header-anchor" href="#启动文档" aria-label="Permalink to "启动文档""></a></h2><p>在同一个工作区运行 <code>pnpm docs:dev</code>。按终端地址打开 <code>/ray-template/docs/</code>,可以直接操作 TablePro、条码和布局示例。</p><h2 id="相关文档" tabindex="-1">相关文档 <a class="header-anchor" href="#相关文档" aria-label="Permalink to "相关文档""></a></h2><p><a href="./first-page.html">第一个业务页面</a> · <a href="./../migration.html">v5 与 v6 的版本分界</a> · <a href="./tooling.html">工程检查与部署</a></p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/package.json" target="_blank" rel="noreferrer">运行时与依赖清单</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/docs/architecture.md" target="_blank" rel="noreferrer">项目目录与启动链路</a></p>`,12)])])}const F=s(n,[["render",l]]);export{c as __pageData,F as default};
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pnpm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dev</span></span></code></pre></div><p>打开 <a href="http://127.0.0.1:9527/ray-template/" target="_blank" rel="noreferrer">http://127.0.0.1:9527/ray-template/</a>,如果端口被占用,以 Vite 输出的地址为准。使用预填表单登录,再打开「表格 → 远端查询与分页」或「布局实验室」。也可直接体验<a href="https://xiaodaigua-ray.github.io/ray-template/" target="_blank" rel="noreferrer">在线演示</a>。</p><div class="warning custom-block"><p class="custom-block-title">演示与真实业务</p><p>预填表单、会话和 Mock 用于展示前端工作流。对外部署真实业务前,接入自己的认证、服务端权限校验和 API。</p></div><h2 id="启动文档" tabindex="-1">启动文档 <a class="header-anchor" href="#启动文档" aria-label="Permalink to "启动文档""></a></h2><p>在同一个工作区运行 <code>pnpm docs:dev</code>。按终端地址打开 <code>/ray-template/docs/</code>,可以直接操作 TablePro、条码和布局示例。</p><h2 id="相关文档" tabindex="-1">相关文档 <a class="header-anchor" href="#相关文档" aria-label="Permalink to "相关文档""></a></h2><p><a href="./first-page.html">第一个业务页面</a> · <a href="./../migration.html">v5 与 v6 的版本分界</a> · <a href="./tooling.html">工程检查与部署</a></p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/package.json" target="_blank" rel="noreferrer">运行时与依赖清单</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/docs/architecture.md" target="_blank" rel="noreferrer">项目目录与启动链路</a></p>`,13)])])}const F=s(n,[["render",l]]);export{c as __pageData,F as default};
|
||||
@ -1 +1 @@
|
||||
import{_ as s,o as i,c as e,a3 as t}from"./chunks/framework.D8G7yXPy.js";const c=JSON.parse('{"title":"快速开始","description":"","frontmatter":{},"headers":[],"relativePath":"guide/start.md","filePath":"guide/start.md"}'),n={name:"guide/start.md"};function l(p,a,h,r,k,o){return i(),e("div",null,[...a[0]||(a[0]=[t("",12)])])}const F=s(n,[["render",l]]);export{c as __pageData,F as default};
|
||||
import{_ as s,o as i,c as t,a3 as e}from"./chunks/framework.D8G7yXPy.js";const c=JSON.parse('{"title":"快速开始","description":"","frontmatter":{},"headers":[],"relativePath":"guide/start.md","filePath":"guide/start.md"}'),n={name:"guide/start.md"};function l(p,a,h,r,o,k){return i(),t("div",null,[...a[0]||(a[0]=[e("",13)])])}const F=s(n,[["render",l]]);export{c as __pageData,F as default};
|
||||
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{d as y,o as i,c as o,j as e,t as l,k as s,g as r,a3 as p,F as d,B as m,E as u}from"./chunks/framework.D8G7yXPy.js";import{v as f}from"./chunks/theme.jIEdD8pU.js";const v={class:"ray-home"},g={class:"ray-hero"},b={class:"ray-lead"},M={class:"ray-actions"},w=["href"],k=["href"],x={class:"ray-map","aria-labelledby":"ray-map-title"},T=["href"],B={class:"ray-paths","aria-labelledby":"ray-paths-title"},z=["href","aria-labelledby","aria-describedby"],P={class:"ray-path-icon",viewBox:"0 0 24 24","aria-hidden":"true"},S=["d"],A=["id"],N=["id"],R={class:"ray-showcase","aria-labelledby":"ray-showcase-title"},V={class:"ray-showcase-links"},$=["href"],C=["href"],H=["src"],D=y({__name:"RayHome",setup(_){const n=[{title:"Ray Admin",name:"apps/admin",href:"/guide/layout.html"},{title:"共享包",name:"packages",href:"/guide/architecture.html"},{title:"页内交互",name:"apps/docs",href:"/reference/table-pro.html"}],c=[{title:"第一个业务页面",summary:"添加订单列表、路由和菜单。",href:"/guide/first-page.html",icon:"M6 3.5h8l4 4v13H6z M14 3.5v4h4 M9 12h6 M9 16h6"},{title:"组件与 Hooks",summary:"查找表单、弹窗和常用组合式函数。",href:"/reference/components.html",icon:"M3.5 3.5h7v7h-7z M13.5 3.5h7v7h-7z M3.5 13.5h7v7h-7z M13.5 13.5h7v7h-7z"},{title:"构建与部署",summary:"检查项目并部署到站点子路径。",href:"/guide/tooling.html",icon:"M4 8.5h16v11H4z M4 8.5l3-4h10l3 4 M12 16v-4 M10 14l2-2 2 2"}];return(j,t)=>(i(),o("main",v,[e("header",g,[e("div",null,[t[0]||(t[0]=e("h1",null,"Ray Template",-1)),e("p",b," v"+l(s(f))+" 将 Ray Admin、官网文档和共享包放在同一个工作区。可在文档里直接体验真实组件。 ",1),e("div",M,[e("a",{class:"ray-start",href:s(r)("/guide/start.html")},"快速开始",8,w),e("a",{class:"ray-migrate",href:s(r)("/migration.html")},"v5 与 v6 的版本分界",8,k)])]),e("section",x,[t[1]||(t[1]=p('<h2 id="ray-map-title">v6 工作区</h2><svg class="ray-orbit" viewBox="0 0 200 200" aria-hidden="true"><circle cx="100" cy="100" r="65"></circle><circle cx="100" cy="100" r="89" stroke-dasharray="3 6"></circle><path d="M100 0v200M0 100h200M29 29l142 142m0-142L29 171"></path><circle cx="100" cy="100" r="7" fill="currentColor"></circle></svg>',2)),e("ul",null,[(i(),o(d,null,m(n,a=>e("li",{key:a.href},[e("a",{href:s(r)(a.href)},[e("span",null,l(a.title),1),e("code",null,l(a.name),1)],8,T)])),64))])])]),e("section",B,[t[3]||(t[3]=e("h2",{id:"ray-paths-title"},"常用文档",-1)),e("ul",null,[(i(),o(d,null,m(c,(a,h)=>e("li",{key:a.href},[e("a",{class:"ray-path",href:s(r)(a.href),"aria-labelledby":`ray-path-title-${h}`,"aria-describedby":`ray-path-summary-${h}`},[e("article",null,[(i(),o("svg",P,[e("path",{d:a.icon},null,8,S)])),e("h3",{id:`ray-path-title-${h}`},l(a.title),9,A),e("p",{id:`ray-path-summary-${h}`},l(a.summary),9,N),t[2]||(t[2]=e("svg",{class:"ray-path-arrow",viewBox:"0 0 24 24","aria-hidden":"true"},[e("path",{d:"M5 12h13m-5-5 5 5-5 5"})],-1))])],8,z)])),64))])]),e("section",R,[e("div",null,[t[4]||(t[4]=e("h2",{id:"ray-showcase-title"},"TablePro 自适应高度",-1)),t[5]||(t[5]=e("p",null,"表格填满可用高度,数据在表内滚动。",-1)),e("div",V,[e("a",{href:s(r)("/reference/table-pro.html")},"TablePro 用法",8,$),e("a",{href:s(r)("/reference/table-pro-examples.html#自适应高度与虚拟滚动")},"在线示例",8,C)])]),e("img",{src:s(r)("/assets/tablepro-auto-height.png"),width:"1440",height:"820",loading:"lazy",alt:"TablePro 自适应高度示例,虚拟滚动已开启,分页位于表格底部"},null,8,H)])]))}}),L=JSON.parse('{"title":"开发者文档","description":"","frontmatter":{"title":"开发者文档","layout":"home","markdownStyles":false},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),E={name:"index.md"},O=Object.assign(E,{setup(_){return(n,c)=>(i(),o("div",null,[u(D)]))}});export{L as __pageData,O as default};
|
||||
import{d as y,o as i,c as o,j as e,t as l,k as s,g as r,a3 as p,F as d,B as m,E as u}from"./chunks/framework.D8G7yXPy.js";import{v as f}from"./chunks/theme.D3rTNXiF.js";const v={class:"ray-home"},g={class:"ray-hero"},b={class:"ray-lead"},M={class:"ray-actions"},w=["href"],k=["href"],x={class:"ray-map","aria-labelledby":"ray-map-title"},T=["href"],B={class:"ray-paths","aria-labelledby":"ray-paths-title"},z=["href","aria-labelledby","aria-describedby"],P={class:"ray-path-icon",viewBox:"0 0 24 24","aria-hidden":"true"},S=["d"],A=["id"],N=["id"],R={class:"ray-showcase","aria-labelledby":"ray-showcase-title"},V={class:"ray-showcase-links"},$=["href"],C=["href"],H=["src"],D=y({__name:"RayHome",setup(_){const n=[{title:"Ray Admin",name:"apps/admin",href:"/guide/layout.html"},{title:"共享包",name:"packages",href:"/guide/architecture.html"},{title:"页内交互",name:"apps/docs",href:"/reference/table-pro.html"}],c=[{title:"第一个业务页面",summary:"添加订单列表、路由和菜单。",href:"/guide/first-page.html",icon:"M6 3.5h8l4 4v13H6z M14 3.5v4h4 M9 12h6 M9 16h6"},{title:"组件与 Hooks",summary:"查找表单、弹窗和常用组合式函数。",href:"/reference/components.html",icon:"M3.5 3.5h7v7h-7z M13.5 3.5h7v7h-7z M3.5 13.5h7v7h-7z M13.5 13.5h7v7h-7z"},{title:"构建与部署",summary:"检查项目并部署到站点子路径。",href:"/guide/tooling.html",icon:"M4 8.5h16v11H4z M4 8.5l3-4h10l3 4 M12 16v-4 M10 14l2-2 2 2"}];return(j,t)=>(i(),o("main",v,[e("header",g,[e("div",null,[t[0]||(t[0]=e("h1",null,"Ray Template",-1)),e("p",b," v"+l(s(f))+" 将 Ray Admin、官网文档和共享包放在同一个工作区。可在文档里直接体验真实组件。 ",1),e("div",M,[e("a",{class:"ray-start",href:s(r)("/guide/start.html")},"快速开始",8,w),e("a",{class:"ray-migrate",href:s(r)("/migration.html")},"v5 与 v6 的版本分界",8,k)])]),e("section",x,[t[1]||(t[1]=p('<h2 id="ray-map-title">v6 工作区</h2><svg class="ray-orbit" viewBox="0 0 200 200" aria-hidden="true"><circle cx="100" cy="100" r="65"></circle><circle cx="100" cy="100" r="89" stroke-dasharray="3 6"></circle><path d="M100 0v200M0 100h200M29 29l142 142m0-142L29 171"></path><circle cx="100" cy="100" r="7" fill="currentColor"></circle></svg>',2)),e("ul",null,[(i(),o(d,null,m(n,a=>e("li",{key:a.href},[e("a",{href:s(r)(a.href)},[e("span",null,l(a.title),1),e("code",null,l(a.name),1)],8,T)])),64))])])]),e("section",B,[t[3]||(t[3]=e("h2",{id:"ray-paths-title"},"常用文档",-1)),e("ul",null,[(i(),o(d,null,m(c,(a,h)=>e("li",{key:a.href},[e("a",{class:"ray-path",href:s(r)(a.href),"aria-labelledby":`ray-path-title-${h}`,"aria-describedby":`ray-path-summary-${h}`},[e("article",null,[(i(),o("svg",P,[e("path",{d:a.icon},null,8,S)])),e("h3",{id:`ray-path-title-${h}`},l(a.title),9,A),e("p",{id:`ray-path-summary-${h}`},l(a.summary),9,N),t[2]||(t[2]=e("svg",{class:"ray-path-arrow",viewBox:"0 0 24 24","aria-hidden":"true"},[e("path",{d:"M5 12h13m-5-5 5 5-5 5"})],-1))])],8,z)])),64))])]),e("section",R,[e("div",null,[t[4]||(t[4]=e("h2",{id:"ray-showcase-title"},"TablePro 自适应高度",-1)),t[5]||(t[5]=e("p",null,"表格填满可用高度,数据在表内滚动。",-1)),e("div",V,[e("a",{href:s(r)("/reference/table-pro.html")},"TablePro 用法",8,$),e("a",{href:s(r)("/reference/table-pro-examples.html#自适应高度与虚拟滚动")},"在线示例",8,C)])]),e("img",{src:s(r)("/assets/tablepro-auto-height.png"),width:"1440",height:"820",loading:"lazy",alt:"TablePro 自适应高度示例,虚拟滚动已开启,分页位于表格底部"},null,8,H)])]))}}),L=JSON.parse('{"title":"开发者文档","description":"","frontmatter":{"title":"开发者文档","layout":"home","markdownStyles":false},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),E={name:"index.md"},O=Object.assign(E,{setup(_){return(n,c)=>(i(),o("div",null,[u(D)]))}});export{L as __pageData,O as default};
|
||||
@ -1 +1 @@
|
||||
import{d as y,o as i,c as o,j as e,t as l,k as s,g as r,a3 as p,F as d,B as m,E as u}from"./chunks/framework.D8G7yXPy.js";import{v as f}from"./chunks/theme.jIEdD8pU.js";const v={class:"ray-home"},g={class:"ray-hero"},b={class:"ray-lead"},M={class:"ray-actions"},w=["href"],k=["href"],x={class:"ray-map","aria-labelledby":"ray-map-title"},T=["href"],B={class:"ray-paths","aria-labelledby":"ray-paths-title"},z=["href","aria-labelledby","aria-describedby"],P={class:"ray-path-icon",viewBox:"0 0 24 24","aria-hidden":"true"},S=["d"],A=["id"],N=["id"],R={class:"ray-showcase","aria-labelledby":"ray-showcase-title"},V={class:"ray-showcase-links"},$=["href"],C=["href"],H=["src"],D=y({__name:"RayHome",setup(_){const n=[{title:"Ray Admin",name:"apps/admin",href:"/guide/layout.html"},{title:"共享包",name:"packages",href:"/guide/architecture.html"},{title:"页内交互",name:"apps/docs",href:"/reference/table-pro.html"}],c=[{title:"第一个业务页面",summary:"添加订单列表、路由和菜单。",href:"/guide/first-page.html",icon:"M6 3.5h8l4 4v13H6z M14 3.5v4h4 M9 12h6 M9 16h6"},{title:"组件与 Hooks",summary:"查找表单、弹窗和常用组合式函数。",href:"/reference/components.html",icon:"M3.5 3.5h7v7h-7z M13.5 3.5h7v7h-7z M3.5 13.5h7v7h-7z M13.5 13.5h7v7h-7z"},{title:"构建与部署",summary:"检查项目并部署到站点子路径。",href:"/guide/tooling.html",icon:"M4 8.5h16v11H4z M4 8.5l3-4h10l3 4 M12 16v-4 M10 14l2-2 2 2"}];return(j,t)=>(i(),o("main",v,[e("header",g,[e("div",null,[t[0]||(t[0]=e("h1",null,"Ray Template",-1)),e("p",b," v"+l(s(f))+" 将 Ray Admin、官网文档和共享包放在同一个工作区。可在文档里直接体验真实组件。 ",1),e("div",M,[e("a",{class:"ray-start",href:s(r)("/guide/start.html")},"快速开始",8,w),e("a",{class:"ray-migrate",href:s(r)("/migration.html")},"v5 与 v6 的版本分界",8,k)])]),e("section",x,[t[1]||(t[1]=p("",2)),e("ul",null,[(i(),o(d,null,m(n,a=>e("li",{key:a.href},[e("a",{href:s(r)(a.href)},[e("span",null,l(a.title),1),e("code",null,l(a.name),1)],8,T)])),64))])])]),e("section",B,[t[3]||(t[3]=e("h2",{id:"ray-paths-title"},"常用文档",-1)),e("ul",null,[(i(),o(d,null,m(c,(a,h)=>e("li",{key:a.href},[e("a",{class:"ray-path",href:s(r)(a.href),"aria-labelledby":`ray-path-title-${h}`,"aria-describedby":`ray-path-summary-${h}`},[e("article",null,[(i(),o("svg",P,[e("path",{d:a.icon},null,8,S)])),e("h3",{id:`ray-path-title-${h}`},l(a.title),9,A),e("p",{id:`ray-path-summary-${h}`},l(a.summary),9,N),t[2]||(t[2]=e("svg",{class:"ray-path-arrow",viewBox:"0 0 24 24","aria-hidden":"true"},[e("path",{d:"M5 12h13m-5-5 5 5-5 5"})],-1))])],8,z)])),64))])]),e("section",R,[e("div",null,[t[4]||(t[4]=e("h2",{id:"ray-showcase-title"},"TablePro 自适应高度",-1)),t[5]||(t[5]=e("p",null,"表格填满可用高度,数据在表内滚动。",-1)),e("div",V,[e("a",{href:s(r)("/reference/table-pro.html")},"TablePro 用法",8,$),e("a",{href:s(r)("/reference/table-pro-examples.html#自适应高度与虚拟滚动")},"在线示例",8,C)])]),e("img",{src:s(r)("/assets/tablepro-auto-height.png"),width:"1440",height:"820",loading:"lazy",alt:"TablePro 自适应高度示例,虚拟滚动已开启,分页位于表格底部"},null,8,H)])]))}}),L=JSON.parse('{"title":"开发者文档","description":"","frontmatter":{"title":"开发者文档","layout":"home","markdownStyles":false},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),E={name:"index.md"},O=Object.assign(E,{setup(_){return(n,c)=>(i(),o("div",null,[u(D)]))}});export{L as __pageData,O as default};
|
||||
import{d as y,o as i,c as o,j as e,t as l,k as s,g as r,a3 as p,F as d,B as m,E as u}from"./chunks/framework.D8G7yXPy.js";import{v as f}from"./chunks/theme.D3rTNXiF.js";const v={class:"ray-home"},g={class:"ray-hero"},b={class:"ray-lead"},M={class:"ray-actions"},w=["href"],k=["href"],x={class:"ray-map","aria-labelledby":"ray-map-title"},T=["href"],B={class:"ray-paths","aria-labelledby":"ray-paths-title"},z=["href","aria-labelledby","aria-describedby"],P={class:"ray-path-icon",viewBox:"0 0 24 24","aria-hidden":"true"},S=["d"],A=["id"],N=["id"],R={class:"ray-showcase","aria-labelledby":"ray-showcase-title"},V={class:"ray-showcase-links"},$=["href"],C=["href"],H=["src"],D=y({__name:"RayHome",setup(_){const n=[{title:"Ray Admin",name:"apps/admin",href:"/guide/layout.html"},{title:"共享包",name:"packages",href:"/guide/architecture.html"},{title:"页内交互",name:"apps/docs",href:"/reference/table-pro.html"}],c=[{title:"第一个业务页面",summary:"添加订单列表、路由和菜单。",href:"/guide/first-page.html",icon:"M6 3.5h8l4 4v13H6z M14 3.5v4h4 M9 12h6 M9 16h6"},{title:"组件与 Hooks",summary:"查找表单、弹窗和常用组合式函数。",href:"/reference/components.html",icon:"M3.5 3.5h7v7h-7z M13.5 3.5h7v7h-7z M3.5 13.5h7v7h-7z M13.5 13.5h7v7h-7z"},{title:"构建与部署",summary:"检查项目并部署到站点子路径。",href:"/guide/tooling.html",icon:"M4 8.5h16v11H4z M4 8.5l3-4h10l3 4 M12 16v-4 M10 14l2-2 2 2"}];return(j,t)=>(i(),o("main",v,[e("header",g,[e("div",null,[t[0]||(t[0]=e("h1",null,"Ray Template",-1)),e("p",b," v"+l(s(f))+" 将 Ray Admin、官网文档和共享包放在同一个工作区。可在文档里直接体验真实组件。 ",1),e("div",M,[e("a",{class:"ray-start",href:s(r)("/guide/start.html")},"快速开始",8,w),e("a",{class:"ray-migrate",href:s(r)("/migration.html")},"v5 与 v6 的版本分界",8,k)])]),e("section",x,[t[1]||(t[1]=p("",2)),e("ul",null,[(i(),o(d,null,m(n,a=>e("li",{key:a.href},[e("a",{href:s(r)(a.href)},[e("span",null,l(a.title),1),e("code",null,l(a.name),1)],8,T)])),64))])])]),e("section",B,[t[3]||(t[3]=e("h2",{id:"ray-paths-title"},"常用文档",-1)),e("ul",null,[(i(),o(d,null,m(c,(a,h)=>e("li",{key:a.href},[e("a",{class:"ray-path",href:s(r)(a.href),"aria-labelledby":`ray-path-title-${h}`,"aria-describedby":`ray-path-summary-${h}`},[e("article",null,[(i(),o("svg",P,[e("path",{d:a.icon},null,8,S)])),e("h3",{id:`ray-path-title-${h}`},l(a.title),9,A),e("p",{id:`ray-path-summary-${h}`},l(a.summary),9,N),t[2]||(t[2]=e("svg",{class:"ray-path-arrow",viewBox:"0 0 24 24","aria-hidden":"true"},[e("path",{d:"M5 12h13m-5-5 5 5-5 5"})],-1))])],8,z)])),64))])]),e("section",R,[e("div",null,[t[4]||(t[4]=e("h2",{id:"ray-showcase-title"},"TablePro 自适应高度",-1)),t[5]||(t[5]=e("p",null,"表格填满可用高度,数据在表内滚动。",-1)),e("div",V,[e("a",{href:s(r)("/reference/table-pro.html")},"TablePro 用法",8,$),e("a",{href:s(r)("/reference/table-pro-examples.html#自适应高度与虚拟滚动")},"在线示例",8,C)])]),e("img",{src:s(r)("/assets/tablepro-auto-height.png"),width:"1440",height:"820",loading:"lazy",alt:"TablePro 自适应高度示例,虚拟滚动已开启,分页位于表格底部"},null,8,H)])]))}}),L=JSON.parse('{"title":"开发者文档","description":"","frontmatter":{"title":"开发者文档","layout":"home","markdownStyles":false},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),E={name:"index.md"},O=Object.assign(E,{setup(_){return(n,c)=>(i(),o("div",null,[u(D)]))}});export{L as __pageData,O as default};
|
||||
@ -1 +1 @@
|
||||
import{_ as e,o,c as d,a3 as r}from"./chunks/framework.D8G7yXPy.js";const f=JSON.parse('{"title":"组件","description":"","frontmatter":{},"headers":[],"relativePath":"reference/components.md","filePath":"reference/components.md"}'),a={name:"reference/components.md"};function c(n,t,p,s,m,l){return o(),d("div",null,[...t[0]||(t[0]=[r('<h1 id="组件" tabindex="-1">组件 <a class="header-anchor" href="#组件" aria-label="Permalink to "组件""></a></h1><p>通用组件从 <code>@ray-template/ui</code> 导入,也可用 <code>/table-pro</code>、<code>/barcode</code> 等子路径按需加载。Ray Admin 内可以使用 <code>@/components</code>。路由过渡位于 <code>@ray-template/admin-shell</code>,由应用接入当前路由和缓存状态。许多组件包装 Naive UI:本文列出模板添加、改写或消费的属性、插槽和事件,原始控件的其余能力以锁定依赖的类型为准。</p><table tabindex="0"><thead><tr><th>组件</th><th>Props 类型</th><th>主要用途</th></tr></thead><tbody><tr><td><a href="./table-pro.html">RTablePro</a></td><td><code>TableProProps</code></td><td>纯表格、远端查询、自适应高度、列设置、导出及可选打印</td></tr><tr><td><a href="./components/form.html">RForm</a></td><td><code>FormProps</code></td><td>表单加载、校验、重置和键盘提交</td></tr><tr><td><a href="./components/modal.html">RModal</a></td><td><code>ModalProps</code></td><td>受控弹窗、预设宽度和全屏卡片</td></tr><tr><td><a href="./components/chart.html">RChart</a></td><td><code>ChartProps</code></td><td>ECharts 初始化、主题和导出</td></tr><tr><td><a href="./components/flow.html">RFlow</a></td><td><code>FlowProps</code></td><td>LogicFlow 流程图与只读切换</td></tr><tr><td><a href="./components/collapse-grid.html">RCollapseGrid</a></td><td><code>CollapseGridProps</code></td><td>可折叠筛选区及操作列</td></tr><tr><td><a href="./components/segment.html">RSegment</a></td><td><code>SegmentProps</code></td><td>分段选项、图标和提示</td></tr><tr><td><a href="./components/more-dropdown.html">RMoreDropdown</a></td><td><code>MoreDropdownProps</code></td><td>图标菜单、行操作</td></tr><tr><td><a href="./components/iframe.html">RIframe</a></td><td><code>IframeProps</code></td><td>外部页面与加载状态</td></tr><tr><td><a href="./components/barcode.html">RBarcode</a></td><td><code>BarcodeProps</code></td><td>Canvas / SVG 条码</td></tr><tr><td><a href="./components/draggable-card.html">RDraggableCard</a></td><td><code>DefaultPosition</code>(位置类型)</td><td>可拖动卡片与拖动边界</td></tr><tr><td><a href="./components/route-transition.html">RTransitionComponent</a></td><td><code>TransitionComponentProps</code></td><td>路由过渡与 KeepAlive</td></tr><tr><td><a href="./icons.html#ricon-api">RIcon</a></td><td><code>IconProps</code></td><td>类型化 SVG 雪碧图</td></tr></tbody></table><p><a href="./components/app.html">应用组件与 Provider</a> 使用模板的状态、主题或路由,按文件导入。<a href="./components/qr-code.html">二维码</a> 使用 <code>vue3-next-qrcode</code>,不属于 <code>@/components</code> 的导出。</p><p>组件实现、样式和类型放在同一个组件目录。组件属性对象也有具名导出,例如 <code>formProps</code>、<code>modalProps</code>、<code>chartProps</code>;业务代码通常直接使用组件和公开 Props 类型。<code>TablePro</code> 统一使用组件 ref 获取实例,<code>RForm</code>、<code>RChart</code>、<code>RFlow</code> 使用各自的 <code>onRegister</code> 契约。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/index.ts" target="_blank" rel="noreferrer">公开导出</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/components/README.md" target="_blank" rel="noreferrer">组件约定</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/tree/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/views/demo" target="_blank" rel="noreferrer">示例源码</a></p>',6)])])}const i=e(a,[["render",c]]);export{f as __pageData,i as default};
|
||||
import{_ as e,o,c as d,a3 as r}from"./chunks/framework.D8G7yXPy.js";const f=JSON.parse('{"title":"组件","description":"","frontmatter":{},"headers":[],"relativePath":"reference/components.md","filePath":"reference/components.md"}'),a={name:"reference/components.md"};function c(n,t,p,s,m,l){return o(),d("div",null,[...t[0]||(t[0]=[r('<h1 id="组件" tabindex="-1">组件 <a class="header-anchor" href="#组件" aria-label="Permalink to "组件""></a></h1><p>通用组件从 <code>@ray-template/ui</code> 导入,也可用 <code>/table-pro</code>、<code>/barcode</code> 等子路径按需加载。Ray Admin 内可以使用 <code>@/components</code>。路由过渡位于 <code>@ray-template/admin-shell</code>,由应用接入当前路由和缓存状态。许多组件包装 Naive UI:本文列出模板添加、改写或消费的属性、插槽和事件,原始控件的其余能力以锁定依赖的类型为准。</p><table tabindex="0"><thead><tr><th>组件</th><th>Props 类型</th><th>主要用途</th></tr></thead><tbody><tr><td><a href="./table-pro.html">RTablePro</a></td><td><code>TableProProps</code></td><td>纯表格、远端查询、自适应高度、列设置、导出及可选打印</td></tr><tr><td><a href="./components/form.html">RForm</a></td><td><code>FormProps</code></td><td>表单加载、校验、重置和键盘提交</td></tr><tr><td><a href="./components/modal.html">RModal</a></td><td><code>ModalProps</code></td><td>受控弹窗、预设宽度和全屏卡片</td></tr><tr><td><a href="./components/chart.html">RChart</a></td><td><code>ChartProps</code></td><td>ECharts 初始化、主题和导出</td></tr><tr><td><a href="./components/flow.html">RFlow</a></td><td><code>FlowProps</code></td><td>LogicFlow 流程图与只读切换</td></tr><tr><td><a href="./components/collapse-grid.html">RCollapseGrid</a></td><td><code>CollapseGridProps</code></td><td>可折叠筛选区及操作列</td></tr><tr><td><a href="./components/segment.html">RSegment</a></td><td><code>SegmentProps</code></td><td>分段选项、图标和提示</td></tr><tr><td><a href="./components/more-dropdown.html">RMoreDropdown</a></td><td><code>MoreDropdownProps</code></td><td>图标菜单、行操作</td></tr><tr><td><a href="./components/iframe.html">RIframe</a></td><td><code>IframeProps</code></td><td>外部页面与加载状态</td></tr><tr><td><a href="./components/barcode.html">RBarcode</a></td><td><code>BarcodeProps</code></td><td>Canvas / SVG 条码</td></tr><tr><td><a href="./components/draggable-card.html">RDraggableCard</a></td><td><code>DefaultPosition</code>(位置类型)</td><td>可拖动卡片与拖动边界</td></tr><tr><td><a href="./components/route-transition.html">RTransitionComponent</a></td><td><code>TransitionComponentProps</code></td><td>路由过渡与 KeepAlive</td></tr><tr><td><a href="./icons.html#ricon-api">RIcon</a></td><td><code>IconProps</code></td><td>类型化 SVG 雪碧图</td></tr></tbody></table><p><a href="./components/app.html">应用组件与 Provider</a> 使用模板的状态、主题或路由,按文件导入。<a href="./components/qr-code.html">二维码</a> 使用 <code>vue3-next-qrcode</code>,不属于 <code>@/components</code> 的导出。</p><p>组件实现、样式和类型放在同一个组件目录。组件属性对象也有具名导出,例如 <code>formProps</code>、<code>modalProps</code>、<code>chartProps</code>;业务代码通常直接使用组件和公开 Props 类型。<code>TablePro</code> 统一使用组件 ref 获取实例,<code>RForm</code>、<code>RChart</code>、<code>RFlow</code> 使用各自的 <code>onRegister</code> 契约。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/index.ts" target="_blank" rel="noreferrer">公开导出</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/components/README.md" target="_blank" rel="noreferrer">组件约定</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/tree/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/views/demo" target="_blank" rel="noreferrer">示例源码</a></p>',6)])])}const i=e(a,[["render",c]]);export{f as __pageData,i as default};
|
||||
@ -1,4 +1,4 @@
|
||||
import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPcM-fsm.js";import{o as n,c as h,a3 as i,E as k}from"./chunks/framework.D8G7yXPy.js";const r=JSON.parse('{"title":"应用组件与 Provider","description":"","frontmatter":{},"headers":[],"relativePath":"reference/components/app.md","filePath":"reference/components/app.md"}'),p={name:"reference/components/app.md"},d=Object.assign(p,{setup(l){return(t,s)=>(n(),h("div",null,[s[0]||(s[0]=i('<h1 id="应用组件与-provider" tabindex="-1">应用组件与 Provider <a class="header-anchor" href="#应用组件与-provider" aria-label="Permalink to "应用组件与 Provider""></a></h1><p>这些组件按文件默认导入,例如 <code>import AppPageHeader from '@/app-components/app/AppPageHeader'</code>。它们依赖应用 Store、路由或 DOM,按默认 <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/App.tsx" target="_blank" rel="noreferrer">App 挂载顺序</a>集成。</p><h2 id="后台上下文示例" tabindex="-1">后台上下文示例 <a class="header-anchor" href="#后台上下文示例" aria-label="Permalink to "后台上下文示例""></a></h2><p>这个预览运行后台的工作台和布局。在侧栏进入「模板 Hooks」,可以切换主题、水印、布局加载和菜单状态。版本提示、请求取消等 Provider 属于应用初始化流程,接入顺序见下表。</p>',4)),k(a,{path:"/dashboard",title:"后台工作台、布局与 Provider",layout:""}),s[1]||(s[1]=i(`<details class="details custom-block"><summary>查看预览入口与工作台源码</summary><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> './styles/entry'</span></span>
|
||||
import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPcM-fsm.js";import{o as n,c as h,a3 as i,E as k}from"./chunks/framework.D8G7yXPy.js";const r=JSON.parse('{"title":"应用组件与 Provider","description":"","frontmatter":{},"headers":[],"relativePath":"reference/components/app.md","filePath":"reference/components/app.md"}'),p={name:"reference/components/app.md"},d=Object.assign(p,{setup(l){return(t,s)=>(n(),h("div",null,[s[0]||(s[0]=i('<h1 id="应用组件与-provider" tabindex="-1">应用组件与 Provider <a class="header-anchor" href="#应用组件与-provider" aria-label="Permalink to "应用组件与 Provider""></a></h1><p>这些组件按文件默认导入,例如 <code>import AppPageHeader from '@/app-components/app/AppPageHeader'</code>。它们依赖应用 Store、路由或 DOM,按默认 <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/App.tsx" target="_blank" rel="noreferrer">App 挂载顺序</a>集成。</p><h2 id="后台上下文示例" tabindex="-1">后台上下文示例 <a class="header-anchor" href="#后台上下文示例" aria-label="Permalink to "后台上下文示例""></a></h2><p>这个预览运行后台的工作台和布局。在侧栏进入「模板 Hooks」,可以切换主题、水印、布局加载和菜单状态。版本提示、请求取消等 Provider 属于应用初始化流程,接入顺序见下表。</p>',4)),k(a,{path:"/dashboard",title:"后台工作台、布局与 Provider",layout:""}),s[1]||(s[1]=i(`<details class="details custom-block"><summary>查看预览入口与工作台源码</summary><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> './styles/entry'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { apiMockEnabled } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@/api/admin/client'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> AppNaiveGlobalProvider </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@/app-components/provider/AppNaiveGlobalProvider'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> AppStyleProvider </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@/app-components/provider/AppStyleProvider'</span></span>
|
||||
@ -342,4 +342,4 @@ import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> 新建订单</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">NButton</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">AppPageHeader</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><h2 id="provider" tabindex="-1">Provider <a class="header-anchor" href="#provider" aria-label="Permalink to "Provider""></a></h2><table tabindex="0"><thead><tr><th>Provider</th><th>职责与调用时机</th></tr></thead><tbody><tr><td><code>AppNaiveGlobalProvider</code></td><td>包裹默认插槽并同步明暗、主题覆盖、UI locale 和日期 locale。提供 Message、Dialog、Modal、Notification、LoadingBar 等上下文,并建立 <code>window.$message</code>、<code>$dialog</code>、<code>$notification</code>、<code>$loadingBar</code>。离散 API 在 Provider 初始化后可用,卸载时释放;不要在模块顶层提前调用。</td></tr><tr><td><code>AppStyleProvider</code></td><td>同步 HTML 明暗类、CSS 主色和窗口尺寸变量,结束首屏加载动画。应用主题应通过设置方法更新。</td></tr><tr><td><code>AppVersionProvider</code></td><td>启动时比较构建版本与本地版本。第一次写入缓存,变化时提示,确认会走退出并刷新;取消关闭提示。</td></tr><tr><td><code>AppWatermarkProvider</code></td><td>按设置渲染全屏 Naive UI 水印;独立页面如需局部水印可自行在目标区域使用 <code>NWatermark</code>。</td></tr><tr><td><code>AppRequestCancelerProvider</code></td><td>默认布局内容的路由更新钩子会取消模板管理的请求。替换内容插槽时,根据实际导航方式保留取消行为。</td></tr></tbody></table><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/app-components/README.md" target="_blank" rel="noreferrer">应用组件说明</a> · <a href="./../../guide/layout.html">布局配置</a> · <a href="./../store.html">Store</a> · <a href="./../../guide/requests.html">请求取消</a></p>`,7))]))}});export{r as __pageData,d as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><h2 id="provider" tabindex="-1">Provider <a class="header-anchor" href="#provider" aria-label="Permalink to "Provider""></a></h2><table tabindex="0"><thead><tr><th>Provider</th><th>职责与调用时机</th></tr></thead><tbody><tr><td><code>AppNaiveGlobalProvider</code></td><td>包裹默认插槽并同步明暗、主题覆盖、UI locale 和日期 locale。提供 Message、Dialog、Modal、Notification、LoadingBar 等上下文,并建立 <code>window.$message</code>、<code>$dialog</code>、<code>$notification</code>、<code>$loadingBar</code>。离散 API 在 Provider 初始化后可用,卸载时释放;不要在模块顶层提前调用。</td></tr><tr><td><code>AppStyleProvider</code></td><td>同步 HTML 明暗类、CSS 主色和窗口尺寸变量,结束首屏加载动画。应用主题应通过设置方法更新。</td></tr><tr><td><code>AppVersionProvider</code></td><td>启动时比较构建版本与本地版本。第一次写入缓存,变化时提示,确认会走退出并刷新;取消关闭提示。</td></tr><tr><td><code>AppWatermarkProvider</code></td><td>按设置渲染全屏 Naive UI 水印;独立页面如需局部水印可自行在目标区域使用 <code>NWatermark</code>。</td></tr><tr><td><code>AppRequestCancelerProvider</code></td><td>默认布局内容的路由更新钩子会取消模板管理的请求。替换内容插槽时,根据实际导航方式保留取消行为。</td></tr></tbody></table><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/app-components/README.md" target="_blank" rel="noreferrer">应用组件说明</a> · <a href="./../../guide/layout.html">布局配置</a> · <a href="./../store.html">Store</a> · <a href="./../../guide/requests.html">请求取消</a></p>`,7))]))}});export{r as __pageData,d as default};
|
||||
@ -102,4 +102,4 @@ import{o as n,c as t,a3 as i,E as h,k,a7 as l,V as p}from"./chunks/framework.D8G
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{{ displayValue: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, height: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">60</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }}</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onError</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> console.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'条码格式无效'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, error)}</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><table tabindex="0"><thead><tr><th>属性</th><th>默认</th><th>说明</th></tr></thead><tbody><tr><td><code>text</code></td><td>无</td><td>条码文本。留空或传入不符合格式的值时可能渲染失败。</td></tr><tr><td><code>format</code></td><td><code>'CODE128'</code></td><td>条码制式,覆盖 <code>options.format</code>。</td></tr><tr><td><code>barcodeRender</code></td><td><code>'canvas'</code></td><td><code>canvas</code> 或 <code>svg</code>。</td></tr><tr><td><code>options</code></td><td><code>{}</code></td><td>JsBarcode options,如 <code>displayValue</code>、<code>lineColor</code>、<code>margin</code>、条宽和条高。</td></tr><tr><td><code>width</code> / <code>height</code></td><td><code>'auto'</code></td><td>显示尺寸,数字按像素。与 <code>options</code> 中条码自身的条宽、条高不同。</td></tr><tr><td><code>responsive</code></td><td><code>false</code></td><td>监听容器尺寸;用 <code>width="responsive"</code> 或 <code>height="responsive"</code> 让对应尺寸随容器调整。</td></tr><tr><td><code>watchText</code></td><td><code>true</code></td><td>文本变化时重绘。<code>format</code>、<code>options</code>(包括响应式嵌套字段)、尺寸和渲染介质变化也会自动重绘,无需更换 <code>key</code>。</td></tr><tr><td><code>loading</code></td><td><code>false</code></td><td>控制 Spin;调用方负责开关。</td></tr></tbody></table><p><code>onSuccess(text, format, options)</code>、<code>onError(error)</code>、<code>onFinally()</code> 支持函数或回调数组。成功回调收到原始 options;组件响应式调整的条宽和条高不写回该对象。绘制异常通过 <code>onError</code> 通知,业务代码可据此提示或清理旧预览。</p><p>支持 <code>CODE39</code>、<code>CODE128</code> 及 <code>A/B/C</code> 变体、<code>EAN13/EAN8/EAN5/EAN2</code>、<code>UPC</code>、<code>ITF14/ITF</code>、<code>MSI/MSI10/MSI11/MSI1010/MSI1110</code>、<code>pharmacode</code>、<code>codabar</code>。使用 EAN 或 UPC 前验证输入长度和校验位。打印后是否可扫取决于设备和成品尺寸。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RBarcode/src/Barcode.tsx" target="_blank" rel="noreferrer">组件实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RBarcode/src/types.ts" target="_blank" rel="noreferrer">制式和选项类型</a></p>`,7))]))}});export{g as __pageData,y as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><table tabindex="0"><thead><tr><th>属性</th><th>默认</th><th>说明</th></tr></thead><tbody><tr><td><code>text</code></td><td>无</td><td>条码文本。留空或传入不符合格式的值时可能渲染失败。</td></tr><tr><td><code>format</code></td><td><code>'CODE128'</code></td><td>条码制式,覆盖 <code>options.format</code>。</td></tr><tr><td><code>barcodeRender</code></td><td><code>'canvas'</code></td><td><code>canvas</code> 或 <code>svg</code>。</td></tr><tr><td><code>options</code></td><td><code>{}</code></td><td>JsBarcode options,如 <code>displayValue</code>、<code>lineColor</code>、<code>margin</code>、条宽和条高。</td></tr><tr><td><code>width</code> / <code>height</code></td><td><code>'auto'</code></td><td>显示尺寸,数字按像素。与 <code>options</code> 中条码自身的条宽、条高不同。</td></tr><tr><td><code>responsive</code></td><td><code>false</code></td><td>监听容器尺寸;用 <code>width="responsive"</code> 或 <code>height="responsive"</code> 让对应尺寸随容器调整。</td></tr><tr><td><code>watchText</code></td><td><code>true</code></td><td>文本变化时重绘。<code>format</code>、<code>options</code>(包括响应式嵌套字段)、尺寸和渲染介质变化也会自动重绘,无需更换 <code>key</code>。</td></tr><tr><td><code>loading</code></td><td><code>false</code></td><td>控制 Spin;调用方负责开关。</td></tr></tbody></table><p><code>onSuccess(text, format, options)</code>、<code>onError(error)</code>、<code>onFinally()</code> 支持函数或回调数组。成功回调收到原始 options;组件响应式调整的条宽和条高不写回该对象。绘制异常通过 <code>onError</code> 通知,业务代码可据此提示或清理旧预览。</p><p>支持 <code>CODE39</code>、<code>CODE128</code> 及 <code>A/B/C</code> 变体、<code>EAN13/EAN8/EAN5/EAN2</code>、<code>UPC</code>、<code>ITF14/ITF</code>、<code>MSI/MSI10/MSI11/MSI1010/MSI1110</code>、<code>pharmacode</code>、<code>codabar</code>。使用 EAN 或 UPC 前验证输入长度和校验位。打印后是否可扫取决于设备和成品尺寸。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RBarcode/src/Barcode.tsx" target="_blank" rel="noreferrer">组件实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RBarcode/src/types.ts" target="_blank" rel="noreferrer">制式和选项类型</a></p>`,7))]))}});export{g as __pageData,y as default};
|
||||
File diff suppressed because one or more lines are too long
@ -214,4 +214,4 @@ import{g as cs,c as R}from"./chunks/element.mIVMEYq_.js";import{c as n,a as r,b
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RCollapseGrid</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RCollapseGrid/src/index.tsx" target="_blank" rel="noreferrer">组件实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RCollapseGrid/src/props.ts" target="_blank" rel="noreferrer">Props</a></p>`,6))])}}});export{ti as __pageData,ei as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RCollapseGrid/src/index.tsx" target="_blank" rel="noreferrer">组件实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RCollapseGrid/src/props.ts" target="_blank" rel="noreferrer">Props</a></p>`,6))])}}});export{ti as __pageData,ei as default};
|
||||
@ -99,4 +99,4 @@ import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> 拖动标题可移动此卡片</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RDraggableCard</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RDraggableCard/DraggableCard.tsx" target="_blank" rel="noreferrer">组件源码</a></p>`,3))]))}});export{d as __pageData,r as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RDraggableCard/DraggableCard.tsx" target="_blank" rel="noreferrer">组件源码</a></p>`,3))]))}});export{d as __pageData,r as default};
|
||||
@ -121,4 +121,4 @@ import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onRegister</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">instance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> instance.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">render</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(graph)}</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ),</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><table tabindex="0"><thead><tr><th>属性</th><th>默认</th><th>说明</th></tr></thead><tbody><tr><td><code>width</code> / <code>height</code></td><td><code>'100%'</code></td><td>容器尺寸,需要可计算的高度。</td></tr><tr><td><code>data</code></td><td>无</td><td>首次挂载和后续引用变化时渲染,清空为 <code>undefined</code> 时恢复空图;嵌套原地修改不触发。</td></tr><tr><td><code>watchData</code></td><td><code>true</code></td><td>是否监听传入数据。关闭后可从实例控制重绘。</td></tr><tr><td><code>readonly</code></td><td><code>false</code></td><td>启用 LogicFlow 静默模式;退出时恢复进入前的交互和键盘配置,不会强行打开调用方禁用的能力。</td></tr><tr><td><code>options</code></td><td>网格开、<code>partial: false</code>、键盘开</td><td>LogicFlow 初始化配置,包括尺寸、背景、键盘、边、交互、历史和插件等。<code>container</code> 由组件管理。</td></tr><tr><td><code>use</code></td><td>无</td><td>每个组件初始化前注册自己的 LogicFlow 全局插件列表,由库按名称去重。实例级插件可用 <code>options.plugins</code>。</td></tr><tr><td><code>onRegister(instance)</code></td><td>无</td><td>挂载后取得 LogicFlow,支持回调数组。</td></tr></tbody></table><p><code>FlowOptions</code> 支持的字段按用途分组:</p><ul><li>画布与布局:<code>width</code>、<code>height</code>、<code>background</code>、<code>grid</code>、<code>partial</code>、<code>style</code>、<code>overlapMode</code>。</li><li>交互:<code>keyboard</code>、<code>adjustEdge</code>、<code>allowRotate</code>、<code>allowResize</code>、<code>isSilentMode</code>、<code>stopScrollGraph</code>、<code>stopZoomGraph</code>、<code>stopMoveGraph</code>、<code>textEdit</code>、<code>textMode</code>、<code>edgeTextMode</code>、<code>nodeTextMode</code>、<code>guards</code>。</li><li>边和渲染:<code>edgeType</code>、<code>customTrajectory</code>、<code>animation</code>、<code>history</code>、<code>outline</code>、<code>snapline</code>。</li><li>扩展:<code>plugins</code>、<code>pluginsOptions</code>、<code>disabledPlugins</code>、<code>disabledTools</code>、<code>idGenerator</code>、<code>edgeGenerator</code>。</li></ul><p><code>FlowGraphData</code> 用于包装组件的 Props。直接调用底层 <code>instance.render</code> 时,使用 <code>Parameters<LogicFlow['render']>[0]</code> 保留 LogicFlow 所要求的节点类型、坐标和连线字段。</p><p><code>useFlow()</code> 返回 <code>[register, { getFlowInstance }]</code>,将 <code>register</code> 传给 <code>onRegister</code>。首次图数据可直接通过 <code>data</code> 提供;注册之前或组件卸载后调用 <code>getFlowInstance()</code> 会抛错。组件卸载时销毁 LogicFlow 实例;程序化编辑、导入和事件监听走该实例,接入方仍需清理自己创建的外部资源。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RFlow/src/Flow.tsx" target="_blank" rel="noreferrer">组件实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RFlow/src/types.ts" target="_blank" rel="noreferrer">图和选项类型</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RFlow/src/hooks/useFlow.ts" target="_blank" rel="noreferrer">实例 Hook</a></p>`,8))]))}});export{d as __pageData,r as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><table tabindex="0"><thead><tr><th>属性</th><th>默认</th><th>说明</th></tr></thead><tbody><tr><td><code>width</code> / <code>height</code></td><td><code>'100%'</code></td><td>容器尺寸,需要可计算的高度。</td></tr><tr><td><code>data</code></td><td>无</td><td>首次挂载和后续引用变化时渲染,清空为 <code>undefined</code> 时恢复空图;嵌套原地修改不触发。</td></tr><tr><td><code>watchData</code></td><td><code>true</code></td><td>是否监听传入数据。关闭后可从实例控制重绘。</td></tr><tr><td><code>readonly</code></td><td><code>false</code></td><td>启用 LogicFlow 静默模式;退出时恢复进入前的交互和键盘配置,不会强行打开调用方禁用的能力。</td></tr><tr><td><code>options</code></td><td>网格开、<code>partial: false</code>、键盘开</td><td>LogicFlow 初始化配置,包括尺寸、背景、键盘、边、交互、历史和插件等。<code>container</code> 由组件管理。</td></tr><tr><td><code>use</code></td><td>无</td><td>每个组件初始化前注册自己的 LogicFlow 全局插件列表,由库按名称去重。实例级插件可用 <code>options.plugins</code>。</td></tr><tr><td><code>onRegister(instance)</code></td><td>无</td><td>挂载后取得 LogicFlow,支持回调数组。</td></tr></tbody></table><p><code>FlowOptions</code> 支持的字段按用途分组:</p><ul><li>画布与布局:<code>width</code>、<code>height</code>、<code>background</code>、<code>grid</code>、<code>partial</code>、<code>style</code>、<code>overlapMode</code>。</li><li>交互:<code>keyboard</code>、<code>adjustEdge</code>、<code>allowRotate</code>、<code>allowResize</code>、<code>isSilentMode</code>、<code>stopScrollGraph</code>、<code>stopZoomGraph</code>、<code>stopMoveGraph</code>、<code>textEdit</code>、<code>textMode</code>、<code>edgeTextMode</code>、<code>nodeTextMode</code>、<code>guards</code>。</li><li>边和渲染:<code>edgeType</code>、<code>customTrajectory</code>、<code>animation</code>、<code>history</code>、<code>outline</code>、<code>snapline</code>。</li><li>扩展:<code>plugins</code>、<code>pluginsOptions</code>、<code>disabledPlugins</code>、<code>disabledTools</code>、<code>idGenerator</code>、<code>edgeGenerator</code>。</li></ul><p><code>FlowGraphData</code> 用于包装组件的 Props。直接调用底层 <code>instance.render</code> 时,使用 <code>Parameters<LogicFlow['render']>[0]</code> 保留 LogicFlow 所要求的节点类型、坐标和连线字段。</p><p><code>useFlow()</code> 返回 <code>[register, { getFlowInstance }]</code>,将 <code>register</code> 传给 <code>onRegister</code>。首次图数据可直接通过 <code>data</code> 提供;注册之前或组件卸载后调用 <code>getFlowInstance()</code> 会抛错。组件卸载时销毁 LogicFlow 实例;程序化编辑、导入和事件监听走该实例,接入方仍需清理自己创建的外部资源。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RFlow/src/Flow.tsx" target="_blank" rel="noreferrer">组件实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RFlow/src/types.ts" target="_blank" rel="noreferrer">图和选项类型</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RFlow/src/hooks/useFlow.ts" target="_blank" rel="noreferrer">实例 Hook</a></p>`,8))]))}});export{d as __pageData,r as default};
|
||||
@ -255,4 +255,4 @@ import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">DemoPage</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div></details><h2 id="属性与事件" tabindex="-1">属性与事件 <a class="header-anchor" href="#属性与事件" aria-label="Permalink to "属性与事件""></a></h2><p>继承 <code>NForm</code> 的公开属性和 <code>onSubmit</code> 事件,默认插槽传给 <code>NForm</code>。</p><table tabindex="0"><thead><tr><th>属性</th><th>默认</th><th>说明</th></tr></thead><tbody><tr><td><code>loading</code></td><td><code>false</code></td><td>外层 Spin 状态,由调用方开关。</td></tr><tr><td><code>loadingDescription</code></td><td>无</td><td>加载说明。</td></tr><tr><td><code>autocomplete</code></td><td><code>'off'</code></td><td>挂载时写到表单 DOM。</td></tr><tr><td><code>submitWhenEnter</code></td><td><code>false</code></td><td>可动态启用单行输入的 Enter 提交;校验成功后调用 <code>onFinish</code>,加载中或上次提交未结束时忽略重复提交。</td></tr><tr><td><code>onFinish</code></td><td>无</td><td>Enter 校验完成回调。自定义提交按钮要自行调用 <code>validate()</code> 并执行提交。</td></tr><tr><td><code>onRegister(inst)</code></td><td>无</td><td>挂载后传出 Naive UI Form 实例。接受单函数或回调数组。</td></tr></tbody></table><p>输入法确认、多行换行、组合框、按钮、修饰键和已被控件 <code>preventDefault()</code> 的 Enter 保留原生行为。键盘提交的校验失败由表单展示;<code>onFinish</code> 的异常交给 Vue 的错误处理。调用 <code>useForm.validate()</code> 仍需处理其 Promise 拒绝。组件没有把 Form 方法直接暴露为模板 ref。</p><h2 id="useform" tabindex="-1">useForm <a class="header-anchor" href="#useform" aria-label="Permalink to "useForm""></a></h2><p><code>useForm(model?, rules?)</code> 返回 <code>[register, actions]</code>,把 <code>register</code> 绑定给 <code>onRegister</code>。初始化值和规则可用对象或工厂;对象会深拷贝,工厂结果直接使用,建议每次创建新对象。</p><table tabindex="0"><thead><tr><th>返回项</th><th>行为</th></tr></thead><tbody><tr><td><code>formConditionRef</code></td><td>响应式模型,传给 <code>RForm.model</code> 并用于输入绑定。</td></tr><tr><td><code>formModel()</code> / <code>formRules()</code></td><td>重新取得初始模型和规则。</td></tr><tr><td><code>getFormInstance()</code></td><td>获取已注册实例,未注册或已卸载时抛错。</td></tr><tr><td><code>validate(callback?, shouldRuleBeApplied?)</code></td><td>透传 Naive UI 校验;失败要处理 Promise 拒绝。</td></tr><tr><td><code>validateTargetField(key)</code></td><td>按规则对象的唯一 <code>key</code> 筛选规则,<code>key</code> 不等同于 <code>NFormItem.path</code>。</td></tr><tr><td><code>restoreValidation()</code></td><td>清除当前校验状态,保留输入。</td></tr><tr><td><code>updateFormCondition(values)</code></td><td>浅合并当前模型,不改初始值。</td></tr><tr><td><code>reset(values?)</code></td><td>合并初始值和覆盖值,然后清除校验。动态新增字段不会被自动删除。</td></tr></tbody></table><p>实例相关方法要在表单挂载并注册后调用。可空字段应在初始模型中显式声明,并为所用输入选用合适的空值。修改嵌套字段时注意更新是浅合并。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RForm/src/Form.tsx" target="_blank" rel="noreferrer">组件源码</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RForm/src/hooks/useForm.ts" target="_blank" rel="noreferrer">useForm 源码</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/views/demo/form/index.tsx" target="_blank" rel="noreferrer">表单示例</a></p>`,10))]))}});export{r as __pageData,d as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div></details><h2 id="属性与事件" tabindex="-1">属性与事件 <a class="header-anchor" href="#属性与事件" aria-label="Permalink to "属性与事件""></a></h2><p>继承 <code>NForm</code> 的公开属性和 <code>onSubmit</code> 事件,默认插槽传给 <code>NForm</code>。</p><table tabindex="0"><thead><tr><th>属性</th><th>默认</th><th>说明</th></tr></thead><tbody><tr><td><code>loading</code></td><td><code>false</code></td><td>外层 Spin 状态,由调用方开关。</td></tr><tr><td><code>loadingDescription</code></td><td>无</td><td>加载说明。</td></tr><tr><td><code>autocomplete</code></td><td><code>'off'</code></td><td>挂载时写到表单 DOM。</td></tr><tr><td><code>submitWhenEnter</code></td><td><code>false</code></td><td>可动态启用单行输入的 Enter 提交;校验成功后调用 <code>onFinish</code>,加载中或上次提交未结束时忽略重复提交。</td></tr><tr><td><code>onFinish</code></td><td>无</td><td>Enter 校验完成回调。自定义提交按钮要自行调用 <code>validate()</code> 并执行提交。</td></tr><tr><td><code>onRegister(inst)</code></td><td>无</td><td>挂载后传出 Naive UI Form 实例。接受单函数或回调数组。</td></tr></tbody></table><p>输入法确认、多行换行、组合框、按钮、修饰键和已被控件 <code>preventDefault()</code> 的 Enter 保留原生行为。键盘提交的校验失败由表单展示;<code>onFinish</code> 的异常交给 Vue 的错误处理。调用 <code>useForm.validate()</code> 仍需处理其 Promise 拒绝。组件没有把 Form 方法直接暴露为模板 ref。</p><h2 id="useform" tabindex="-1">useForm <a class="header-anchor" href="#useform" aria-label="Permalink to "useForm""></a></h2><p><code>useForm(model?, rules?)</code> 返回 <code>[register, actions]</code>,把 <code>register</code> 绑定给 <code>onRegister</code>。初始化值和规则可用对象或工厂;对象会深拷贝,工厂结果直接使用,建议每次创建新对象。</p><table tabindex="0"><thead><tr><th>返回项</th><th>行为</th></tr></thead><tbody><tr><td><code>formConditionRef</code></td><td>响应式模型,传给 <code>RForm.model</code> 并用于输入绑定。</td></tr><tr><td><code>formModel()</code> / <code>formRules()</code></td><td>重新取得初始模型和规则。</td></tr><tr><td><code>getFormInstance()</code></td><td>获取已注册实例,未注册或已卸载时抛错。</td></tr><tr><td><code>validate(callback?, shouldRuleBeApplied?)</code></td><td>透传 Naive UI 校验;失败要处理 Promise 拒绝。</td></tr><tr><td><code>validateTargetField(key)</code></td><td>按规则对象的唯一 <code>key</code> 筛选规则,<code>key</code> 不等同于 <code>NFormItem.path</code>。</td></tr><tr><td><code>restoreValidation()</code></td><td>清除当前校验状态,保留输入。</td></tr><tr><td><code>updateFormCondition(values)</code></td><td>浅合并当前模型,不改初始值。</td></tr><tr><td><code>reset(values?)</code></td><td>合并初始值和覆盖值,然后清除校验。动态新增字段不会被自动删除。</td></tr></tbody></table><p>实例相关方法要在表单挂载并注册后调用。可空字段应在初始模型中显式声明,并为所用输入选用合适的空值。修改嵌套字段时注意更新是浅合并。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RForm/src/Form.tsx" target="_blank" rel="noreferrer">组件源码</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RForm/src/hooks/useForm.ts" target="_blank" rel="noreferrer">useForm 源码</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/views/demo/form/index.tsx" target="_blank" rel="noreferrer">表单示例</a></p>`,10))]))}});export{r as __pageData,d as default};
|
||||
@ -60,4 +60,4 @@ import{_ as n}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> renderReport</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">url</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RIframe</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> src</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{url} </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">title</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"库存报表"</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> height</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">460</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">} </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">lazy</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"eager"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><table tabindex="0"><thead><tr><th>属性</th><th>默认</th><th>说明</th></tr></thead><tbody><tr><td><code>src</code></td><td>必填</td><td>iframe 地址。接收用户输入时应由业务限制可嵌入来源。</td></tr><tr><td><code>width</code> / <code>height</code></td><td><code>'100%'</code></td><td>CSS 尺寸。百分比高度依赖父级。</td></tr><tr><td><code>frameborder</code></td><td><code>0</code></td><td>模板边框样式变量。</td></tr><tr><td><code>iframeWrapperClass</code> / <code>iframeClass</code></td><td>无</td><td>外层容器与原生 iframe 的类名。</td></tr><tr><td><code>title</code> / <code>name</code> / <code>allow</code></td><td>无</td><td>原生 iframe 属性。<code>title</code> 用于辅助技术识别。</td></tr><tr><td><code>lazy</code></td><td><code>true</code></td><td><code>true</code> / <code>'lazy'</code> 延迟加载,<code>false</code> / <code>'eager'</code> 主动加载。</td></tr><tr><td><code>customSpinProps</code></td><td><code>{}</code></td><td>NSpin 配置,<code>show</code> 由组件内状态覆盖。</td></tr></tbody></table><p><code>onSuccess(iframe, event)</code> 和 <code>onError(event)</code> 支持函数或回调数组。每次 <code>src</code> 变化都会重新显示 Spin,在 <code>load</code> / <code>error</code> 后关闭。组件 ref 上的 <code>iframe</code> 和兼容别名 <code>iframeInst</code> 都是原生 DOM 元素(尚未挂载时为 <code>null</code>);Vue 已自动解包,无需再访问 <code>.value</code>。额外插槽交给 Spin,但默认内容始终为 iframe。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RIframe/src/Iframe.tsx" target="_blank" rel="noreferrer">组件实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RIframe/src/props.ts" target="_blank" rel="noreferrer">Props</a></p>`,5))]))}});export{g as __pageData,y as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><table tabindex="0"><thead><tr><th>属性</th><th>默认</th><th>说明</th></tr></thead><tbody><tr><td><code>src</code></td><td>必填</td><td>iframe 地址。接收用户输入时应由业务限制可嵌入来源。</td></tr><tr><td><code>width</code> / <code>height</code></td><td><code>'100%'</code></td><td>CSS 尺寸。百分比高度依赖父级。</td></tr><tr><td><code>frameborder</code></td><td><code>0</code></td><td>模板边框样式变量。</td></tr><tr><td><code>iframeWrapperClass</code> / <code>iframeClass</code></td><td>无</td><td>外层容器与原生 iframe 的类名。</td></tr><tr><td><code>title</code> / <code>name</code> / <code>allow</code></td><td>无</td><td>原生 iframe 属性。<code>title</code> 用于辅助技术识别。</td></tr><tr><td><code>lazy</code></td><td><code>true</code></td><td><code>true</code> / <code>'lazy'</code> 延迟加载,<code>false</code> / <code>'eager'</code> 主动加载。</td></tr><tr><td><code>customSpinProps</code></td><td><code>{}</code></td><td>NSpin 配置,<code>show</code> 由组件内状态覆盖。</td></tr></tbody></table><p><code>onSuccess(iframe, event)</code> 和 <code>onError(event)</code> 支持函数或回调数组。每次 <code>src</code> 变化都会重新显示 Spin,在 <code>load</code> / <code>error</code> 后关闭。组件 ref 上的 <code>iframe</code> 和兼容别名 <code>iframeInst</code> 都是原生 DOM 元素(尚未挂载时为 <code>null</code>);Vue 已自动解包,无需再访问 <code>.value</code>。额外插槽交给 Spin,但默认内容始终为 iframe。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RIframe/src/Iframe.tsx" target="_blank" rel="noreferrer">组件实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RIframe/src/props.ts" target="_blank" rel="noreferrer">Props</a></p>`,5))]))}});export{g as __pageData,y as default};
|
||||
@ -140,4 +140,4 @@ import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">DemoPage</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div></details><h2 id="命令式弹窗" tabindex="-1">命令式弹窗 <a class="header-anchor" href="#命令式弹窗" aria-label="Permalink to "命令式弹窗""></a></h2><p><code>@/components</code> 的 <code>useModal()</code> 已弃用,兼容代码仍可通过 <code>create(options)</code> 和 <code>destroyAll()</code> 调用。<code>create</code> 返回 Naive UI 弹窗句柄,支持 <code>fullscreen</code>、<code>width</code>、<code>cardWidth</code>、<code>dialogWidth</code> 等兼容配置。新代码从 <code>naive-ui</code> 导入 <code>useModal</code>,在 <code>NModalProvider</code> 的后代调用;需要模板专用全屏样式时用声明式 <code>RModal</code>。提示用户确认危险操作时也可以用全局 <a href="./app.html">Dialog Provider</a>。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RModal/src/Modal.tsx" target="_blank" rel="noreferrer">组件源码</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RModal/src/hooks/useModal.ts" target="_blank" rel="noreferrer">兼容 Hook</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/__test__/components/modal.spec.ts" target="_blank" rel="noreferrer">回归用例</a></p>`,4))]))}});export{d as __pageData,r as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div></details><h2 id="命令式弹窗" tabindex="-1">命令式弹窗 <a class="header-anchor" href="#命令式弹窗" aria-label="Permalink to "命令式弹窗""></a></h2><p><code>@/components</code> 的 <code>useModal()</code> 已弃用,兼容代码仍可通过 <code>create(options)</code> 和 <code>destroyAll()</code> 调用。<code>create</code> 返回 Naive UI 弹窗句柄,支持 <code>fullscreen</code>、<code>width</code>、<code>cardWidth</code>、<code>dialogWidth</code> 等兼容配置。新代码从 <code>naive-ui</code> 导入 <code>useModal</code>,在 <code>NModalProvider</code> 的后代调用;需要模板专用全屏样式时用声明式 <code>RModal</code>。提示用户确认危险操作时也可以用全局 <a href="./app.html">Dialog Provider</a>。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RModal/src/Modal.tsx" target="_blank" rel="noreferrer">组件源码</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RModal/src/hooks/useModal.ts" target="_blank" rel="noreferrer">兼容 Hook</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/__test__/components/modal.spec.ts" target="_blank" rel="noreferrer">回归用例</a></p>`,4))]))}});export{d as __pageData,r as default};
|
||||
@ -63,4 +63,4 @@ import{B as c,_ as C}from"./chunks/DemoFrame.vue_vue_type_script_setup_true_lang
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RIcon</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"action/more"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">NButton</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RMoreDropdown</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RMoreDropdown/src/MoreDropdown.tsx" target="_blank" rel="noreferrer">组件实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RMoreDropdown/src/props.ts" target="_blank" rel="noreferrer">Props</a></p>`,5))])}}});export{J as __pageData,K as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RMoreDropdown/src/MoreDropdown.tsx" target="_blank" rel="noreferrer">组件实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RMoreDropdown/src/props.ts" target="_blank" rel="noreferrer">Props</a></p>`,5))])}}});export{J as __pageData,K as default};
|
||||
@ -141,4 +141,4 @@ import{_ as n}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><p><code>text</code> 设置内容,默认可随内容变化重绘。<code>logoImage</code>、<code>backgroundImage</code>、<code>gifBackgroundURL</code>、<code>dotScale</code>、<code>colorDark</code> 可调整样式。带背景的二维码要实际扫码检查清晰度,远程素材还受跨域和浏览器加载限制。</p><p><code>status</code> 可显示 <code>loading</code>、<code>error</code> 等状态,<code>onReload</code> 在重试时通知调用方。<code>downloadQRCode()</code> 等到实例挂载后调用。二维码只表达数据,生成成功与扫码认证成功是两回事;登录需要业务后端签发和验证对应凭据。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/views/demo/qrcode/index.tsx" target="_blank" rel="noreferrer">二维码示例</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/views/login/components/QRCodeSigning/index.tsx" target="_blank" rel="noreferrer">登录页扫码入口</a></p>`,5))]))}});export{g as __pageData,y as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><p><code>text</code> 设置内容,默认可随内容变化重绘。<code>logoImage</code>、<code>backgroundImage</code>、<code>gifBackgroundURL</code>、<code>dotScale</code>、<code>colorDark</code> 可调整样式。带背景的二维码要实际扫码检查清晰度,远程素材还受跨域和浏览器加载限制。</p><p><code>status</code> 可显示 <code>loading</code>、<code>error</code> 等状态,<code>onReload</code> 在重试时通知调用方。<code>downloadQRCode()</code> 等到实例挂载后调用。二维码只表达数据,生成成功与扫码认证成功是两回事;登录需要业务后端签发和验证对应凭据。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/views/demo/qrcode/index.tsx" target="_blank" rel="noreferrer">二维码示例</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/views/login/components/QRCodeSigning/index.tsx" target="_blank" rel="noreferrer">登录页扫码入口</a></p>`,5))]))}});export{g as __pageData,y as default};
|
||||
@ -14,4 +14,4 @@ import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> renderPageOutlet</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RTransitionComponent</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> transitionPropName</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"fade"</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> transitionAppear</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">} /></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/admin-shell/src/RouteTransition.vue" target="_blank" rel="noreferrer">组件源码</a> · <a href="./../store/navigation.html#keepalive-store">缓存 Store</a> · <a href="./../../guide/routing.html#keepalive-排查">路由缓存排查</a></p>`,3))]))}});export{o as __pageData,d as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/admin-shell/src/RouteTransition.vue" target="_blank" rel="noreferrer">组件源码</a> · <a href="./../store/navigation.html#keepalive-store">缓存 Store</a> · <a href="./../../guide/routing.html#keepalive-排查">路由缓存排查</a></p>`,3))]))}});export{o as __pageData,d as default};
|
||||
@ -117,4 +117,4 @@ import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RSegment/src/Segment.tsx" target="_blank" rel="noreferrer">组件实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RSegment/src/types.ts" target="_blank" rel="noreferrer">选项类型</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RSegment/src/constant.ts" target="_blank" rel="noreferrer">不支持的 Tabs 属性</a></p>`,3))]))}});export{d as __pageData,r as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RSegment/src/Segment.tsx" target="_blank" rel="noreferrer">组件实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RSegment/src/types.ts" target="_blank" rel="noreferrer">选项类型</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RSegment/src/constant.ts" target="_blank" rel="noreferrer">不支持的 Tabs 属性</a></p>`,3))]))}});export{d as __pageData,r as default};
|
||||
@ -1 +1 @@
|
||||
import{_ as o,o as t,c as d,a3 as c}from"./chunks/framework.D8G7yXPy.js";const l=JSON.parse('{"title":"应用配置","description":"","frontmatter":{},"headers":[],"relativePath":"reference/configuration.md","filePath":"reference/configuration.md"}'),a={name:"reference/configuration.md"};function r(i,e,n,s,_,p){return t(),d("div",null,[...e[0]||(e[0]=[c('<h1 id="应用配置" tabindex="-1">应用配置 <a class="header-anchor" href="#应用配置" aria-label="Permalink to "应用配置""></a></h1><p>应用配置与站外文档配置分属两个仓库。这里说明 Ray Template 应用中的 <code>@/app-config</code>、Vite 配置和运行期设置。运行期保存的用户偏好可能覆盖源码默认值,验证默认设置时使用干净的浏览器存储。</p><table tabindex="0"><thead><tr><th>文件</th><th>配置</th></tr></thead><tbody><tr><td><code>apps/admin/src/app-config/app-config.ts</code></td><td><code>GLOBAL_CLASS_NAMES</code>(明暗类与 CSS 变量)、<code>MESSAGE_PROVIDER</code>(上下文消息,默认最多 5 条、不可关闭)、<code>LAYOUT_CONTENT_SPIN_WHEN_ROUTE_CHANGE</code>(默认关)、<code>APP_GLOBAL_LOADING</code>、<code>PRE_LOADING_CONFIG</code>、<code>APP_CATCH_KEY</code> / <code>APP_CATCH_KEY_PREFIX</code>、<code>CONTENT_TRANSITION_OPTIONS</code>。</td></tr><tr><td><code>apps/admin/src/app-config/design-config.ts</code></td><td><code>APP_THEME</code> 的候选色、构建品牌蓝 <code>#3b63d9</code>、现代化预设的明暗覆盖、ECharts 默认主题。四套预设在 <code>packages/ui/src/theme-presets.ts</code>。</td></tr><tr><td><code>apps/admin/src/app-config/local-config.ts</code></td><td><code>LOCAL_OPTIONS</code>、<code>SYSTEM_DEFAULT_LOCAL</code>、<code>SYSTEM_FALLBACK_LOCALE</code>、<code>DAYJS_LOCAL_MAP</code>、<code>DEFAULT_DAYJS_LOCAL</code>。默认与回退语言为 <code>zh-CN</code>。</td></tr><tr><td><code>apps/admin/src/app-config/request-config.ts</code></td><td><code>AXIOS_CONFIG</code>。默认同源相对地址、5 秒超时、<code>withCredentials: false</code>、JSON Content-Type。</td></tr><tr><td><code>apps/admin/src/app-config/router-config.ts</code></td><td><code>SETUP_ROUTER_ACTION</code>(加载条与守卫默认开)、<code>WHITE_ROUTES</code>(路由名白名单)、<code>SUPER_ADMIN</code>(默认空)、<code>LAYOUT_CONTENT_REF</code> / <code>LAYOUT_SIDER_REF</code>。</td></tr><tr><td><code>apps/admin/src/app-config/regex-config.ts</code></td><td><code>APP_REGEX</code>,模板 CSS 尺寸规则。</td></tr><tr><td><code>vite.custom.config.ts</code></td><td><code>base</code>、<code>server</code>、<code>buildOptions(mode)</code>、<code>alias</code>、<code>cdn</code>、<code>copyright</code>、Sass 注入和首屏加载配置。</td></tr></tbody></table><h2 id="选择改动入口" tabindex="-1">选择改动入口 <a class="header-anchor" href="#选择改动入口" aria-label="Permalink to "选择改动入口""></a></h2><ul><li>修改默认用户偏好(布局、菜单、标签、缓存)时看 <a href="./store/setting.html">Setting Store</a> 与 <code>apps/admin/src/store/modules/setting/constant.ts</code>。已有用户可在应用设置里恢复默认后检查效果。</li><li>修改主题或语言时看<a href="./../guide/appearance.html">主题和国际化</a>。新增语言同时维护翻译资源与 Day.js、Naive UI 对应关系。</li><li>修改访问控制时看<a href="./../guide/routing.html">路由指南</a>。白名单按区分大小写的字符串路由名判断,守卫先处理 token,再按白名单和角色处理导航。</li><li>修改 API 地址、认证头和失败策略时看<a href="./../guide/requests.html">接口与 Mock</a>。应用不会自动把任意 <code>VITE_*</code> 环境变量绑定到 Axios;需在配置中明确读取。</li><li>应用默认部署子路径 <code>/ray-template/</code>。部署子路径改变后重新构建并验证图标、代理和直达链接,见<a href="./../guide/tooling.html">工程与部署</a>。</li></ul><p><code>__APP_CFG__</code> 由 Vite 在构建时注入,用于应用包信息、版权与默认主色。任何注入到客户端的字段都可被浏览器读取。用于页面交互的运行态偏好走 Store,构建参数留在 Vite 配置。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/tree/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/app-config" target="_blank" rel="noreferrer">应用配置源码</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/vite.custom.config.ts" target="_blank" rel="noreferrer">Vite 自定义配置</a></p>',7)])])}const A=o(a,[["render",r]]);export{l as __pageData,A as default};
|
||||
import{_ as o,o as t,c as d,a3 as c}from"./chunks/framework.D8G7yXPy.js";const f=JSON.parse('{"title":"应用配置","description":"","frontmatter":{},"headers":[],"relativePath":"reference/configuration.md","filePath":"reference/configuration.md"}'),a={name:"reference/configuration.md"};function r(i,e,n,s,_,p){return t(),d("div",null,[...e[0]||(e[0]=[c('<h1 id="应用配置" tabindex="-1">应用配置 <a class="header-anchor" href="#应用配置" aria-label="Permalink to "应用配置""></a></h1><p>应用配置与站外文档配置分属两个仓库。这里说明 Ray Template 应用中的 <code>@/app-config</code>、Vite 配置和运行期设置。运行期保存的用户偏好可能覆盖源码默认值,验证默认设置时使用干净的浏览器存储。</p><table tabindex="0"><thead><tr><th>文件</th><th>配置</th></tr></thead><tbody><tr><td><code>apps/admin/src/app-config/app-config.ts</code></td><td><code>GLOBAL_CLASS_NAMES</code>(明暗类与 CSS 变量)、<code>MESSAGE_PROVIDER</code>(上下文消息,默认最多 5 条、不可关闭)、<code>LAYOUT_CONTENT_SPIN_WHEN_ROUTE_CHANGE</code>(默认关)、<code>APP_GLOBAL_LOADING</code>、<code>PRE_LOADING_CONFIG</code>、<code>APP_CATCH_KEY</code> / <code>APP_CATCH_KEY_PREFIX</code>、<code>CONTENT_TRANSITION_OPTIONS</code>。</td></tr><tr><td><code>apps/admin/src/app-config/design-config.ts</code></td><td><code>APP_THEME</code> 的候选色、构建品牌蓝 <code>#3b63d9</code>、现代化预设的明暗覆盖、ECharts 默认主题。四套预设在 <code>packages/ui/src/theme-presets.ts</code>。</td></tr><tr><td><code>apps/admin/src/app-config/local-config.ts</code></td><td><code>LOCAL_OPTIONS</code>、<code>SYSTEM_DEFAULT_LOCAL</code>、<code>SYSTEM_FALLBACK_LOCALE</code>、<code>DAYJS_LOCAL_MAP</code>、<code>DEFAULT_DAYJS_LOCAL</code>。默认与回退语言为 <code>zh-CN</code>。</td></tr><tr><td><code>apps/admin/src/app-config/request-config.ts</code></td><td><code>AXIOS_CONFIG</code>。默认同源相对地址、5 秒超时、<code>withCredentials: false</code>、JSON Content-Type。</td></tr><tr><td><code>apps/admin/src/app-config/router-config.ts</code></td><td><code>SETUP_ROUTER_ACTION</code>(加载条与守卫默认开)、<code>WHITE_ROUTES</code>(路由名白名单)、<code>SUPER_ADMIN</code>(默认空)、<code>LAYOUT_CONTENT_REF</code> / <code>LAYOUT_SIDER_REF</code>。</td></tr><tr><td><code>apps/admin/src/app-config/regex-config.ts</code></td><td><code>APP_REGEX</code>,模板 CSS 尺寸规则。</td></tr><tr><td><code>vite.custom.config.ts</code></td><td><code>base</code>、<code>server</code>、<code>buildOptions(mode)</code>、<code>alias</code>、<code>cdn</code>、<code>copyright</code>、Sass 注入和首屏加载配置。</td></tr></tbody></table><h2 id="选择改动入口" tabindex="-1">选择改动入口 <a class="header-anchor" href="#选择改动入口" aria-label="Permalink to "选择改动入口""></a></h2><ul><li>修改默认用户偏好(布局、菜单、标签、缓存)时看 <a href="./store/setting.html">Setting Store</a> 与 <code>apps/admin/src/store/modules/setting/constant.ts</code>。已有用户可在应用设置里恢复默认后检查效果。</li><li>修改主题或语言时看<a href="./../guide/appearance.html">主题和国际化</a>。新增语言同时维护翻译资源与 Day.js、Naive UI 对应关系。</li><li>修改访问控制时看<a href="./../guide/routing.html">路由指南</a>。白名单按区分大小写的字符串路由名判断,守卫先处理 token,再按白名单和角色处理导航。</li><li>修改 API 地址、认证头和失败策略时看<a href="./../guide/requests.html">接口与 Mock</a>。应用不会自动把任意 <code>VITE_*</code> 环境变量绑定到 Axios;需在配置中明确读取。</li><li>应用默认部署子路径 <code>/ray-template/</code>。部署子路径改变后重新构建并验证图标、代理和直达链接,见<a href="./../guide/tooling.html">工程与部署</a>。</li></ul><p><code>__APP_CFG__</code> 由 Vite 在构建时注入,用于应用包信息、版权与默认主色。任何注入到客户端的字段都可被浏览器读取。用于页面交互的运行态偏好走 Store,构建参数留在 Vite 配置。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/tree/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/app-config" target="_blank" rel="noreferrer">应用配置源码</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/vite.custom.config.ts" target="_blank" rel="noreferrer">Vite 自定义配置</a></p>',7)])])}const A=o(a,[["render",r]]);export{f as __pageData,A as default};
|
||||
@ -1 +1 @@
|
||||
import{_ as o,o as t,c as d,a3 as c}from"./chunks/framework.D8G7yXPy.js";const l=JSON.parse('{"title":"应用配置","description":"","frontmatter":{},"headers":[],"relativePath":"reference/configuration.md","filePath":"reference/configuration.md"}'),a={name:"reference/configuration.md"};function r(i,e,n,s,_,p){return t(),d("div",null,[...e[0]||(e[0]=[c("",7)])])}const A=o(a,[["render",r]]);export{l as __pageData,A as default};
|
||||
import{_ as o,o as t,c as d,a3 as c}from"./chunks/framework.D8G7yXPy.js";const f=JSON.parse('{"title":"应用配置","description":"","frontmatter":{},"headers":[],"relativePath":"reference/configuration.md","filePath":"reference/configuration.md"}'),a={name:"reference/configuration.md"};function r(i,e,n,s,_,p){return t(),d("div",null,[...e[0]||(e[0]=[c("",7)])])}const A=o(a,[["render",r]]);export{f as __pageData,A as default};
|
||||
@ -1,4 +1,4 @@
|
||||
import{_ as V}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPcM-fsm.js";import{u as P}from"./chunks/index.DNzt2uky.js";import{l as B,r as G}from"./chunks/light.BQgF5P5u.js";import{i as L}from"./chunks/isSymbol.rCNNreax.js";import{B as M,_ as O}from"./chunks/DemoFrame.vue_vue_type_script_setup_true_lang.BibqOSJQ.js";import{d as W,o as m,b as A,w as N,j as _,a5 as X,k as x,a as j,t as H,p as U,c as K,a3 as C,E as q}from"./chunks/framework.D8G7yXPy.js";var J=/\s/;function z(s){for(var i=s.length;i--&&J.test(s.charAt(i)););return i}var Y=/^\s+/;function Q(s){return s&&s.slice(0,z(s)+1).replace(Y,"")}var T=NaN,Z=/^[-+]0x[0-9a-f]+$/i,ss=/^0b[01]+$/i,is=/^0o[0-7]+$/i,as=parseInt;function w(s){if(typeof s=="number")return s;if(L(s))return T;if(B(s)){var i=typeof s.valueOf=="function"?s.valueOf():s;s=B(i)?i+"":i}if(typeof s!="string")return s===0?s:+s;s=Q(s);var a=ss.test(s);return a||is.test(s)?as(s.slice(2),a?2:8):Z.test(s)?T:+s}var u=function(){return G.Date.now()},ns="Expected a function",hs=Math.max,ts=Math.min;function ls(s,i,a){var t,p,l,e,h,k,r=0,D=!1,d=!1,F=!0;if(typeof s!="function")throw new TypeError(ns);i=w(i)||0,B(a)&&(D=!!a.leading,d="maxWait"in a,l=d?hs(w(a.maxWait)||0,i):l,F="trailing"in a?!!a.trailing:F);function c(n){var E=t,g=p;return t=p=void 0,r=n,e=s.apply(g,E),e}function I(n){return r=n,h=setTimeout(y,i),D?c(n):e}function S(n){var E=n-k,g=n-r,f=i-E;return d?ts(f,l-g):f}function b(n){var E=n-k,g=n-r;return k===void 0||E>=i||E<0||d&&g>=l}function y(){var n=u();if(b(n))return v(n);h=setTimeout(y,S(n))}function v(n){return h=void 0,F&&t?c(n):(t=p=void 0,e)}function $(){h!==void 0&&clearTimeout(h),r=0,t=k=p=h=void 0}function R(){return h===void 0?e:v(u())}function o(){var n=u(),E=b(n);if(t=arguments,p=this,k=n,E){if(h===void 0)return I(k);if(d)return clearTimeout(h),h=setTimeout(y,i),c(k)}return h===void 0&&(h=setTimeout(y,i)),e}return o.cancel=$,o.flush=R,o}const ks=()=>{const s=new WeakMap;return{beforeMount:(i,{value:a})=>{const{func:t,trigger:p="click",wait:l=500,options:e}=a;if(typeof t!="function")throw new TypeError("debounce directive value must be a function");const h=ls(t,l,e),k=P(i,p,h);s.set(i,()=>{h.cancel(),k()})},beforeUnmount(i){var a;(a=s.get(i))==null||a(),s.delete(i)}}},ps={class:"ray-demo"},es={class:"ray-demo-result"},Es=W({__name:"DebounceDemo",setup(s){const i=ks(),a=U(0),t=()=>{a.value+=1};return(p,l)=>(m(),A(O,null,{default:N(()=>[_("div",ps,[X((m(),A(x(M),null,{default:N(()=>[...l[0]||(l[0]=[j(" 连续点击 / Click repeatedly ",-1)])]),_:1})),[[x(i),{wait:500,func:t}]]),_("output",es,"执行次数 / Calls: "+H(a.value),1)])]),_:1}))}}),Cs=JSON.parse('{"title":"指令","description":"","frontmatter":{},"headers":[],"relativePath":"reference/directives.md","filePath":"reference/directives.md"}'),rs={name:"reference/directives.md"},us=Object.assign(rs,{setup(s){return(i,a)=>(m(),K("div",null,[a[0]||(a[0]=C('<h1 id="指令" tabindex="-1">指令 <a class="header-anchor" href="#指令" aria-label="Permalink to "指令""></a></h1><p>应用在 <code>main.ts</code> 调用 <code>setupDirectives(app)</code>。注册器查找 <code>packages/directives/src/modules/<name>/index.ts</code>,调用默认导出的工厂,将返回的 Vue Directive 以目录名注册。SFC 中可直接用 <code>v-<name></code>;从文件名和源码进入可查各指令的绑定类型。</p><h2 id="交互示例" tabindex="-1">交互示例 <a class="header-anchor" href="#交互示例" aria-label="Permalink to "交互示例""></a></h2><p>在同一示例操作复制、节流、防抖、文本省略、波纹与禁用。下方防抖小例可以快速对照计数。</p>',4)),q(V,{path:"/directive",title:"六种指令的交互示例",height:550}),a[1]||(a[1]=C(`<details class="details custom-block"><summary>查看完整指令示例源码</summary><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { ConditionalPick } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@/types'</span></span>
|
||||
import{_ as V}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPcM-fsm.js";import{u as P}from"./chunks/index.DNzt2uky.js";import{l as B,r as G}from"./chunks/light.BQgF5P5u.js";import{i as L}from"./chunks/isSymbol.rCNNreax.js";import{B as M,_ as O}from"./chunks/DemoFrame.vue_vue_type_script_setup_true_lang.BibqOSJQ.js";import{d as W,o as m,b as A,w as N,j as _,a5 as X,k as x,a as j,t as H,p as U,c as K,a3 as C,E as q}from"./chunks/framework.D8G7yXPy.js";var J=/\s/;function z(s){for(var i=s.length;i--&&J.test(s.charAt(i)););return i}var Y=/^\s+/;function Q(s){return s&&s.slice(0,z(s)+1).replace(Y,"")}var T=NaN,Z=/^[-+]0x[0-9a-f]+$/i,ss=/^0b[01]+$/i,is=/^0o[0-7]+$/i,as=parseInt;function w(s){if(typeof s=="number")return s;if(L(s))return T;if(B(s)){var i=typeof s.valueOf=="function"?s.valueOf():s;s=B(i)?i+"":i}if(typeof s!="string")return s===0?s:+s;s=Q(s);var a=ss.test(s);return a||is.test(s)?as(s.slice(2),a?2:8):Z.test(s)?T:+s}var u=function(){return G.Date.now()},ns="Expected a function",hs=Math.max,ts=Math.min;function ls(s,i,a){var t,p,l,e,h,k,r=0,D=!1,d=!1,F=!0;if(typeof s!="function")throw new TypeError(ns);i=w(i)||0,B(a)&&(D=!!a.leading,d="maxWait"in a,l=d?hs(w(a.maxWait)||0,i):l,F="trailing"in a?!!a.trailing:F);function c(n){var E=t,g=p;return t=p=void 0,r=n,e=s.apply(g,E),e}function I(n){return r=n,h=setTimeout(y,i),D?c(n):e}function S(n){var E=n-k,g=n-r,f=i-E;return d?ts(f,l-g):f}function v(n){var E=n-k,g=n-r;return k===void 0||E>=i||E<0||d&&g>=l}function y(){var n=u();if(v(n))return b(n);h=setTimeout(y,S(n))}function b(n){return h=void 0,F&&t?c(n):(t=p=void 0,e)}function $(){h!==void 0&&clearTimeout(h),r=0,t=k=p=h=void 0}function R(){return h===void 0?e:b(u())}function o(){var n=u(),E=v(n);if(t=arguments,p=this,k=n,E){if(h===void 0)return I(k);if(d)return clearTimeout(h),h=setTimeout(y,i),c(k)}return h===void 0&&(h=setTimeout(y,i)),e}return o.cancel=$,o.flush=R,o}const ks=()=>{const s=new WeakMap;return{beforeMount:(i,{value:a})=>{const{func:t,trigger:p="click",wait:l=500,options:e}=a;if(typeof t!="function")throw new TypeError("debounce directive value must be a function");const h=ls(t,l,e),k=P(i,p,h);s.set(i,()=>{h.cancel(),k()})},beforeUnmount(i){var a;(a=s.get(i))==null||a(),s.delete(i)}}},ps={class:"ray-demo"},es={class:"ray-demo-result"},Es=W({__name:"DebounceDemo",setup(s){const i=ks(),a=U(0),t=()=>{a.value+=1};return(p,l)=>(m(),A(O,null,{default:N(()=>[_("div",ps,[X((m(),A(x(M),null,{default:N(()=>[...l[0]||(l[0]=[j(" 连续点击 / Click repeatedly ",-1)])]),_:1})),[[x(i),{wait:500,func:t}]]),_("output",es,"执行次数 / Calls: "+H(a.value),1)])]),_:1}))}}),Cs=JSON.parse('{"title":"指令","description":"","frontmatter":{},"headers":[],"relativePath":"reference/directives.md","filePath":"reference/directives.md"}'),rs={name:"reference/directives.md"},us=Object.assign(rs,{setup(s){return(i,a)=>(m(),K("div",null,[a[0]||(a[0]=C('<h1 id="指令" tabindex="-1">指令 <a class="header-anchor" href="#指令" aria-label="Permalink to "指令""></a></h1><p>应用在 <code>main.ts</code> 调用 <code>setupDirectives(app)</code>。注册器查找 <code>packages/directives/src/modules/<name>/index.ts</code>,调用默认导出的工厂,将返回的 Vue Directive 以目录名注册。SFC 中可直接用 <code>v-<name></code>;从文件名和源码进入可查各指令的绑定类型。</p><h2 id="交互示例" tabindex="-1">交互示例 <a class="header-anchor" href="#交互示例" aria-label="Permalink to "交互示例""></a></h2><p>在同一示例操作复制、节流、防抖、文本省略、波纹与禁用。下方防抖小例可以快速对照计数。</p>',4)),q(V,{path:"/directive",title:"六种指令的交互示例",height:550}),a[1]||(a[1]=C(`<details class="details custom-block"><summary>查看完整指令示例源码</summary><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { ConditionalPick } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@/types'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> NAlert,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> NButton,</span></span>
|
||||
@ -214,7 +214,7 @@ import{_ as V}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> RDirective</span></span></code></pre></div></details><h2 id="v-copy" tabindex="-1">v-copy <a class="header-anchor" href="#v-copy" aria-label="Permalink to "v-copy""></a></h2><p>绑定要复制的字符串;绑定值改变时销毁并重建 ClipboardJS 实例,卸载时销毁。Ray Admin 注册时接入消息提示。独立使用 <code>createCopyDirective</code> 时可提供自己的结果回调。复制应由用户点击触发。数字等值请先显式转为字符串。</p><div class="language-vue vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">button</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"button"</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> v-copy</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"'ORD-001'"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>复制订单号</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">button</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/directives/src/modules/copy/index.ts" target="_blank" rel="noreferrer">源码</a></p><h2 id="v-debounce-与-v-throttle" tabindex="-1">v-debounce 与 v-throttle <a class="header-anchor" href="#v-debounce-与-v-throttle" aria-label="Permalink to "v-debounce 与 v-throttle""></a></h2><p>连续点击按钮,停止 500ms 后,防抖只执行一次。</p>`,7)),q(Es),a[2]||(a[2]=C(`<details class="details custom-block"><summary>查看示例源码</summary><div class="language-vue vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/directives/src/modules/copy/index.ts" target="_blank" rel="noreferrer">源码</a></p><h2 id="v-debounce-与-v-throttle" tabindex="-1">v-debounce 与 v-throttle <a class="header-anchor" href="#v-debounce-与-v-throttle" aria-label="Permalink to "v-debounce 与 v-throttle""></a></h2><p>连续点击按钮,停止 500ms 后,防抖只执行一次。</p>`,7)),q(Es),a[2]||(a[2]=C(`<details class="details custom-block"><summary>查看示例源码</summary><div class="language-vue vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">DemoFrame</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">div</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ray-demo"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">NButton</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> v-debounce</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"{ wait: 500, func: increment }"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
@ -260,13 +260,13 @@ import{_ as V}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">button</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"button"</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> v-throttle</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"{ func: countClick, wait: 1000 }"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> 点击次数 {{ clicks }}</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">button</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><ul><li><code>options.leading</code> / <code>trailing</code> 决定在等待周期首尾是否执行;防抖还可设 <code>maxWait</code>。挂载时读取绑定值,更新不会重绑。若回调依赖变动数据,让原函数在执行时读取响应式值。</li><li>当前实现将监听器句柄保存在指令工厂闭包,多个绑定实例共用同一清理位置。需要同一指令同时绑多个元素或动态修改间隔时,在组件里单独创建防抖或节流函数并清理。</li><li>防抖和节流只约束事件触发,异步请求仍需独立处理取消、并发或幂等。</li></ul><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/directives/src/modules/debounce/index.ts" target="_blank" rel="noreferrer">防抖源码</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/directives/src/modules/throttle/index.ts" target="_blank" rel="noreferrer">节流源码</a></p><h2 id="v-ellipsis" tabindex="-1">v-ellipsis <a class="header-anchor" href="#v-ellipsis" aria-label="Permalink to "v-ellipsis""></a></h2><p><code>width</code> 必填,数字按像素;字符串可传 CSS 尺寸。<code>type: 'block'</code> 做单行省略,<code>type: 'line'</code> 使用 <code>line</code> 行截断,默认按单行处理。<code>popoverText: true</code> 把当前文本写入原生 <code>title</code>,不创建 Popover。挂载和更新时写入样式;切换模式或关掉悬浮文本不会自动删除上一次写入的样式或 <code>title</code>。经常切换的场景可以改用组件库的省略组件,或切换节点 <code>key</code>。</p><div class="language-vue vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><ul><li><code>options.leading</code> / <code>trailing</code> 决定在等待周期首尾是否执行;防抖还可设 <code>maxWait</code>。挂载时读取绑定值,更新不会重绑。若回调依赖变动数据,让原函数在执行时读取响应式值。</li><li>当前实现将监听器句柄保存在指令工厂闭包,多个绑定实例共用同一清理位置。需要同一指令同时绑多个元素或动态修改间隔时,在组件里单独创建防抖或节流函数并清理。</li><li>防抖和节流只约束事件触发,异步请求仍需独立处理取消、并发或幂等。</li></ul><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/directives/src/modules/debounce/index.ts" target="_blank" rel="noreferrer">防抖源码</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/directives/src/modules/throttle/index.ts" target="_blank" rel="noreferrer">节流源码</a></p><h2 id="v-ellipsis" tabindex="-1">v-ellipsis <a class="header-anchor" href="#v-ellipsis" aria-label="Permalink to "v-ellipsis""></a></h2><p><code>width</code> 必填,数字按像素;字符串可传 CSS 尺寸。<code>type: 'block'</code> 做单行省略,<code>type: 'line'</code> 使用 <code>line</code> 行截断,默认按单行处理。<code>popoverText: true</code> 把当前文本写入原生 <code>title</code>,不创建 Popover。挂载和更新时写入样式;切换模式或关掉悬浮文本不会自动删除上一次写入的样式或 <code>title</code>。经常切换的场景可以改用组件库的省略组件,或切换节点 <code>key</code>。</p><div class="language-vue vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">p</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> v-ellipsis</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"{ type: 'line', line: 2, width: 240, popoverText: true }"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> 这里放较长的说明文字,超出两行后会被省略。</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">p</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/directives/src/modules/ellipsis/index.ts" target="_blank" rel="noreferrer">源码</a></p><h2 id="v-ripple" tabindex="-1">v-ripple <a class="header-anchor" href="#v-ripple" aria-label="Permalink to "v-ripple""></a></h2><p>省略绑定值或传 <code>true</code> 启用,<code>false</code> 关闭。绑定对象 <code>{ class: '...' }</code> 可指定波纹样式。<code>.center</code> 从中心扩散,<code>.circle</code> 使用圆形计算。通过 pointer 事件渲染,属于视觉反馈,交互语义仍由外层按钮负责。</p><div class="language-vue vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/directives/src/modules/ellipsis/index.ts" target="_blank" rel="noreferrer">源码</a></p><h2 id="v-ripple" tabindex="-1">v-ripple <a class="header-anchor" href="#v-ripple" aria-label="Permalink to "v-ripple""></a></h2><p>省略绑定值或传 <code>true</code> 启用,<code>false</code> 关闭。绑定对象 <code>{ class: '...' }</code> 可指定波纹样式。<code>.center</code> 从中心扩散,<code>.circle</code> 使用圆形计算。通过 pointer 事件渲染,属于视觉反馈,交互语义仍由外层按钮负责。</p><div class="language-vue vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">button</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"button"</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> v-ripple.center.circle</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>查看详情</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">button</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/directives/src/modules/ripple/index.ts" target="_blank" rel="noreferrer">源码</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/directives/src/modules/ripple/utils.ts" target="_blank" rel="noreferrer">绑定与清理</a></p><h2 id="v-disabled" tabindex="-1">v-disabled <a class="header-anchor" href="#v-disabled" aria-label="Permalink to "v-disabled""></a></h2><p>接收布尔值并修改原生 <code>disabled</code> 属性和模板禁用样式。当前实现关闭禁用时仍会写入空的 <code>disabled</code> 属性,HTML 原生按钮将继续视为禁用。因此原生控件使用 <code>:disabled="busy"</code>,Naive UI 使用对应 <code>disabled</code> prop。对自定义控件,要同时处理指针、键盘与可访问状态;样式不能取代业务权限检查。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/directives/src/modules/disabled/index.ts" target="_blank" rel="noreferrer">源码</a></p><h2 id="新增指令" tabindex="-1">新增指令 <a class="header-anchor" href="#新增指令" aria-label="Permalink to "新增指令""></a></h2><p>每个指令放在单独目录,工厂默认导出。可用 <code>CustomDirectiveFC<HTMLElement, T></code> 标注绑定值。在 <code>mounted</code> 取得元素,在 <code>updated</code> 处理值更新,在 <code>beforeUnmount</code> 释放事件、计时器和第三方实例。多个元素需要独立数据时,把状态放在元素关联的 <code>WeakMap</code>,避免用单个变量保存全部实例的资源。</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { CustomDirectiveFC } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@/directives/types'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/directives/src/modules/ripple/index.ts" target="_blank" rel="noreferrer">源码</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/directives/src/modules/ripple/utils.ts" target="_blank" rel="noreferrer">绑定与清理</a></p><h2 id="v-disabled" tabindex="-1">v-disabled <a class="header-anchor" href="#v-disabled" aria-label="Permalink to "v-disabled""></a></h2><p>接收布尔值并修改原生 <code>disabled</code> 属性和模板禁用样式。当前实现关闭禁用时仍会写入空的 <code>disabled</code> 属性,HTML 原生按钮将继续视为禁用。因此原生控件使用 <code>:disabled="busy"</code>,Naive UI 使用对应 <code>disabled</code> prop。对自定义控件,要同时处理指针、键盘与可访问状态;样式不能取代业务权限检查。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/directives/src/modules/disabled/index.ts" target="_blank" rel="noreferrer">源码</a></p><h2 id="新增指令" tabindex="-1">新增指令 <a class="header-anchor" href="#新增指令" aria-label="Permalink to "新增指令""></a></h2><p>每个指令放在单独目录,工厂默认导出。可用 <code>CustomDirectiveFC<HTMLElement, T></code> 标注绑定值。在 <code>mounted</code> 取得元素,在 <code>updated</code> 处理值更新,在 <code>beforeUnmount</code> 释放事件、计时器和第三方实例。多个元素需要独立数据时,把状态放在元素关联的 <code>WeakMap</code>,避免用单个变量保存全部实例的资源。</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { CustomDirectiveFC } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@/directives/types'</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> focusWhen</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> CustomDirectiveFC</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">HTMLElement</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">boolean</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">> </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ({</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> mounted</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">el</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">value</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }) {</span></span>
|
||||
@ -277,4 +277,4 @@ import{_ as V}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> focusWhen</span></span></code></pre></div><p>将示例保存为 <code>packages/directives/src/modules/focus-when/index.ts</code>,在组件中用 <code>v-focus-when</code>。目录名按现有约定用单段小写 kebab-case。注册器要求默认导出函数,缺失会抛错。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/directives/src/index.ts" target="_blank" rel="noreferrer">注册入口</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/directives/src/types.ts" target="_blank" rel="noreferrer">指令类型</a></p>`,21))]))}});export{Cs as __pageData,us as default};
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> focusWhen</span></span></code></pre></div><p>将示例保存为 <code>packages/directives/src/modules/focus-when/index.ts</code>,在组件中用 <code>v-focus-when</code>。目录名按现有约定用单段小写 kebab-case。注册器要求默认导出函数,缺失会抛错。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/directives/src/index.ts" target="_blank" rel="noreferrer">注册入口</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/directives/src/types.ts" target="_blank" rel="noreferrer">指令类型</a></p>`,21))]))}});export{Cs as __pageData,us as default};
|
||||
@ -1 +1 @@
|
||||
import{_ as V}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPcM-fsm.js";import{u as P}from"./chunks/index.DNzt2uky.js";import{l as B,r as G}from"./chunks/light.BQgF5P5u.js";import{i as L}from"./chunks/isSymbol.rCNNreax.js";import{B as M,_ as O}from"./chunks/DemoFrame.vue_vue_type_script_setup_true_lang.BibqOSJQ.js";import{d as W,o as m,b as A,w as N,j as _,a5 as X,k as x,a as j,t as H,p as U,c as K,a3 as C,E as q}from"./chunks/framework.D8G7yXPy.js";var J=/\s/;function z(s){for(var i=s.length;i--&&J.test(s.charAt(i)););return i}var Y=/^\s+/;function Q(s){return s&&s.slice(0,z(s)+1).replace(Y,"")}var T=NaN,Z=/^[-+]0x[0-9a-f]+$/i,ss=/^0b[01]+$/i,is=/^0o[0-7]+$/i,as=parseInt;function w(s){if(typeof s=="number")return s;if(L(s))return T;if(B(s)){var i=typeof s.valueOf=="function"?s.valueOf():s;s=B(i)?i+"":i}if(typeof s!="string")return s===0?s:+s;s=Q(s);var a=ss.test(s);return a||is.test(s)?as(s.slice(2),a?2:8):Z.test(s)?T:+s}var u=function(){return G.Date.now()},ns="Expected a function",hs=Math.max,ts=Math.min;function ls(s,i,a){var t,p,l,e,h,k,r=0,D=!1,d=!1,F=!0;if(typeof s!="function")throw new TypeError(ns);i=w(i)||0,B(a)&&(D=!!a.leading,d="maxWait"in a,l=d?hs(w(a.maxWait)||0,i):l,F="trailing"in a?!!a.trailing:F);function c(n){var E=t,g=p;return t=p=void 0,r=n,e=s.apply(g,E),e}function I(n){return r=n,h=setTimeout(y,i),D?c(n):e}function S(n){var E=n-k,g=n-r,f=i-E;return d?ts(f,l-g):f}function b(n){var E=n-k,g=n-r;return k===void 0||E>=i||E<0||d&&g>=l}function y(){var n=u();if(b(n))return v(n);h=setTimeout(y,S(n))}function v(n){return h=void 0,F&&t?c(n):(t=p=void 0,e)}function $(){h!==void 0&&clearTimeout(h),r=0,t=k=p=h=void 0}function R(){return h===void 0?e:v(u())}function o(){var n=u(),E=b(n);if(t=arguments,p=this,k=n,E){if(h===void 0)return I(k);if(d)return clearTimeout(h),h=setTimeout(y,i),c(k)}return h===void 0&&(h=setTimeout(y,i)),e}return o.cancel=$,o.flush=R,o}const ks=()=>{const s=new WeakMap;return{beforeMount:(i,{value:a})=>{const{func:t,trigger:p="click",wait:l=500,options:e}=a;if(typeof t!="function")throw new TypeError("debounce directive value must be a function");const h=ls(t,l,e),k=P(i,p,h);s.set(i,()=>{h.cancel(),k()})},beforeUnmount(i){var a;(a=s.get(i))==null||a(),s.delete(i)}}},ps={class:"ray-demo"},es={class:"ray-demo-result"},Es=W({__name:"DebounceDemo",setup(s){const i=ks(),a=U(0),t=()=>{a.value+=1};return(p,l)=>(m(),A(O,null,{default:N(()=>[_("div",ps,[X((m(),A(x(M),null,{default:N(()=>[...l[0]||(l[0]=[j(" 连续点击 / Click repeatedly ",-1)])]),_:1})),[[x(i),{wait:500,func:t}]]),_("output",es,"执行次数 / Calls: "+H(a.value),1)])]),_:1}))}}),Cs=JSON.parse('{"title":"指令","description":"","frontmatter":{},"headers":[],"relativePath":"reference/directives.md","filePath":"reference/directives.md"}'),rs={name:"reference/directives.md"},us=Object.assign(rs,{setup(s){return(i,a)=>(m(),K("div",null,[a[0]||(a[0]=C("",4)),q(V,{path:"/directive",title:"六种指令的交互示例",height:550}),a[1]||(a[1]=C("",7)),q(Es),a[2]||(a[2]=C("",21))]))}});export{Cs as __pageData,us as default};
|
||||
import{_ as V}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPcM-fsm.js";import{u as P}from"./chunks/index.DNzt2uky.js";import{l as B,r as G}from"./chunks/light.BQgF5P5u.js";import{i as L}from"./chunks/isSymbol.rCNNreax.js";import{B as M,_ as O}from"./chunks/DemoFrame.vue_vue_type_script_setup_true_lang.BibqOSJQ.js";import{d as W,o as m,b as A,w as N,j as _,a5 as X,k as x,a as j,t as H,p as U,c as K,a3 as C,E as q}from"./chunks/framework.D8G7yXPy.js";var J=/\s/;function z(s){for(var i=s.length;i--&&J.test(s.charAt(i)););return i}var Y=/^\s+/;function Q(s){return s&&s.slice(0,z(s)+1).replace(Y,"")}var T=NaN,Z=/^[-+]0x[0-9a-f]+$/i,ss=/^0b[01]+$/i,is=/^0o[0-7]+$/i,as=parseInt;function w(s){if(typeof s=="number")return s;if(L(s))return T;if(B(s)){var i=typeof s.valueOf=="function"?s.valueOf():s;s=B(i)?i+"":i}if(typeof s!="string")return s===0?s:+s;s=Q(s);var a=ss.test(s);return a||is.test(s)?as(s.slice(2),a?2:8):Z.test(s)?T:+s}var u=function(){return G.Date.now()},ns="Expected a function",hs=Math.max,ts=Math.min;function ls(s,i,a){var t,p,l,e,h,k,r=0,D=!1,d=!1,F=!0;if(typeof s!="function")throw new TypeError(ns);i=w(i)||0,B(a)&&(D=!!a.leading,d="maxWait"in a,l=d?hs(w(a.maxWait)||0,i):l,F="trailing"in a?!!a.trailing:F);function c(n){var E=t,g=p;return t=p=void 0,r=n,e=s.apply(g,E),e}function I(n){return r=n,h=setTimeout(y,i),D?c(n):e}function S(n){var E=n-k,g=n-r,f=i-E;return d?ts(f,l-g):f}function v(n){var E=n-k,g=n-r;return k===void 0||E>=i||E<0||d&&g>=l}function y(){var n=u();if(v(n))return b(n);h=setTimeout(y,S(n))}function b(n){return h=void 0,F&&t?c(n):(t=p=void 0,e)}function $(){h!==void 0&&clearTimeout(h),r=0,t=k=p=h=void 0}function R(){return h===void 0?e:b(u())}function o(){var n=u(),E=v(n);if(t=arguments,p=this,k=n,E){if(h===void 0)return I(k);if(d)return clearTimeout(h),h=setTimeout(y,i),c(k)}return h===void 0&&(h=setTimeout(y,i)),e}return o.cancel=$,o.flush=R,o}const ks=()=>{const s=new WeakMap;return{beforeMount:(i,{value:a})=>{const{func:t,trigger:p="click",wait:l=500,options:e}=a;if(typeof t!="function")throw new TypeError("debounce directive value must be a function");const h=ls(t,l,e),k=P(i,p,h);s.set(i,()=>{h.cancel(),k()})},beforeUnmount(i){var a;(a=s.get(i))==null||a(),s.delete(i)}}},ps={class:"ray-demo"},es={class:"ray-demo-result"},Es=W({__name:"DebounceDemo",setup(s){const i=ks(),a=U(0),t=()=>{a.value+=1};return(p,l)=>(m(),A(O,null,{default:N(()=>[_("div",ps,[X((m(),A(x(M),null,{default:N(()=>[...l[0]||(l[0]=[j(" 连续点击 / Click repeatedly ",-1)])]),_:1})),[[x(i),{wait:500,func:t}]]),_("output",es,"执行次数 / Calls: "+H(a.value),1)])]),_:1}))}}),Cs=JSON.parse('{"title":"指令","description":"","frontmatter":{},"headers":[],"relativePath":"reference/directives.md","filePath":"reference/directives.md"}'),rs={name:"reference/directives.md"},us=Object.assign(rs,{setup(s){return(i,a)=>(m(),K("div",null,[a[0]||(a[0]=C("",4)),q(V,{path:"/directive",title:"六种指令的交互示例",height:550}),a[1]||(a[1]=C("",7)),q(Es),a[2]||(a[2]=C("",21))]))}});export{Cs as __pageData,us as default};
|
||||
@ -1 +1 @@
|
||||
import{_ as o,o as t,c as a,a3 as d}from"./chunks/framework.D8G7yXPy.js";const k=JSON.parse('{"title":"Hooks","description":"","frontmatter":{},"headers":[],"relativePath":"reference/hooks.md","filePath":"reference/hooks.md"}'),r={name:"reference/hooks.md"};function s(c,e,h,n,l,f){return t(),a("div",null,[...e[0]||(e[0]=[d('<h1 id="hooks" tabindex="-1">Hooks <a class="header-anchor" href="#hooks" aria-label="Permalink to "Hooks""></a></h1><p>模板的公开 Hooks 从 <code>@/hooks</code> 导入。与具体组件一起使用的 <code>useForm</code>、<code>useModal</code>、<code>useChart</code>、<code>useFlow</code> 从 <code>@/components</code> 导入,请看对应组件页。<code>useRequest</code> 从 <code>@/axios</code> 导入。</p><table tabindex="0"><thead><tr><th>需求</th><th>API</th></tr></thead><tbody><tr><td>跳转页面,操作标签和菜单标记</td><td><a href="./hooks/navigation.html">导航与菜单</a></td></tr><tr><td>内容最大化、重载或滚动</td><td><a href="./hooks/layout.html">布局与滚动</a></td></tr><tr><td>主题、语言、水印</td><td><a href="./hooks/appearance.html">主题与国际化</a></td></tr><tr><td>分页与右键菜单</td><td><a href="./hooks/interaction.html">组件交互</a></td></tr><tr><td>窗口尺寸、元素全屏和日期</td><td><a href="./hooks/browser.html">窗口与日期</a></td></tr><tr><td>DOM 截图、打印</td><td><a href="./hooks/output.html">截图与打印</a></td></tr></tbody></table><p>需要订阅、事件或清理的 Hook 在 <code>setup()</code> 或有效的 Vue effect scope 中创建。在 DOM 挂载后或用户操作时执行截图、打印和全屏。<code>BasicTarget</code> 接受元素、ref 或 getter,解析规则和可用元素类型见<a href="./utils/browser.html#vue-目标解析">Vue 与 DOM 目标</a>。</p><p>项目保留 <code>@/hooks/web/useI18n</code>、<code>@/hooks/web/useVueRouter</code>、<code>@/hooks/web/usePagination</code> 作为兼容导入。新代码统一从 <code>@/hooks</code> 导入。实现和测试入口见<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/hooks/README.md" target="_blank" rel="noreferrer">源码 Hooks 索引</a>。</p>',5)])])}const u=o(r,[["render",s]]);export{k as __pageData,u as default};
|
||||
import{_ as o,o as t,c as a,a3 as d}from"./chunks/framework.D8G7yXPy.js";const k=JSON.parse('{"title":"Hooks","description":"","frontmatter":{},"headers":[],"relativePath":"reference/hooks.md","filePath":"reference/hooks.md"}'),r={name:"reference/hooks.md"};function s(c,e,h,n,l,i){return t(),a("div",null,[...e[0]||(e[0]=[d('<h1 id="hooks" tabindex="-1">Hooks <a class="header-anchor" href="#hooks" aria-label="Permalink to "Hooks""></a></h1><p>模板的公开 Hooks 从 <code>@/hooks</code> 导入。与具体组件一起使用的 <code>useForm</code>、<code>useModal</code>、<code>useChart</code>、<code>useFlow</code> 从 <code>@/components</code> 导入,请看对应组件页。<code>useRequest</code> 从 <code>@/axios</code> 导入。</p><table tabindex="0"><thead><tr><th>需求</th><th>API</th></tr></thead><tbody><tr><td>跳转页面,操作标签和菜单标记</td><td><a href="./hooks/navigation.html">导航与菜单</a></td></tr><tr><td>内容最大化、重载或滚动</td><td><a href="./hooks/layout.html">布局与滚动</a></td></tr><tr><td>主题、语言、水印</td><td><a href="./hooks/appearance.html">主题与国际化</a></td></tr><tr><td>分页与右键菜单</td><td><a href="./hooks/interaction.html">组件交互</a></td></tr><tr><td>窗口尺寸、元素全屏和日期</td><td><a href="./hooks/browser.html">窗口与日期</a></td></tr><tr><td>DOM 截图、打印</td><td><a href="./hooks/output.html">截图与打印</a></td></tr></tbody></table><p>需要订阅、事件或清理的 Hook 在 <code>setup()</code> 或有效的 Vue effect scope 中创建。在 DOM 挂载后或用户操作时执行截图、打印和全屏。<code>BasicTarget</code> 接受元素、ref 或 getter,解析规则和可用元素类型见<a href="./utils/browser.html#vue-目标解析">Vue 与 DOM 目标</a>。</p><p>项目保留 <code>@/hooks/web/useI18n</code>、<code>@/hooks/web/useVueRouter</code>、<code>@/hooks/web/usePagination</code> 作为兼容导入。新代码统一从 <code>@/hooks</code> 导入。实现和测试入口见<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/hooks/README.md" target="_blank" rel="noreferrer">源码 Hooks 索引</a>。</p>',5)])])}const u=o(r,[["render",s]]);export{k as __pageData,u as default};
|
||||
@ -1 +1 @@
|
||||
import{_ as o,o as t,c as a,a3 as d}from"./chunks/framework.D8G7yXPy.js";const k=JSON.parse('{"title":"Hooks","description":"","frontmatter":{},"headers":[],"relativePath":"reference/hooks.md","filePath":"reference/hooks.md"}'),r={name:"reference/hooks.md"};function s(c,e,h,n,l,f){return t(),a("div",null,[...e[0]||(e[0]=[d("",5)])])}const u=o(r,[["render",s]]);export{k as __pageData,u as default};
|
||||
import{_ as o,o as t,c as a,a3 as d}from"./chunks/framework.D8G7yXPy.js";const k=JSON.parse('{"title":"Hooks","description":"","frontmatter":{},"headers":[],"relativePath":"reference/hooks.md","filePath":"reference/hooks.md"}'),r={name:"reference/hooks.md"};function s(c,e,h,n,l,i){return t(),a("div",null,[...e[0]||(e[0]=[d("",5)])])}const u=o(r,[["render",s]]);export{k as __pageData,u as default};
|
||||
@ -664,4 +664,4 @@ import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> disable: hiddenWatermark,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>源码:<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/hooks/template/useTheme.ts" target="_blank" rel="noreferrer">useTheme</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/hooks/template/useI18n.ts" target="_blank" rel="noreferrer">useI18n</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/hooks/template/useWatermark.ts" target="_blank" rel="noreferrer">useWatermark</a></p>`,8))]))}});export{d as __pageData,y as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>源码:<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/hooks/template/useTheme.ts" target="_blank" rel="noreferrer">useTheme</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/hooks/template/useI18n.ts" target="_blank" rel="noreferrer">useI18n</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/hooks/template/useWatermark.ts" target="_blank" rel="noreferrer">useWatermark</a></p>`,8))]))}});export{d as __pageData,y as default};
|
||||
@ -385,4 +385,4 @@ import{_ as j}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> day</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useDayjs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> exportDate</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> day.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">format</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'2026-11-03'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { format: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'YYYY-MM-DD'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> dayRange</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> day.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getStartAndEndOfDay</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span></code></pre></div><p>源码:<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/composables/src/useDevice.ts" target="_blank" rel="noreferrer">useDevice</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/composables/src/useElementFullscreen.ts" target="_blank" rel="noreferrer">useElementFullscreen</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/composables/src/useDayjs.ts" target="_blank" rel="noreferrer">useDayjs</a></p>`,10))]))}});export{ps as __pageData,es as default};
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> dayRange</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> day.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getStartAndEndOfDay</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span></code></pre></div><p>源码:<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/composables/src/useDevice.ts" target="_blank" rel="noreferrer">useDevice</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/composables/src/useElementFullscreen.ts" target="_blank" rel="noreferrer">useElementFullscreen</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/composables/src/useDayjs.ts" target="_blank" rel="noreferrer">useDayjs</a></p>`,10))]))}});export{ps as __pageData,es as default};
|
||||
@ -369,4 +369,4 @@ import{_ as n}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">div</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><p>源码:<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/composables/src/usePagination.ts" target="_blank" rel="noreferrer">usePagination</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/composables/src/useContextmenuCoordinate.ts" target="_blank" rel="noreferrer">useContextmenuCoordinate</a></p>`,11))]))}});export{d as __pageData,y as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><p>源码:<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/composables/src/usePagination.ts" target="_blank" rel="noreferrer">usePagination</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/composables/src/useContextmenuCoordinate.ts" target="_blank" rel="noreferrer">useContextmenuCoordinate</a></p>`,11))]))}});export{d as __pageData,y as default};
|
||||
@ -328,4 +328,4 @@ import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> toTop</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> scrollContent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">),</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> toMenuTop</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> scrollSider</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">),</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>源码:<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/hooks/template/useMaximize.ts" target="_blank" rel="noreferrer">useMaximize</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/hooks/template/useSpinning.ts" target="_blank" rel="noreferrer">useSpinning</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/hooks/template/useContentScroll.ts" target="_blank" rel="noreferrer">useContentScroll</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/hooks/template/useSiderScroll.ts" target="_blank" rel="noreferrer">useSiderScroll</a></p>`,15))]))}});export{r as __pageData,g as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>源码:<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/hooks/template/useMaximize.ts" target="_blank" rel="noreferrer">useMaximize</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/hooks/template/useSpinning.ts" target="_blank" rel="noreferrer">useSpinning</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/hooks/template/useContentScroll.ts" target="_blank" rel="noreferrer">useContentScroll</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/hooks/template/useSiderScroll.ts" target="_blank" rel="noreferrer">useSiderScroll</a></p>`,15))]))}});export{r as __pageData,g as default};
|
||||
@ -670,4 +670,4 @@ import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> path</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '/tables/remote'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">count</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> count </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ?</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> show</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(path, { label: count, type: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'info'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> hidden</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(path)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>源码:<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/hooks/template/useAppNavigation.ts" target="_blank" rel="noreferrer">useAppNavigation</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/hooks/template/useAppRoot.ts" target="_blank" rel="noreferrer">useAppRoot</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/hooks/template/useSiderBar.ts" target="_blank" rel="noreferrer">useSiderBar</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/hooks/template/useBadge.ts" target="_blank" rel="noreferrer">useBadge</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/hooks/template/useVueRouter.ts" target="_blank" rel="noreferrer">useVueRouter</a></p>`,21))]))}});export{r as __pageData,g as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>源码:<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/hooks/template/useAppNavigation.ts" target="_blank" rel="noreferrer">useAppNavigation</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/hooks/template/useAppRoot.ts" target="_blank" rel="noreferrer">useAppRoot</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/hooks/template/useSiderBar.ts" target="_blank" rel="noreferrer">useSiderBar</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/hooks/template/useBadge.ts" target="_blank" rel="noreferrer">useBadge</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/hooks/template/useVueRouter.ts" target="_blank" rel="noreferrer">useVueRouter</a></p>`,21))]))}});export{r as __pageData,g as default};
|
||||
@ -357,4 +357,4 @@ import{_ as n}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> documentTitle: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'库存报表'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { report, print }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>TablePro 内置打印按当前页和可见列生成报表。要保留自定义业务排版,参考 <a href="./../table-pro.html#打印与-csv">TablePro 打印</a>。</p><p>源码:<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/composables/src/useDomToImage.ts" target="_blank" rel="noreferrer">useDomToImage</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/composables/src/usePrint.ts" target="_blank" rel="noreferrer">usePrint</a></p>`,13))]))}});export{d as __pageData,y as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>TablePro 内置打印按当前页和可见列生成报表。要保留自定义业务排版,参考 <a href="./../table-pro.html#打印与-csv">TablePro 打印</a>。</p><p>源码:<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/composables/src/useDomToImage.ts" target="_blank" rel="noreferrer">useDomToImage</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/composables/src/usePrint.ts" target="_blank" rel="noreferrer">usePrint</a></p>`,13))]))}});export{d as __pageData,y as default};
|
||||
@ -124,4 +124,4 @@ import{_ as a}from"./chunks/AdminExample.vue_vue_type_script_setup_true_lang.wPc
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">DemoPage</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div></details><h2 id="添加和生成" tabindex="-1">添加和生成 <a class="header-anchor" href="#添加和生成" aria-label="Permalink to "添加和生成""></a></h2><ol><li>选择现有分包(如 <code>action</code>、<code>navigation</code>、<code>system</code>),或按业务新建分包。路径段使用小写字母、数字、下划线或连字符,且以字母开头。</li><li>单色图标用 <code>currentColor</code>,留白用 <code>none</code>。品牌保留原色。</li><li>开发服务或 <code>pnpm icons:generate</code> 更新 <code>packages/icons/src/manifest.ts</code>;检查 <code>pnpm icons:check</code>,与 SVG 一起提交。不要手改联合类型。</li></ol><p>生产时每个顶层分包生成独立、带 hash 的雪碧图,资源随部署 base 加载。迁移时直接改旧代码的裸名称;旧缓存仅当文件名唯一时自动转换。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/icons/src/A_README.md" target="_blank" rel="noreferrer">图标流程与分包表</a></p><h2 id="ricon-api" tabindex="-1">RIcon API <a class="header-anchor" href="#ricon-api" aria-label="Permalink to "RIcon API""></a></h2><p><code>RIcon</code>、<code>IconProps</code>、<code>iconProps</code>、<code>IconName</code> 和 <code>IconPackage</code> 从 <code>@/components</code> 导出。也可从 <code>@/icons</code> 导入图标类型。</p><table tabindex="0"><thead><tr><th>属性</th><th>默认</th><th>说明</th></tr></thead><tbody><tr><td><code>name</code></td><td>必填</td><td>完整的分包路径,首段用于选择雪碧图。</td></tr><tr><td><code>size</code></td><td><code>20</code></td><td>基础宽高,数字按像素,也可传 CSS 尺寸。</td></tr><tr><td><code>width</code> / <code>height</code></td><td><code>0</code> / <code>0</code></td><td>分别覆盖基础尺寸,<code>0</code> 回退到 <code>size</code>。</td></tr><tr><td><code>color</code></td><td><code>'currentColor'</code></td><td>SVG 填充色;带原色的品牌不会全部被覆盖。</td></tr><tr><td><code>prefix</code></td><td><code>'icon'</code></td><td>symbol 前缀,须与生成配置一致。</td></tr><tr><td><code>customClassName</code></td><td>无</td><td>根元素的额外类名。</td></tr><tr><td><code>depth</code></td><td><code>1</code></td><td>图标透明层级。</td></tr><tr><td><code>cursor</code></td><td><code>'inherit'</code></td><td>默认继承所在控件的指针样式。</td></tr><tr><td><code>onClick(event)</code></td><td>无</td><td>支持函数或回调数组。</td></tr></tbody></table><p>图标内部 SVG 对读屏隐藏。如果用图标触发操作,把它放进具有可访问名称的按钮内,保留键盘操作和焦点。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RIcon/src/props.ts" target="_blank" rel="noreferrer">RIcon Props</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/ui/src/RIcon/src/Icon.tsx" target="_blank" rel="noreferrer">雪碧图引用实现</a></p><h2 id="图标来源" tabindex="-1">图标来源 <a class="header-anchor" href="#图标来源" aria-label="Permalink to "图标来源""></a></h2><p>通用图标选自 <a href="https://www.iconfont.cn/collections/detail?cid=51731" target="_blank" rel="noreferrer">Iconfont 的 IconPark 线性合辑</a>。<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/packages/icons/ICON-SOURCES.md" target="_blank" rel="noreferrer">来源清单</a>按用途列出包内名称和对应的 Iconfont ID。单色图标跟随文本颜色;Ray 和其他品牌标识保留各自原色。</p><p>已有图标名优先保留。三个退役资源的旧路由配置会在读取时迁移:<code>action/export_excel</code> → <code>action/download</code>、<code>logo/office</code> → <code>navigation/table</code>、<code>illustration/login_bg</code> → <code>navigation/other</code>。新代码直接使用新的完整名称。</p>`,13))]))}});export{r as __pageData,d as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div></details><h2 id="添加和生成" tabindex="-1">添加和生成 <a class="header-anchor" href="#添加和生成" aria-label="Permalink to "添加和生成""></a></h2><ol><li>选择现有分包(如 <code>action</code>、<code>navigation</code>、<code>system</code>),或按业务新建分包。路径段使用小写字母、数字、下划线或连字符,且以字母开头。</li><li>单色图标用 <code>currentColor</code>,留白用 <code>none</code>。品牌保留原色。</li><li>开发服务或 <code>pnpm icons:generate</code> 更新 <code>packages/icons/src/manifest.ts</code>;检查 <code>pnpm icons:check</code>,与 SVG 一起提交。不要手改联合类型。</li></ol><p>生产时每个顶层分包生成独立、带 hash 的雪碧图,资源随部署 base 加载。迁移时直接改旧代码的裸名称;旧缓存仅当文件名唯一时自动转换。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/icons/src/A_README.md" target="_blank" rel="noreferrer">图标流程与分包表</a></p><h2 id="ricon-api" tabindex="-1">RIcon API <a class="header-anchor" href="#ricon-api" aria-label="Permalink to "RIcon API""></a></h2><p><code>RIcon</code>、<code>IconProps</code>、<code>iconProps</code>、<code>IconName</code> 和 <code>IconPackage</code> 从 <code>@/components</code> 导出。也可从 <code>@/icons</code> 导入图标类型。</p><table tabindex="0"><thead><tr><th>属性</th><th>默认</th><th>说明</th></tr></thead><tbody><tr><td><code>name</code></td><td>必填</td><td>完整的分包路径,首段用于选择雪碧图。</td></tr><tr><td><code>size</code></td><td><code>20</code></td><td>基础宽高,数字按像素,也可传 CSS 尺寸。</td></tr><tr><td><code>width</code> / <code>height</code></td><td><code>0</code> / <code>0</code></td><td>分别覆盖基础尺寸,<code>0</code> 回退到 <code>size</code>。</td></tr><tr><td><code>color</code></td><td><code>'currentColor'</code></td><td>SVG 填充色;带原色的品牌不会全部被覆盖。</td></tr><tr><td><code>prefix</code></td><td><code>'icon'</code></td><td>symbol 前缀,须与生成配置一致。</td></tr><tr><td><code>customClassName</code></td><td>无</td><td>根元素的额外类名。</td></tr><tr><td><code>depth</code></td><td><code>1</code></td><td>图标透明层级。</td></tr><tr><td><code>cursor</code></td><td><code>'inherit'</code></td><td>默认继承所在控件的指针样式。</td></tr><tr><td><code>onClick(event)</code></td><td>无</td><td>支持函数或回调数组。</td></tr></tbody></table><p>图标内部 SVG 对读屏隐藏。如果用图标触发操作,把它放进具有可访问名称的按钮内,保留键盘操作和焦点。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RIcon/src/props.ts" target="_blank" rel="noreferrer">RIcon Props</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/ui/src/RIcon/src/Icon.tsx" target="_blank" rel="noreferrer">雪碧图引用实现</a></p><h2 id="图标来源" tabindex="-1">图标来源 <a class="header-anchor" href="#图标来源" aria-label="Permalink to "图标来源""></a></h2><p>通用图标选自 <a href="https://www.iconfont.cn/collections/detail?cid=51731" target="_blank" rel="noreferrer">Iconfont 的 IconPark 线性合辑</a>。<a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/packages/icons/ICON-SOURCES.md" target="_blank" rel="noreferrer">来源清单</a>按用途列出包内名称和对应的 Iconfont ID。单色图标跟随文本颜色;Ray 和其他品牌标识保留各自原色。</p><p>已有图标名优先保留。三个退役资源的旧路由配置会在读取时迁移:<code>action/export_excel</code> → <code>action/download</code>、<code>logo/office</code> → <code>navigation/table</code>、<code>illustration/login_bg</code> → <code>navigation/other</code>。新代码直接使用新的完整名称。</p>`,13))]))}});export{r as __pageData,d as default};
|
||||
@ -1 +1 @@
|
||||
import{_ as t,o as a,c as r,a3 as o}from"./chunks/framework.D8G7yXPy.js";const p=JSON.parse('{"title":"文档与源码版本","description":"","frontmatter":{},"headers":[],"relativePath":"reference/source.md","filePath":"reference/source.md"}'),n={name:"reference/source.md"};function c(i,e,d,s,l,h){return a(),r("div",null,[...e[0]||(e[0]=[o('<h1 id="文档与源码版本" tabindex="-1">文档与源码版本 <a class="header-anchor" href="#文档与源码版本" aria-label="Permalink to "文档与源码版本""></a></h1><p>本站面向 <strong>Ray Template 6.0.1</strong>。Ray Admin、文档示例和共享包位于同一仓库。页内示例使用构建时同一工作区的包,发布构建的源码链接指向对应提交。</p><table tabindex="0"><thead><tr><th>版本</th><th>源码与说明</th></tr></thead><tbody><tr><td><strong>v6</strong></td><td><a href="https://github.com/XiaoDaiGua-Ray/ray-template/tree/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7" target="_blank" rel="noreferrer">Ray Template 当前源码</a> · <a href="./../guide/architecture.html">Monorepo 架构</a> · <a href="./../migration.html">版本分界与接入说明</a></td></tr><tr><td><strong>v5</strong></td><td><a href="https://github.com/XiaoDaiGua-Ray/ray-template/tree/legacy/v5" target="_blank" rel="noreferrer">legacy/v5</a> 停在 <code>6f095b7</code>,已有 <a href="https://github.com/XiaoDaiGua-Ray/ray-template/tree/v5.2.4" target="_blank" rel="noreferrer">v5.2.4 标签</a>保留。</td></tr><tr><td><strong>旧文档历史</strong></td><td><a href="https://github.com/XiaoDaiGua-Ray/ray-template-doc" target="_blank" rel="noreferrer">旧文档仓库</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template-doc/tree/0cae0e4334b16df22d491401c190360af4819025" target="_blank" rel="noreferrer">旧版正文快照</a></td></tr></tbody></table><p>源码版本号、Git 标签和网站部署各有进度。需要重现行为时,请记录具体标签或提交。报告问题时请注明使用的是 v5 还是 v6,并附上页面或模块入口。<a href="https://github.com/XiaoDaiGua-Ray/ray-template/issues" target="_blank" rel="noreferrer">问题反馈</a></p>',4)])])}const m=t(n,[["render",c]]);export{p as __pageData,m as default};
|
||||
import{_ as t,o as a,c as r,a3 as o}from"./chunks/framework.D8G7yXPy.js";const p=JSON.parse('{"title":"文档与源码版本","description":"","frontmatter":{},"headers":[],"relativePath":"reference/source.md","filePath":"reference/source.md"}'),n={name:"reference/source.md"};function i(c,e,d,s,l,h){return a(),r("div",null,[...e[0]||(e[0]=[o('<h1 id="文档与源码版本" tabindex="-1">文档与源码版本 <a class="header-anchor" href="#文档与源码版本" aria-label="Permalink to "文档与源码版本""></a></h1><p>本站面向 <strong>Ray Template 6.0.1</strong>。Ray Admin、文档示例和共享包位于同一仓库。页内示例使用构建时同一工作区的包,发布构建的源码链接指向对应提交。</p><table tabindex="0"><thead><tr><th>版本</th><th>源码与说明</th></tr></thead><tbody><tr><td><strong>v6</strong></td><td><a href="https://github.com/XiaoDaiGua-Ray/ray-template/tree/0e688a34bfac790d169477057bf019727ffcae43" target="_blank" rel="noreferrer">Ray Template 当前源码</a> · <a href="./../guide/architecture.html">Monorepo 架构</a> · <a href="./../migration.html">版本分界与接入说明</a></td></tr><tr><td><strong>v5</strong></td><td><a href="https://github.com/XiaoDaiGua-Ray/ray-template/tree/legacy/v5" target="_blank" rel="noreferrer">legacy/v5</a> 停在 <code>6f095b7</code>,已有 <a href="https://github.com/XiaoDaiGua-Ray/ray-template/tree/v5.2.4" target="_blank" rel="noreferrer">v5.2.4 标签</a>保留。</td></tr><tr><td><strong>旧文档历史</strong></td><td><a href="https://github.com/XiaoDaiGua-Ray/ray-template-doc" target="_blank" rel="noreferrer">旧文档仓库</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template-doc/tree/0cae0e4334b16df22d491401c190360af4819025" target="_blank" rel="noreferrer">旧版正文快照</a></td></tr></tbody></table><p>源码版本号、Git 标签和网站部署各有进度。需要重现行为时,请记录具体标签或提交。报告问题时请注明使用的是 v5 还是 v6,并附上页面或模块入口。<a href="https://github.com/XiaoDaiGua-Ray/ray-template/issues" target="_blank" rel="noreferrer">问题反馈</a></p>',4)])])}const m=t(n,[["render",i]]);export{p as __pageData,m as default};
|
||||
@ -1 +1 @@
|
||||
import{_ as t,o as a,c as r,a3 as o}from"./chunks/framework.D8G7yXPy.js";const p=JSON.parse('{"title":"文档与源码版本","description":"","frontmatter":{},"headers":[],"relativePath":"reference/source.md","filePath":"reference/source.md"}'),n={name:"reference/source.md"};function c(i,e,d,s,l,h){return a(),r("div",null,[...e[0]||(e[0]=[o("",4)])])}const m=t(n,[["render",c]]);export{p as __pageData,m as default};
|
||||
import{_ as t,o as a,c as r,a3 as o}from"./chunks/framework.D8G7yXPy.js";const p=JSON.parse('{"title":"文档与源码版本","description":"","frontmatter":{},"headers":[],"relativePath":"reference/source.md","filePath":"reference/source.md"}'),n={name:"reference/source.md"};function i(c,e,d,s,l,h){return a(),r("div",null,[...e[0]||(e[0]=[o("",4)])])}const m=t(n,[["render",i]]);export{p as __pageData,m as default};
|
||||
@ -1 +1 @@
|
||||
import{_ as t,o,c as r,a3 as a}from"./chunks/framework.D8G7yXPy.js";const h=JSON.parse('{"title":"Store","description":"","frontmatter":{},"headers":[],"relativePath":"reference/store.md","filePath":"reference/store.md"}'),d={name:"reference/store.md"};function c(s,e,n,i,p,l){return o(),r("div",null,[...e[0]||(e[0]=[a('<h1 id="store" tabindex="-1">Store <a class="header-anchor" href="#store" aria-label="Permalink to "Store""></a></h1><p>模板使用 Pinia 管理跨页面状态。业务代码从 <code>@/store</code> 导入相应的 Getters / Actions,读取引用用 <code>.value</code>,修改走动作。只属于一个组件或页面的状态可以继续用本地 ref。</p><table tabindex="0"><thead><tr><th>Store</th><th>访问入口</th><th>持久化</th></tr></thead><tbody><tr><td><a href="./store/setting.html">Setting</a></td><td><code>useSettingGetters</code> / <code>useSettingActions</code></td><td>Local Storage <code>piniaSettingStore</code>,排除锁屏设置弹窗显隐;当前语言另外保存。</td></tr><tr><td><a href="./store/navigation.html#menu-store">Menu</a></td><td><code>useMenuGetters</code> / <code>useMenuActions</code></td><td>Local Storage 保存当前菜单和折叠状态;标签列表另存 Session Storage。</td></tr><tr><td><a href="./store/navigation.html#keepalive-store">KeepAlive</a></td><td><code>useKeepAliveGetters</code> / <code>useKeepAliveActions</code></td><td>Session Storage 保存可缓存组件名。</td></tr><tr><td><a href="./store/runtime.html#runtime-store">Runtime</a></td><td><code>useRuntimeGetters</code> / <code>useRuntimeActions</code></td><td>无;随当前 Pinia 实例释放。</td></tr><tr><td><a href="./store/runtime.html#lock-screen-store">Lock Screen</a></td><td><code>useLockScreenGetters</code> / <code>useLockScreenActions</code></td><td>Local Storage 的历史布尔值,支持跨标签同步。</td></tr><tr><td><a href="./store/signing.html">Signing</a></td><td><code>useSigningGetters</code> / <code>useSigningActions</code></td><td>Local Storage 持久化账号显示信息,路由守卫另读 token。</td></tr></tbody></table><h2 id="初始化与扩展" tabindex="-1">初始化与扩展 <a class="header-anchor" href="#初始化与扩展" aria-label="Permalink to "初始化与扩展""></a></h2><p><code>setupStore(app)</code> 安装 Pinia 与持久化插件,应用卸载时释放 Pinia 实例及作用域。模板入口已调用,业务代码无需再次注册。Menu 与 Signing 依赖 Router 注入,请在应用组件的有效 setup 中访问。</p><p>新增 Store 在 <code>apps/admin/src/store/modules</code> 按领域建目录并指定唯一 ID。需要持久化时使用 <code>pick</code> 或 <code>omit</code>,选定存储范围和稳定的 key,只保存可序列化的值。调用接口放到 <code>apps/admin/src/store/hooks</code>,再由 <code>apps/admin/src/store/index.ts</code> 导出。原始 <code>pinia…Store</code> 同样公开给模板内部,但页面使用 hooks 可以减少对实现字段的直接依赖。</p><p>缓存键和 JSON 结构是已有数据契约。换 key、拆字段或改变序列化格式时,要考虑旧数据的读取、迁移和回退。浏览器缓存不应保存服务端密钥。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/index.ts" target="_blank" rel="noreferrer">初始化与公开导出</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/README.md" target="_blank" rel="noreferrer">Store 源码约定</a></p>',8)])])}const m=t(d,[["render",c]]);export{h as __pageData,m as default};
|
||||
import{_ as t,o,c as r,a3 as a}from"./chunks/framework.D8G7yXPy.js";const h=JSON.parse('{"title":"Store","description":"","frontmatter":{},"headers":[],"relativePath":"reference/store.md","filePath":"reference/store.md"}'),d={name:"reference/store.md"};function c(s,e,n,i,p,l){return o(),r("div",null,[...e[0]||(e[0]=[a('<h1 id="store" tabindex="-1">Store <a class="header-anchor" href="#store" aria-label="Permalink to "Store""></a></h1><p>模板使用 Pinia 管理跨页面状态。业务代码从 <code>@/store</code> 导入相应的 Getters / Actions,读取引用用 <code>.value</code>,修改走动作。只属于一个组件或页面的状态可以继续用本地 ref。</p><table tabindex="0"><thead><tr><th>Store</th><th>访问入口</th><th>持久化</th></tr></thead><tbody><tr><td><a href="./store/setting.html">Setting</a></td><td><code>useSettingGetters</code> / <code>useSettingActions</code></td><td>Local Storage <code>piniaSettingStore</code>,排除锁屏设置弹窗显隐;当前语言另外保存。</td></tr><tr><td><a href="./store/navigation.html#menu-store">Menu</a></td><td><code>useMenuGetters</code> / <code>useMenuActions</code></td><td>Local Storage 保存当前菜单和折叠状态;标签列表另存 Session Storage。</td></tr><tr><td><a href="./store/navigation.html#keepalive-store">KeepAlive</a></td><td><code>useKeepAliveGetters</code> / <code>useKeepAliveActions</code></td><td>Session Storage 保存可缓存组件名。</td></tr><tr><td><a href="./store/runtime.html#runtime-store">Runtime</a></td><td><code>useRuntimeGetters</code> / <code>useRuntimeActions</code></td><td>无;随当前 Pinia 实例释放。</td></tr><tr><td><a href="./store/runtime.html#lock-screen-store">Lock Screen</a></td><td><code>useLockScreenGetters</code> / <code>useLockScreenActions</code></td><td>Local Storage 的历史布尔值,支持跨标签同步。</td></tr><tr><td><a href="./store/signing.html">Signing</a></td><td><code>useSigningGetters</code> / <code>useSigningActions</code></td><td>Local Storage 持久化账号显示信息,路由守卫另读 token。</td></tr></tbody></table><h2 id="初始化与扩展" tabindex="-1">初始化与扩展 <a class="header-anchor" href="#初始化与扩展" aria-label="Permalink to "初始化与扩展""></a></h2><p><code>setupStore(app)</code> 安装 Pinia 与持久化插件,应用卸载时释放 Pinia 实例及作用域。模板入口已调用,业务代码无需再次注册。Menu 与 Signing 依赖 Router 注入,请在应用组件的有效 setup 中访问。</p><p>新增 Store 在 <code>apps/admin/src/store/modules</code> 按领域建目录并指定唯一 ID。需要持久化时使用 <code>pick</code> 或 <code>omit</code>,选定存储范围和稳定的 key,只保存可序列化的值。调用接口放到 <code>apps/admin/src/store/hooks</code>,再由 <code>apps/admin/src/store/index.ts</code> 导出。原始 <code>pinia…Store</code> 同样公开给模板内部,但页面使用 hooks 可以减少对实现字段的直接依赖。</p><p>缓存键和 JSON 结构是已有数据契约。换 key、拆字段或改变序列化格式时,要考虑旧数据的读取、迁移和回退。浏览器缓存不应保存服务端密钥。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/index.ts" target="_blank" rel="noreferrer">初始化与公开导出</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/README.md" target="_blank" rel="noreferrer">Store 源码约定</a></p>',8)])])}const m=t(d,[["render",c]]);export{h as __pageData,m as default};
|
||||
@ -4,4 +4,4 @@ import{_ as t,o as a,c as s,a3 as i}from"./chunks/framework.D8G7yXPy.js";const k
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">getMenuKey</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">getMenuTagOptions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useMenuGetters</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">getKeepAliveInclude</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useKeepAliveGetters</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { getMenuKey, getMenuTagOptions, getKeepAliveInclude }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/modules/menu/index.ts" target="_blank" rel="noreferrer">Menu 实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/hooks/useMenuStore.ts" target="_blank" rel="noreferrer">Menu Hooks</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/modules/keep-alive/index.ts" target="_blank" rel="noreferrer">KeepAlive 实现</a></p>`,12)])])}const u=t(n,[["render",o]]);export{k as __pageData,u as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/modules/menu/index.ts" target="_blank" rel="noreferrer">Menu 实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/hooks/useMenuStore.ts" target="_blank" rel="noreferrer">Menu Hooks</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/modules/keep-alive/index.ts" target="_blank" rel="noreferrer">KeepAlive 实现</a></p>`,12)])])}const u=t(n,[["render",o]]);export{k as __pageData,u as default};
|
||||
@ -10,4 +10,4 @@ import{_ as i,o as e,c as t,a3 as a}from"./chunks/framework.D8G7yXPy.js";const c
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> setRuntimeState</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'globalSpinning'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>全局状态是布尔值,不对并发任务计数。如果多个独立请求同时使用,先由调用方统一协调开关。</p><h2 id="lock-screen-store" tabindex="-1">Lock Screen Store <a class="header-anchor" href="#lock-screen-store" aria-label="Permalink to "Lock Screen Store""></a></h2><p><code>useLockScreenGetters().getLocked</code> 是实际锁屏状态。<code>useLockScreenActions().setLocked(value)</code> 写入同一个状态,默认 <code>false</code>,通过 <code>isAppLockScreen</code> 在 Local Storage 保存历史布尔格式并跨标签同步。</p><p>实际锁定与 <code>setting.lockScreenSwitch</code> 分开,后者只控制锁屏设置弹窗。默认锁屏组件处理本地口令和解锁逻辑;业务按钮应打开设置弹窗,直接写锁定布尔值不会为用户建立口令。它是本机界面遮挡,与服务端会话和授权独立。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/modules/runtime/index.ts" target="_blank" rel="noreferrer">Runtime 实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/modules/lock-screen/index.ts" target="_blank" rel="noreferrer">Lock Screen 实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/app-components/app/AppLockScreen/components/LockScreen/index.tsx" target="_blank" rel="noreferrer">锁屏流程</a></p>`,11)])])}const E=i(n,[["render",l]]);export{c as __pageData,E as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>全局状态是布尔值,不对并发任务计数。如果多个独立请求同时使用,先由调用方统一协调开关。</p><h2 id="lock-screen-store" tabindex="-1">Lock Screen Store <a class="header-anchor" href="#lock-screen-store" aria-label="Permalink to "Lock Screen Store""></a></h2><p><code>useLockScreenGetters().getLocked</code> 是实际锁屏状态。<code>useLockScreenActions().setLocked(value)</code> 写入同一个状态,默认 <code>false</code>,通过 <code>isAppLockScreen</code> 在 Local Storage 保存历史布尔格式并跨标签同步。</p><p>实际锁定与 <code>setting.lockScreenSwitch</code> 分开,后者只控制锁屏设置弹窗。默认锁屏组件处理本地口令和解锁逻辑;业务按钮应打开设置弹窗,直接写锁定布尔值不会为用户建立口令。它是本机界面遮挡,与服务端会话和授权独立。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/modules/runtime/index.ts" target="_blank" rel="noreferrer">Runtime 实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/modules/lock-screen/index.ts" target="_blank" rel="noreferrer">Lock Screen 实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/app-components/app/AppLockScreen/components/LockScreen/index.tsx" target="_blank" rel="noreferrer">锁屏流程</a></p>`,11)])])}const E=i(n,[["render",l]]);export{c as __pageData,E as default};
|
||||
@ -10,4 +10,4 @@ import{_ as t,o as a,c as s,a3 as i}from"./chunks/framework.D8G7yXPy.js";const k
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> contentMaxWidth: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1200</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { config: getLayoutConfig, apply }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/hooks/useSettingStore.ts" target="_blank" rel="noreferrer">Getters 与 Actions</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/modules/setting/types.ts" target="_blank" rel="noreferrer">状态类型</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/modules/setting/constant.ts" target="_blank" rel="noreferrer">默认配置</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/modules/setting/index.ts" target="_blank" rel="noreferrer">持久化实现</a></p>`,11)])])}const g=t(d,[["render",o]]);export{k as __pageData,g as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/hooks/useSettingStore.ts" target="_blank" rel="noreferrer">Getters 与 Actions</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/modules/setting/types.ts" target="_blank" rel="noreferrer">状态类型</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/modules/setting/constant.ts" target="_blank" rel="noreferrer">默认配置</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/modules/setting/index.ts" target="_blank" rel="noreferrer">持久化实现</a></p>`,11)])])}const g=t(d,[["render",o]]);export{k as __pageData,g as default};
|
||||
@ -5,4 +5,4 @@ import{_ as i,o as a,c as e,a3 as t}from"./chunks/framework.D8G7yXPy.js";const g
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">getSigningCallback</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useSigningGetters</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">logout</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useSigningActions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { name: </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">computed</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(() </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> getSigningCallback.value?.name </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">??</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">), logout }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>退出会清理当前来源的 Session Storage。多个业务共用同一来源时,接入方应明确其清理范围。动作还依赖已经挂载的消息 Provider 和 Router;从用户操作或已初始化的应用流程触发。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/modules/signing/index.ts" target="_blank" rel="noreferrer">Signing 实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/store/modules/signing/types.ts" target="_blank" rel="noreferrer">类型</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/views/login/components/Signing/index.tsx" target="_blank" rel="noreferrer">演示登录</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/b5c24a612c0bb6dcf857f058aeaf610ebfcf2eb7/apps/admin/src/router/utils/permission.ts" target="_blank" rel="noreferrer">权限守卫</a></p>`,7)])])}const c=i(n,[["render",r]]);export{g as __pageData,c as default};
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>退出会清理当前来源的 Session Storage。多个业务共用同一来源时,接入方应明确其清理范围。动作还依赖已经挂载的消息 Provider 和 Router;从用户操作或已初始化的应用流程触发。</p><p><a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/modules/signing/index.ts" target="_blank" rel="noreferrer">Signing 实现</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/store/modules/signing/types.ts" target="_blank" rel="noreferrer">类型</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/views/login/components/Signing/index.tsx" target="_blank" rel="noreferrer">演示登录</a> · <a href="https://github.com/XiaoDaiGua-Ray/ray-template/blob/0e688a34bfac790d169477057bf019727ffcae43/apps/admin/src/router/utils/permission.ts" target="_blank" rel="noreferrer">权限守卫</a></p>`,7)])])}const c=i(n,[["render",r]]);export{g as __pageData,c as default};
|
||||
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user