
const drpMenus={
    name:'PTabitem',
    props:{
    }, 
//    inject:[''],
    data(){
        return {
            menuStyle:{
                right:0,
                left:'initial',
                top:0,
                display:'none',
                overflow:'auto',
                maxHeight:'50%'
            }
        }
    },
    mounted(){
        document.body.appendChild(this.$el);
        document.addEventListener('click',this.hide)
    },
    beforeDestroy(){ 
        this.$el.remove();
        document.removeEventListener('click',this.hide)
    },
    methods:{
       show(y){
           if(y){
            this.menuStyle.top=(y||0)+'px';
           }            
            this.menuStyle.display='block'
       },
       hide(){
            this.menuStyle.display='none'
       }
    },    
    render(h){
        const Props={
            style:this.menuStyle,
            on:{
                mouseout:()=>{this.hide()},
                mouseover:()=>{this.show()}
            }
        }
        return (
            <ul class="pl-menus pl-menus-inline pl-menus-sub pl-menus-pop" {...Props}>
                <li class="pl-menus-item">
                    <a class="title">
                        <i class="icon iconfont "></i>
                        <span class="txt">{$t('hivuiMain_tab_ctxmenu_refresh')}</span>
                    </a>
                </li> 
                <li class="pl-menus-item">
                    <a class="title">
                        <i class="icon iconfont "></i>
                        <span class="txt">{$t('hivuiMain_tab_ctxmenu_closeother')}</span>
                    </a>
                </li> 
                <li class="pl-menus-item">
                    <a class="title">
                        <i class="icon iconfont "></i>
                        <span class="txt">{$t('hivuiMain_tab_ctxmenu_closeleft')}</span>
                    </a>
                </li> 
                <li class="pl-menus-item">
                    <a class="title">
                        <i class="icon iconfont "></i>
                        <span class="txt">{$t('hivuiMain_tab_ctxmenu_closeright')}</span>
                    </a>
                </li> 
                <li class="pl-menus-item">
                    <a class="title">
                        <i class="icon iconfont "></i>
                        <span class="txt">{$t('hivuiMain_tab_ctxmenu_closeall')}</span>
                    </a>
                </li> 
            </ul>
        )
    }
}

export default drpMenus;