mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-23 03:53:34 +08:00
1 line
1.5 KiB
JavaScript
1 line
1.5 KiB
JavaScript
import{Cn as e,On as t,Sn as n,Un as r,Xn as i,kn as a,t as o,wn as s}from"./Card-B_oozRxS.js";/* empty css */import{Lt as c,Vt as l,Y as u}from"./store-BGk8Kj6h.js";import{m as d}from"./Switch-B4B45bkJ.js";import{t as f}from"./example-focus-BDYDJaky.js";function p(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Object]`&&!a(e)}var m=s({name:`HookExample`,props:{name:{type:String,required:!0},description:{type:String,required:!0},code:{type:String,required:!0}},setup(a,{slots:s}){let{t:m}=l(`showcase`),h=t(f),g=h&&c();return()=>{let t;return h&&h.path===g?.path&&!h.names.has(a.name)?null:e(o,{tag:`article`,class:`r-hook-example`,contentStyle:{padding:0}},{default:()=>[e(`header`,{class:`r-hook-example__header`},[e(`span`,{class:`r-hook-example__symbol`,"aria-hidden":`true`},[n(`ƒ`)]),e(`h2`,null,[a.name]),e(`span`,{class:`r-hook-example__type`},[n(`Hook`)])]),e(`p`,{class:`r-hook-example__description`},[a.description]),e(`div`,{class:`r-hook-preview`},[e(`span`,{class:`r-hook-preview__label`},[m(`preview`)]),s.default?.()]),e(`details`,{class:`r-hook-code`},[e(`summary`,null,[e(`span`,null,[e(u,{name:`directional/expanded`,size:12},null),m(`code`)]),e(`span`,{class:`r-hook-code__format`},[n(`TS / TSX`)])]),e(`div`,{class:`r-hook-code__toolbar`},[e(`span`,null,[n(`TypeScript`)]),i(e(d,{text:!0,size:`tiny`},p(t=m(`copyCode`))?t:{default:()=>[t]}),[[r(`copy`),a.code]])]),e(`pre`,{class:`r-demo-code`},[e(`code`,null,[a.code])])])]})}}});export{m as t}; |