Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化图片轮播组件以及编辑器区域对于键盘事件的处理 #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/pages/editor/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@publish="publishFn"
@save="saveFn"/>
</div>
<editorPan :scale.sync="canvasConfig.scale"/>
<editorPan :scale.sync="canvasConfig.scale" @cancel="cancelFn"/>
</div>
<!--属性编辑区域-->
<div class="el-attr-edit-wrapper scrollbar-wrapper">
Expand Down
8 changes: 6 additions & 2 deletions client/pages/editor/components/editor-panel/Index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="editor-pane" @click="handleClickCanvas" @keyup.esc="handleKeyup" ref="editorPane">
<div class="editor-pane" @click="handleClickCanvas" tabindex="0" @keyup.esc.delete="handleKeyup" ref="editorPane">
<div class="editor-pane-inner">
<div class="editor-main" :style="{transform: 'scale('+scale+')', width: projectData.width + 'px', height: projectData.height + 'px'}">
<div class="page-preview-wrapper" ref="canvas-panel" id="canvas-panel" :style="getCommonStyle(activePage.commonStyle)">
Expand Down Expand Up @@ -163,7 +163,11 @@
* @param e
*/
handleKeyup(e) {
console.log(1111, e);
if (e.key === 'Escape') {
this.$emit('cancel')
}else if (e.key === 'Delete') {
this.$store.dispatch('elementCommand', 'delete')
}
},
/**
* 提供截屏作为项目主图
Expand Down
2 changes: 1 addition & 1 deletion client/plugins/image-carousel/src/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
</script>

<style lang="scss" scoped>
.qk-image-carsousel,
.image-carsousel-swiper,
.image-carsousel-slide,
.image-carsousel-image{
display: block;
width: 100%;
height: 100%;
}
Expand Down