import{d as g,r as l,u as b,h as k,o as w,i as C,j as e,w as o,p,W as O,al as B,B as R,O as q,dg as M,af as a,eR as N,eS as Q,eT as S,eU as T,e2 as V,ac as D}from"./index-9PRMimni.js";const E={class:"n-layout-page-header"},j=g({__name:"context-menus",setup(W){const f=[{label:"发送到邮箱",key:"email",icon:a(N)},{label:"发送到手机",key:"mobile",icon:a(Q)},{label:"其他",key:"others",icon:a(V),children:[{label:"QQ",key:"qq",icon:a(S)},{label:"微信",key:"weixin",icon:a(T)}]}],t=l(!1),i=b(),c=l(0),u=l(0);function m(n){t.value=!1,i.info(`${n}-这个是你点击的菜单吧？`)}function _(n){n.preventDefault(),t.value=!1,D().then(()=>{t.value=!0,c.value=n.clientX,u.value=n.clientY})}function v(){i.info("您点击了外部区域，菜单不见了哈！"),t.value=!1}return(n,s)=>{const d=O,h=R,r=B,x=q,y=M;return w(),k("div",null,[C("div",E,[e(d,{bordered:!1,title:"右键菜单"},{default:o(()=>s[0]||(s[0]=[p(" 右键菜单示例，指定元素右键显示操作菜单 ")])),_:1})]),e(d,{bordered:!1,class:"mt-3 proCard"},{default:o(()=>[e(r,{"show-icon":!1,title:"右键展示菜单",type:"info"},{default:o(()=>[e(h,{class:"mt-2",type:"primary",onContextmenu:_},{default:o(()=>s[1]||(s[1]=[p("右键试试")])),_:1})]),_:1}),e(r,{"show-icon":!1,title:"头像组件右键展示菜单",type:"info",class:"mt-3"},{default:o(()=>[e(x,{size:80,src:"https://naive-ui-admin-docs.vercel.app/logo.png",onContextmenu:_})]),_:1}),e(y,{placement:"bottom-start",onSelect:m,trigger:"manual",x:c.value,y:u.value,options:f,show:t.value,"on-clickoutside":v},null,8,["x","y","show"])]),_:1})])}}});export{j as default};
