update Tabs
This commit is contained in:
parent
8bf4836337
commit
ffb3729603
2 changed files with 26 additions and 10 deletions
|
@ -15,7 +15,7 @@
|
|||
<div ref="navScroll" :class="[prefixCls + '-nav-scroll']" @DOMMouseScroll="handleScroll" @mousewheel="handleScroll">
|
||||
<div ref="nav" :class="[prefixCls + '-nav']" :style="navStyle">
|
||||
<div :class="barClasses" :style="barStyle"></div>
|
||||
<div :class="tabCls(item)" v-for="(item, index) in navList" @click="handleChange(index)" @dblclick="handleDblclick(index)" @contextmenu.stop="handleContextmenu(index, $event)">
|
||||
<div :class="tabCls(item)" v-for="(item, index) in navList" @click="handleChange(index)" @dblclick="handleDblclick(index)" @contextmenu.stop="handleContextmenu(index, $event)" @selectstart.stop="handlePreventSelect(index, $event)">
|
||||
<Icon v-if="item.icon !== ''" :type="item.icon"></Icon>
|
||||
<Render v-if="item.labelType === 'function'" :render="item.label"></Render>
|
||||
<template v-else>{{ item.label }}</template>
|
||||
|
@ -333,6 +333,13 @@
|
|||
handleClickContextMenuOutside () {
|
||||
this.contextMenuVisible = false;
|
||||
},
|
||||
// 禁用右键选择文本
|
||||
handlePreventSelect (index, event) {
|
||||
const nav = this.navList[index];
|
||||
if (!nav || nav.disabled || !nav.contextMenu) return;
|
||||
|
||||
event.preventDefault();
|
||||
},
|
||||
handleTabKeyNavigation(e){
|
||||
if (e.keyCode !== 37 && e.keyCode !== 39) return;
|
||||
const direction = e.keyCode === 39 ? 1 : -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue