ray-template/js/index-DscxrZZp.js

2 lines
2.1 KiB
JavaScript

import{z as d}from"./hooks-DtYdZWXJ.js";import"./currency.js@2.0.4-9OAR_aOO.js";import"./dayjs@1.11.10-C8LoRVP6.js";import"./print-js@1.6.0-BdoEj60G.js";import"./vue-hooks-plus@2.2.0_vue@3.4.30-DdMBTcyt.js";import"./lodash@4.17.21-Cw59kuJw.js";import"./js-cookie@3.0.5-Z_8Sd105.js";import"./screenfull@5.2.0-DmMZCkhi.js";import"./lodash-es@4.17.21-3YkgETI-.js";import"./@vueuse_core@10.9.0_vue@3.4.30-CHk58Nsj.js";import"./@vueuse_shared@10.9.0_vue@3.4.30-BTLxKjPf.js";import"./utils-BmI4YPvf.js";import"./interactjs@1.10.26-DZL_TZzP.js";import"./call-bind@1.0.7-Cpj98o6Y.js";import"./pinia-plugin-persistedstate@3.2.1_pinia@2.1.7-RV7uh3T-.js";import"./dom-to-image@2.6.0-DCOFUeQU.js";import"./echarts@5.5.0-CezqL3m-.js";import"./zrender@5.5.0-DW8ownf1.js";import"./tslib@2.3.0-BDyQ-Jie.js";import"./@vue_runtime-core@3.4.30-CrcfNDdL.js";import"./@vue_reactivity@3.4.30-DnhErqw9.js";import"./@vue_shared@3.4.30-Bev2jR-5.js";const A=Vue.defineComponent({name:"ContextMenuDemo",setup(){const e=Vue.ref(),o=Vue.ref(!1),u=Vue.ref([{label:"杰·盖茨比",key:"jay gatsby"},{label:"黛西·布坎南",key:"daisy buchanan"},{type:"divider",key:"d1"},{label:"尼克·卡拉威",key:"nick caraway"}]),{x:r,y:i,show:a,updateShow:t}=d(e);return{demoOneRef:e,demoOneShow:o,x:r,y:i,show:a,options:u,clickOutside:n=>{n.preventDefault(),t(!1)},updateShow:t}},render(){const{x:e,y:o,show:u}=this,{clickOutside:r,updateShow:i}=this;return Vue.createVNode(naive.NFlex,{vertical:!0},{default:()=>[Vue.createVNode(naive.NCard,{title:"useContextmenuCoordinate + NDropdown 实现右键菜单"},{default:()=>[Vue.createVNode(naive.NFlex,{vertical:!0},{default:()=>[Vue.createVNode("h3",null,[Vue.createTextVNode("默认点击元素外部会关闭菜单。")]),Vue.createVNode("div",{ref:"demoOneRef",style:"width: 100%; height: 200px; background-color: rgba(0, 128, 0, 0.5)"},[Vue.createTextVNode("右击")])]})]}),Vue.createVNode(naive.NDropdown,{show:u,x:e,y:o,options:this.options,trigger:"manual",placement:"bottom-start",onSelect:(a,t)=>{window.$message.info(`选中了 ${t.label}`),i(!1)},onClickoutside:r.bind(this)},null)]})}});export{A as default};