mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-09 00:30:04 +08:00
style(editor): icon组件图标样式调整
This commit is contained in:
parent
3e024d21ed
commit
c2cd1c40cf
@ -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>
|
||||
|
@ -86,11 +86,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
|
@ -31,6 +31,10 @@
|
||||
color: $--font-color;
|
||||
}
|
||||
|
||||
.magic-editor-icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
&.divider {
|
||||
padding: 0 14px;
|
||||
|
||||
|
6
packages/editor/src/theme/icon.scss
Normal file
6
packages/editor/src/theme/icon.scss
Normal file
@ -0,0 +1,6 @@
|
||||
.magic-editor-icon {
|
||||
img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
}
|
@ -11,3 +11,4 @@
|
||||
@import "./content-menu.scss";
|
||||
@import "./stage.scss";
|
||||
@import "./code-editor.scss";
|
||||
@import "./icon.scss";
|
||||
|
Loading…
x
Reference in New Issue
Block a user