text: import{d as e,b as t,e as n,r as a,o as l,c as r,l as d,C as s,y as o,z as u,a7 as p,U as i,v as x,m as c}from"./vendor.ce57f646.js";var m=e({type:"readme",setup(){const e=t([{prop:"text",type:"string",readme:"菜单项文字"},{prop:"subText",type:"string",readme:"菜单项说明补充"},{prop:"disable",type:"boolean",readme:"是否禁用菜单项"},{prop:"divider",type:"boolean",readme:"分割线"},{prop:"children",type:"array",readme:"子菜单"},{prop:"handler",type:"function",readme:"点击菜单执行的方法函数"}]);return{input:n("[\n      {\n        text: '删除',\n        subText: 'BACKSPACE',\n        handler: (e: any) => {\n          msg.value = '你点击了删除'\n          console.log(e)\n        },\n      },\n      {\n        text: '禁用菜单项',\n        disable: true,\n      },\n      { divider: true },\n      {\n        text: '多级菜单',\n        children: [\n          { text: '子菜单1' },\n          { text: '子菜单2' },\n        ],\n      },\n      { divider: true },\n      {\n        text: '剪切',\n        subText: 'CTRL + X',\n        handler: () => (msg.value = '你点击了剪切'),\n      },\n      {\n        text: '复制',\n        subText: 'CTRL + C',\n        handler: () => (msg.value = '你点击了复制'),\n      },\n      {\n        text: '粘贴',\n        subText: 'CTRL + V',\n        handler: () => (msg.value = '你点击了粘贴'),\n      },\n    ]"),tableData:e}}});const v={class:"readme-container"},h=d("h3",null,"引入：",-1),b=d("section",null,[d("div",null,"// 自定义指令"),d("div",null,"import ContextMenu from '@/components/contextmenu/index'"),d("div",null,"const app = createApp(App) app.directive('contextmenu', ContextMenu)")],-1),C=d("h3",null,"主题：",-1),T=d("div",null,"右键菜单默认主题为 light,可以添加修饰符 `dark` 来设置菜单主题",-1),f=d("h3",null,"数据：",-1),g=d("h3",null,"参数说明：",-1);m.render=function(e,t,n,o,u,p){const i=a("el-table-column"),x=a("el-table");return l(),r("div",v,[h,b,C,T,f,d("textarea",{value:e.input,cols:80,rows:10},null,8,["value"]),g,d(x,{data:e.tableData,stripe:"",style:{width:"50%",margin:"20px 10px"},border:""},{default:s((()=>[d(i,{prop:"prop",label:"属性",width:"180"}),d(i,{prop:"type",label:"类型",width:"180"}),d(i,{prop:"readme",label:"说明"})])),_:1},8,["data"])])};var y=e({name:"ContextMenu",components:{Readme:m},setup(){const e=n("在空白区域点击鼠标右键");return{msg:e,contextmenus:()=>[{text:"删除",subText:"BACKSPACE",handler:t=>{e.value="你点击了删除",console.log(t)}},{text:"禁用菜单项",disable:!0},{divider:!0},{text:"多级菜单",children:[{text:"子菜单1",handler:()=>e.value="你点击了子菜单1"},{text:"子菜单2",handler:()=>e.value="你点击了子菜单2"},{text:"三级菜单",children:[{text:"子菜单1",handler:()=>e.value="你点击了子菜单1"},{text:"子菜单2",handler:()=>e.value="你点击了子菜单2"}]}]},{divider:!0},{text:"剪切",subText:"CTRL + X",handler:()=>e.value="你点击了剪切"},{text:"复制",subText:"CTRL + C",handler:()=>e.value="你点击了复制"},{text:"粘贴",subText:"CTRL + V",handler:()=>e.value="你点击了粘贴"}]}}});const R=c();o("data-v-7f55ff54");const A={class:"context-menu-container"};u();const L=R(((e,t,n,s,o,u)=>{const c=a("Readme"),m=p("contextmenu");return l(),r("div",A,[i(d("div",{class:"message-context"},x(e.msg),513),[[m,e.contextmenus,void 0,{dark:!0}]]),d(c)])}));y.render=L,y.__scopeId="data-v-7f55ff54";export default y;
  