Skip to content

Commit

Permalink
发布兼容macos的删除键 删除组件
Browse files Browse the repository at this point in the history
  • Loading branch information
duolabmeng6 committed Aug 4, 2024
1 parent b388c02 commit 3bec448
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ on:
# - .gitignore
# - .editorconfig

workflow_run:
workflows: ["发布软件"]
types:
- completed
# workflow_run:
# workflows: ["发布软件"]
# types:
# - completed


# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
Expand Down
38 changes: 36 additions & 2 deletions GoEasyDesigner/frontend/src/app11.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,41 @@
<div id="tabLeftAttr" class="app2" style="height: 100%;">
<div v-if="store.当前拖拽组件数据 != undefined" class="组件列表"
style="padding-top: 10px; padding-left: 6px; padding-right: 6px;">
<!-- <el-tree-select-->
<!-- v-model="store.当前组件索引"-->
<!-- :data="store.组件列表tree"-->
<!-- default-expand-all-->
<!-- style="width: 100%;"-->
<!-- @node-click="data=>组件树选中(data)"-->
<!-- :filter-node-method="filterNodeMethod"-->
<!-- filterable-->
<!-- />-->
<el-tree-select
v-model="store.当前组件索引"
:data="store.组件列表tree"
default-expand-all
style="width: 100%;"
@node-click="data=>组件树选中(data)"
@node-click="data => 组件树选中(data)"
:filter-node-method="filterNodeMethod"
filterable
/>
>
<template #default="{ node, data }">
<!-- 使用flex布局让内容和按钮分开对齐 -->
<div style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
<!-- 左侧显示节点内容 -->
<span>{{ node.label }}</span>
<!-- 右侧删除按钮 -->
<el-button
v-if="data.id !== '1'"
type="danger"
size="small"
@click.stop="store.递归删除id(store.list,data.id);console.log(data)"
>
删除
</el-button>
</div>
</template>
</el-tree-select>

</div>
<component :is="store.当前组件名称2()"
Expand Down Expand Up @@ -621,6 +647,14 @@ let 复制组件 = []
function handleKeyDown(event) {
// 如果按下的是Cmd + S(Mac)或Ctrl + S(Windows/Linux)
console.log("按下某键盘", event.key)
if ((event.metaKey || event.ctrlKey) && event.key === "Backspace" || event.key === "Delete" ) {
//删除组件
event.preventDefault(); // 阻止浏览器默认保存行为
// 在这里执行你想要的操作,比如保存数据或触发特定的方法
console.log("按下了删除 Delete", store.当前拖拽组件数据);
store.递归删除id(store.list, store.当前多选组件ID)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ function handleKeyDown(event) {
// 如果按下的是Cmd + S(Mac)或Ctrl + S(Windows/Linux)
console.log("按下某键盘", event.key)
if (event.key === "Delete") {
if ((event.metaKey || event.ctrlKey) && event.key === "Backspace" || event.key === "Delete" ) {
event.preventDefault(); // 阻止浏览器默认保存行为
// 在这里执行你想要的操作,比如保存数据或触发特定的方法
console.log("按下了删除 Delete", store.当前拖拽组件数据);
Expand Down

0 comments on commit 3bec448

Please sign in to comment.