Skip to content

Commit

Permalink
style(editor): icon组件图标样式调整
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen authored and jia000 committed Sep 8, 2022
1 parent 3e024d2 commit c2cd1c4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
10 changes: 6 additions & 4 deletions packages/editor/src/components/Icon.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<template>
<el-icon v-if="!icon"><Edit></Edit></el-icon>
<el-icon v-else-if="typeof icon === 'string' && icon.startsWith('http')"><img :src="icon" /></el-icon>
<i v-else-if="typeof icon === 'string'" :class="icon"></i>
<el-icon v-else><component :is="toRaw(icon)"></component></el-icon>
<el-icon v-if="!icon" class="magic-editor-icon"><Edit></Edit></el-icon>
<el-icon v-else-if="typeof icon === 'string' && icon.startsWith('http')" class="magic-editor-icon"
><img :src="icon"
/></el-icon>
<i v-else-if="typeof icon === 'string'" class="magic-editor-icon" :class="icon"></i>
<el-icon v-else class="magic-editor-icon"><component :is="toRaw(icon)"></component></el-icon>
</template>

<script lang="ts" setup>
Expand Down
5 changes: 0 additions & 5 deletions packages/editor/src/theme/component-list-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@
}
}

img {
max-width: 100%;
max-height: 100%;
}

span {
font-size: 12px;
text-align: center;
Expand Down
4 changes: 4 additions & 0 deletions packages/editor/src/theme/content-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
color: $--font-color;
}

.magic-editor-icon {
margin-right: 5px;
}

&.divider {
padding: 0 14px;

Expand Down
6 changes: 6 additions & 0 deletions packages/editor/src/theme/icon.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.magic-editor-icon {
img {
max-width: 100%;
max-height: 100%;
}
}
1 change: 1 addition & 0 deletions packages/editor/src/theme/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
@import "./content-menu.scss";
@import "./stage.scss";
@import "./code-editor.scss";
@import "./icon.scss";

0 comments on commit c2cd1c4

Please sign in to comment.