import{C as V,a,b as r,c as l,d,e as _}from"./index.esm-ba027bbc.js";import{_ as C}from"./index-5df52834.js";const v=Vue.defineComponent({name:"ExampleDynamic",components:{[V.name]:V,[a.name]:a,[r.name]:r,[l.name]:l,[d.name]:d},directives:{contextmenu:_},data(){return{extra:[]}},methods:{addItem(e="item"){this.extra.push(e)},removeItem(){this.extra.pop()}}});const i=e=>(Vue.pushScopeId("data-v-35002170"),e=e(),Vue.popScopeId(),e),f=i(()=>Vue.createElementVNode("h1",null,"动态菜单",-1)),h={class:"wrapper"},k=i(()=>Vue.createElementVNode("code",null,"右键点击此区域",-1)),D=[k];function N(e,u,B,w,T,y){const t=Vue.resolveComponent("v-contextmenu-item"),c=Vue.resolveComponent("v-contextmenu-group"),m=Vue.resolveComponent("v-contextmenu-divider"),s=Vue.resolveComponent("v-contextmenu-submenu"),p=Vue.resolveComponent("v-contextmenu"),x=Vue.resolveDirective("contextmenu");return Vue.openBlock(),Vue.createElementBlock("div",null,[f,Vue.withDirectives((Vue.openBlock(),Vue.createElementBlock("div",h,D)),[[x,void 0,"contextmenu"]]),Vue.createVNode(p,{ref:"contextmenu"},{default:Vue.withCtx(()=>[Vue.createVNode(c,{title:"操作"},{default:Vue.withCtx(()=>[Vue.createVNode(t,{"hide-on-click":!1,onClick:u[0]||(u[0]=o=>e.extra.push("item"))},{default:Vue.withCtx(()=>[Vue.createTextVNode(" 添加菜单 ")]),_:1}),Vue.createVNode(t,{"hide-on-click":!1,onClick:u[1]||(u[1]=o=>e.extra.push("group"))},{default:Vue.withCtx(()=>[Vue.createTextVNode(" 添加菜单组 ")]),_:1}),Vue.createVNode(t,{"hide-on-click":!1,onClick:u[2]||(u[2]=o=>e.extra.push("submenu"))},{default:Vue.withCtx(()=>[Vue.createTextVNode(" 添加子菜单 ")]),_:1}),Vue.createVNode(t,{"hide-on-click":!1,onClick:u[3]||(u[3]=o=>e.extra.pop())},{default:Vue.withCtx(()=>[Vue.createTextVNode(" 删除 ")]),_:1})]),_:1}),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.extra,(o,n)=>(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,{key:n},[Vue.createVNode(m),o==="group"?(Vue.openBlock(),Vue.createBlock(c,{key:0,title:`菜单组 ${n+1}`},{default:Vue.withCtx(()=>[Vue.createVNode(t,null,{default:Vue.withCtx(()=>[Vue.createTextVNode("菜单1")]),_:1}),Vue.createVNode(t,null,{default:Vue.withCtx(()=>[Vue.createTextVNode("菜单2")]),_:1}),Vue.createVNode(t,null,{default:Vue.withCtx(()=>[Vue.createTextVNode("菜单3")]),_:1})]),_:2},1032,["title"])):o==="submenu"?(Vue.openBlock(),Vue.createBlock(s,{key:1,title:`子菜单 ${n+1}`},{default:Vue.withCtx(()=>[Vue.createVNode(t,null,{default:Vue.withCtx(()=>[Vue.createTextVNode("菜单1")]),_:1}),Vue.createVNode(t,null,{default:Vue.withCtx(()=>[Vue.createTextVNode("菜单2")]),_:1}),Vue.createVNode(t,null,{default:Vue.withCtx(()=>[Vue.createTextVNode("菜单3")]),_:1})]),_:2},1032,["title"])):(Vue.openBlock(),Vue.createBlock(t,{key:2},{default:Vue.withCtx(()=>[Vue.createTextVNode("菜单 "+Vue.toDisplayString(n+1),1)]),_:2},1024))],64))),128))]),_:1},512)])}const F=C(v,[["render",N],["__scopeId","data-v-35002170"]]);export{F as default};
