mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-27 23:13:38 +08:00
1 line
1.5 KiB
JavaScript
1 line
1.5 KiB
JavaScript
import{Cn as e,_n as t,kn as n,wn as r}from"./Card-B_oozRxS.js";import{z as i}from"./toString-BWDzaUQG.js";import{M as a,N as o,Vt as s}from"./store-DP5ZqOPA.js";import{c}from"./utils-Lx-65B4g.js";import{m as l,u,y as d}from"./Switch-tIQIUmgT.js";import{t as f}from"./DemoPage-CJFmBY0O.js";import{t as p}from"./DemoResult-DB6s8vEk.js";function m(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Object]`&&!n(e)}var h=r({name:`DocsStorageUtils`,setup(){let{t:n}=s(`docsExamples`),r=e=>n(e),h=i(`order-filter`),g=i(`orders:`),_=i(r(`storage.initial`)),v=i(``),y=i(``),b=`ray-template-example-only`,x=t(()=>c(h.value,{customPrefix:g.value}));return()=>{let t,n;return e(f,{title:r(`storage.title`),description:r(`storage.intro`)},{default:()=>[e(u,null,{default:()=>[e(d,{value:g.value,"onUpdate:value":e=>g.value=e,"aria-label":r(`storage.prefix`)},null),e(d,{value:h.value,"onUpdate:value":e=>h.value=e,"aria-label":r(`storage.key`)},null)]}),e(p,{label:r(`storage.resultKey`)},{default:()=>[e(`code`,null,[x.value])]}),e(d,{value:_.value,"onUpdate:value":e=>_.value=e,"aria-label":r(`storage.plainText`)},null),e(u,null,{default:()=>[e(l,{onClick:()=>{v.value=a({status:_.value},b),y.value=``}},m(t=r(`storage.encrypt`))?t:{default:()=>[t]}),e(l,{disabled:!v.value,onClick:()=>{y.value=JSON.stringify(o(v.value,b))}},m(n=r(`storage.decrypt`))?n:{default:()=>[n]})]}),e(p,{label:r(`storage.ciphertext`)},{default:()=>[e(`code`,null,[v.value])]}),e(p,{label:r(`storage.restored`)},{default:()=>[e(`code`,null,[y.value])]})]})}}});export{h as default}; |