禁用全局右键菜单,其他小调整

This commit is contained in:
pipipi-pikachu 2021-01-22 10:27:01 +08:00
parent 1f227e19ae
commit e282818a7c
5 changed files with 17 additions and 4 deletions

View File

@ -6,7 +6,7 @@
<meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>Hamster 幻灯片 v0.0.1-dev</title>
<title>PPTist v0.0.1-dev</title>
</head>
<body>
<noscript>
@ -14,5 +14,9 @@
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script>
document.oncontextmenu = e => e.preventDefault()
</script>
</body>
</html>

View File

@ -1,5 +1,5 @@
<template>
<div class="color-picker" @contextmenu.prevent>
<div class="color-picker">
<div class="picker-saturation-wrap">
<Saturation :value="color" :hue="hue" @change="value => changeColor(value)" />
</div>

View File

@ -17,7 +17,12 @@ export default () => {
store.commit(MutationTypes.SET_CANVAS_PERCENTAGE, percentage)
}
const setCanvasPercentage = (percentage: number) => {
store.commit(MutationTypes.SET_CANVAS_PERCENTAGE, percentage)
}
return {
scaleCanvas,
setCanvasPercentage,
}
}

View File

@ -117,7 +117,7 @@ export default defineComponent({
user-select: none;
&.multi-select {
opacity: .3;
opacity: 0;
}
}
.animation-index {

View File

@ -51,6 +51,9 @@
<IconMinus class="handler-item viewport-size" @click="scaleCanvas('-')" />
<span class="text">{{canvasScalePercentage}}</span>
<IconPlus class="handler-item viewport-size" @click="scaleCanvas('+')" />
<Tooltip :mouseLeaveDelay="0" :mouseEnterDelay="0.5" title="适配屏幕">
<IconFullScreen class="handler-item viewport-size-adaptation" @click="setCanvasPercentage(90)" />
</Tooltip>
</div>
</div>
</template>
@ -85,7 +88,7 @@ export default defineComponent({
const canvasScalePercentage = computed(() => parseInt(canvasScale.value * 100 + '') + '%')
const { scaleCanvas } = useScaleCanvas()
const { scaleCanvas, setCanvasPercentage } = useScaleCanvas()
const { redo, undo } = useHistorySnapshot()
const { createImageElement, createChartElement } = useCreateElement()
@ -123,6 +126,7 @@ export default defineComponent({
return {
scaleCanvas,
setCanvasPercentage,
canvasScalePercentage,
canUndo,
canRedo,