update Tree

This commit is contained in:
梁灏 2020-07-02 09:51:06 +08:00
parent ffb3729603
commit 83e7c64fec

View file

@ -1,7 +1,7 @@
<template>
<collapse-transition :appear="appear">
<ul :class="classes">
<li @contextmenu.stop="handleContextmenu(data, $event)">
<li @contextmenu.stop="handleContextmenu(data, $event)" @selectstart.stop="handlePreventSelect(data, $event)">
<span :class="arrowClasses" @click="handleExpand">
<Icon v-if="showArrow" :type="arrowType" :custom="customArrowType" :size="arrowSize" />
<Icon v-if="showLoading" type="ios-loading" class="ivu-load-loop" />
@ -222,6 +222,11 @@
event.preventDefault();
this.dispatch('Tree', 'contextmenu', { data, event });
}
},
handlePreventSelect (data, event) {
if (data.contextmenu) {
event.preventDefault();
}
}
}
};