mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-30 16:58:48 +08:00
1 line
1.4 KiB
JavaScript
1 line
1.4 KiB
JavaScript
import{K as e,T as t,d as n,v as r,y as i}from"./runtime-core.esm-bundler-BvnVMcQz.js";import{T as a}from"./isSymbol-DERoyzaf.js";import{Wn as o,mn as s,tr as c}from"./directives-QatNmAyh.js";import{t as l}from"./Card-CLV9EByv.js";import{t as u}from"./useContextmenuCoordinate-C1AuGsM6.js";import{t as d}from"./DemoPage-DXXea1cu.js";import{t as f}from"./DemoResult-CvFDt4Kp.js";function p(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Object]`&&!t(e)}var m=[`review`,`archive`,`restore`],h=i({name:`ContextMenuDemo`,setup(){let{t}=s(`demoDetails`),i=e(`stage`),{x:h,y:g,show:_,updateShow:v}=u(i,{ignore:[`.r-demo-context-popup`]}),y=a(),b=n(()=>m.map(e=>({key:e,label:t(`context.${e}`)}))),x=e=>{y.value=e,v(!1)};return()=>{let e;return r(d,{title:t(`context.title`),description:t(`context.intro`)},{default:()=>[r(l,{title:`RAY-024`},{default:()=>[r(`div`,{class:`r-demo-card-stack`},[r(`div`,{ref:`stage`,class:`r-demo-stage`},[r(`div`,{class:`r-demo-card-stack`},[r(`strong`,null,[t(`context.target`)]),r(o,{options:b.value,trigger:`click`,onSelect:x},{default:()=>[r(c,{secondary:!0},p(e=t(`context.open`))?e:{default:()=>[e]})]})])]),r(f,{label:t(`context.last`)},{default:()=>[y.value?t(`context.${y.value}`):t(`empty`)]})])]}),r(o,{show:_.value,x:h.value,y:g.value,options:b.value,trigger:`manual`,menuProps:()=>({class:`r-demo-context-popup`}),onSelect:x,onClickoutside:()=>v(!1)},null)]})}}});export{h as default}; |