Skip to content

Commit

Permalink
fix(editor): icon使用editor封装的icon组件
Browse files Browse the repository at this point in the history
  • Loading branch information
parisma authored and jia000 committed Sep 22, 2022
1 parent fc749b7 commit 441a412
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions packages/editor/src/layouts/sidebar/code-block/CodeBlockList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
<div class="list-item">
<div class="code-name">{{ value.name }}({{ key }})</div>
<div class="right-tool">
<el-tooltip effect="dark" content="编辑" placement="top">
<el-icon class="edit-icon" @click="editCode(key)"><Edit /></el-icon>
<el-tooltip effect="dark" :content="editable ? '编辑' : '查看'" placement="top">
<Icon :icon="editable ? Edit : View" class="edit-icon" @click="editCode(key)"></Icon>
</el-tooltip>
<el-tooltip effect="dark" content="删除" placement="top">
<el-icon class="edit-icon" @click="deleteCode(key)"><Close /></el-icon>
<el-tooltip effect="dark" content="删除" placement="top" v-if="editable">
<Icon :icon="Close" class="edit-icon" @click="deleteCode(key)"></Icon>
</el-tooltip>
<slot name="code-block-panel-tool" :id="key"></slot>
</div>
Expand All @@ -36,10 +36,11 @@

<script lang="ts" setup>
import { computed, inject, ref, watchEffect } from 'vue';
import { Close, Edit } from '@element-plus/icons-vue';
import { Close, Edit, View } from '@element-plus/icons-vue';
import { ElMessage } from 'element-plus';
import { flattenDeep, isEmpty, values } from 'lodash-es';
import Icon from '../../../components/Icon.vue';
import type { CodeBlockContent, Services } from '../../../type';
import { CodeBlockDSL, EditorMode } from '../../../type';
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/theme/code-block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
display: flex;
align-items: center;
.edit-icon {
padding: 0 5px;
margin: 0 5px;
}
}
.code-name {
Expand Down

0 comments on commit 441a412

Please sign in to comment.