修改图片魔方显示

v1.0.0
于肖磊 2024-08-29 15:52:33 +08:00
parent 6c6395fdac
commit ad63efebc7
1 changed files with 18 additions and 2 deletions

View File

@ -3,8 +3,8 @@
<div class="decorate-cube">
<ul v-for="(n, index) in densityNum" :key="index" class="cube-col">
<li v-for="(i, index1) in densityNum" :key="index1" class="cube-item" :style="{ width: cubeCellWidth + 'px', height: cubeCellHeight + 'px' }" :data-x="n" :data-y="i" @click="onClickCubeItem($event)" @mouseenter="onEnterCubeItem($event)">
<div :class="['w h item', { 'item-selecting': isSelecting(n, i), 'item-selected': isSelected(n, i) }]">
<icon name="add" color="9" :style="{ 'line-height': cubeCellHeight + 'px' }"></icon>
<div :class="['w h item do-not-trigger', { 'item-selecting': isSelecting(n, i), 'item-selected': isSelected(n, i) }]">
<icon name="add" color="9" class="do-not-trigger" :style="{ 'line-height': cubeCellHeight + 'px' }"></icon>
</div>
</li>
</ul>
@ -70,6 +70,7 @@ const selected_active = ref(0);
//#region
const density = ref('4');
//#endregion
const selectingItem = reactive<any>({
tempStart: null,
tempEnd: null,
@ -77,6 +78,21 @@ const selectingItem = reactive<any>({
end: null,
});
onMounted(() => {
//
document.addEventListener('click', outerClick);
});
onUnmounted(() => {
//
document.removeEventListener('click', outerClick);
});
//
const outerClick = (e: any) => {
if (!e.target.className.includes('do-not-trigger')) {
clearSelecting();
}
};
const selectedList = ref(props.list);
//