mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
perf: 放映工具交互优化
This commit is contained in:
parent
ac414505e2
commit
d099ddc3ae
@ -31,6 +31,8 @@ const props = withDefaults(defineProps<{
|
|||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: 'update:value', payload: boolean): void
|
(event: 'update:value', payload: boolean): void
|
||||||
|
(event: 'show'): void
|
||||||
|
(event: 'hide'): void
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const instance = ref<Instance>()
|
const instance = ref<Instance>()
|
||||||
@ -69,10 +71,16 @@ onMounted(() => {
|
|||||||
contentVisible.value = true
|
contentVisible.value = true
|
||||||
},
|
},
|
||||||
onShown() {
|
onShown() {
|
||||||
if (!props.value) emit('update:value', true)
|
if (!props.value) {
|
||||||
|
emit('update:value', true)
|
||||||
|
emit('show')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onHidden() {
|
onHidden() {
|
||||||
if (props.value) emit('update:value', false)
|
if (props.value) {
|
||||||
|
emit('update:value', false)
|
||||||
|
emit('hide')
|
||||||
|
}
|
||||||
contentVisible.value = false
|
contentVisible.value = false
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -207,11 +207,12 @@ const contextmenus = (): ContextmenuItem[] => {
|
|||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
|
||||||
.tool-btn {
|
.tool-btn {
|
||||||
opacity: .35;
|
opacity: .3;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
transition: opacity $transitionDelay;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
opacity: .9;
|
opacity: .95;
|
||||||
}
|
}
|
||||||
& + .tool-btn {
|
& + .tool-btn {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
|
@ -198,6 +198,7 @@ const changeTime = (e: FocusEvent | KeyboardEvent, type: 'minute' | 'second') =>
|
|||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
line-height: 1;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -29,7 +29,7 @@
|
|||||||
>
|
>
|
||||||
<div class="tools" @mousedown.stop>
|
<div class="tools" @mousedown.stop>
|
||||||
<div class="tool-content">
|
<div class="tool-content">
|
||||||
<Popover placement="top" trigger="manual" :value="sizePopoverType === 'pen'">
|
<Popover placement="top" trigger="manual" :value="sizePopoverType === 'pen'" @hide="sizePopoverType = ''">
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="setting">
|
<div class="setting">
|
||||||
<div class="label">墨迹粗细:</div>
|
<div class="label">墨迹粗细:</div>
|
||||||
@ -40,7 +40,7 @@
|
|||||||
<IconWrite class="icon" />
|
<IconWrite class="icon" />
|
||||||
</div>
|
</div>
|
||||||
</Popover>
|
</Popover>
|
||||||
<Popover placement="top" trigger="manual" :value="sizePopoverType === 'shape'">
|
<Popover placement="top" trigger="manual" :value="sizePopoverType === 'shape'" @hide="sizePopoverType = ''">
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="setting shape">
|
<div class="setting shape">
|
||||||
<div class="shapes">
|
<div class="shapes">
|
||||||
@ -57,7 +57,7 @@
|
|||||||
<IconGraphicDesign class="icon" />
|
<IconGraphicDesign class="icon" />
|
||||||
</div>
|
</div>
|
||||||
</Popover>
|
</Popover>
|
||||||
<Popover placement="top" trigger="manual" :value="sizePopoverType === 'mark'">
|
<Popover placement="top" trigger="manual" :value="sizePopoverType === 'mark'" @hide="sizePopoverType = ''">
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="setting">
|
<div class="setting">
|
||||||
<div class="label">墨迹粗细:</div>
|
<div class="label">墨迹粗细:</div>
|
||||||
@ -68,7 +68,7 @@
|
|||||||
<IconHighLight class="icon" />
|
<IconHighLight class="icon" />
|
||||||
</div>
|
</div>
|
||||||
</Popover>
|
</Popover>
|
||||||
<Popover placement="top" trigger="manual" :value="sizePopoverType === 'eraser'">
|
<Popover placement="top" trigger="manual" :value="sizePopoverType === 'eraser'" @hide="sizePopoverType = ''">
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="setting">
|
<div class="setting">
|
||||||
<div class="label">橡皮大小:</div>
|
<div class="label">橡皮大小:</div>
|
||||||
@ -149,13 +149,8 @@ const rubberSize = ref(80)
|
|||||||
const shapeSize = ref(4)
|
const shapeSize = ref(4)
|
||||||
|
|
||||||
const changeModel = (model: WritingBoardModel) => {
|
const changeModel = (model: WritingBoardModel) => {
|
||||||
if (writingBoardModel.value === model) {
|
writingBoardModel.value = model
|
||||||
sizePopoverType.value = sizePopoverType.value === model ? '' : model
|
sizePopoverType.value = sizePopoverType.value === model ? '' : model
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (sizePopoverType.value) sizePopoverType.value = ''
|
|
||||||
writingBoardModel.value = model
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清除画布上的墨迹
|
// 清除画布上的墨迹
|
||||||
|
Loading…
x
Reference in New Issue
Block a user