mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-27 15:05:09 +08:00
1 line
1.5 KiB
JavaScript
1 line
1.5 KiB
JavaScript
import{Cn as e,Hn as t,On as n,Sn as r,Yn as i,kn as a,t as o,wn as s}from"./Card-DpMmwG-0.js";/* empty css */import{Lt as c,Vt as l,Y as u}from"./store-CPbeLaIA.js";import{m as d}from"./Switch-BFGmG5oX.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=n(f),g=h&&c();return()=>{let n;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`},[r(`ƒ`)]),e(`h2`,null,[a.name]),e(`span`,{class:`r-hook-example__type`},[r(`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`},[r(`TS / TSX`)])]),e(`div`,{class:`r-hook-code__toolbar`},[e(`span`,null,[r(`TypeScript`)]),i(e(d,{text:!0,size:`tiny`},p(n=m(`copyCode`))?n:{default:()=>[n]}),[[t(`copy`),a.code]])]),e(`pre`,{class:`r-demo-code`},[e(`code`,null,[a.code])])])]})}}});export{m as t}; |