mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-08-06 10:57:26 +08:00
fix(im): 迁移 Element UI 图标并修复 Vue 3 兼容问题
- 新增 migrate-legacy-icons 脚本,批量将旧图标替换为 legacy-el-icon 组件 - 多个组件中将 <i class="el-icon-*"> 统一改为 <legacy-el-icon name="el-icon-*"> - 将 size="mini"/"medium" 调整为 Element Plus 的 small/default - 新增 legacy-el-icon 全局组件及图标映射逻辑
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<el-header class="header" height="50px">
|
||||
<p>添加好友</p>
|
||||
<p class="tools">
|
||||
<i class="el-icon-close" @click="close" />
|
||||
<legacy-el-icon name="el-icon-close" @click="close" />
|
||||
</p>
|
||||
</el-header>
|
||||
<el-main class="main">
|
||||
@@ -13,7 +13,7 @@
|
||||
v-model="mobile"
|
||||
id="serach-mobile"
|
||||
class="input"
|
||||
prefix-icon="el-icon-search"
|
||||
:prefix-icon="$legacyIcon('el-icon-search')"
|
||||
placeholder="请输入对方手机号(精确查找)"
|
||||
clearable
|
||||
@keyup.enter="onSubmit"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="lum-dialog-mask animated fadeIn">
|
||||
<el-container class="container" v-outside="close">
|
||||
<el-header class="no-padding header" height="180px">
|
||||
<i class="close el-icon-error pointer" @click="close" />
|
||||
<legacy-el-icon name="el-icon-error" class="close pointer" @click="close" />
|
||||
<div class="img-banner">
|
||||
<img :src="detail.bag" class="img-banner" />
|
||||
</div>
|
||||
@@ -55,9 +55,9 @@
|
||||
@keyup.enter="editRemarkSubmit"
|
||||
/>
|
||||
</span>
|
||||
<i
|
||||
<legacy-el-icon
|
||||
v-show="!editRemark.isShow"
|
||||
class="el-icon-edit-outline"
|
||||
name="el-icon-edit-outline"
|
||||
@click="clickEditRemark"
|
||||
/>
|
||||
</div>
|
||||
@@ -76,7 +76,7 @@
|
||||
v-if="detail.friend_status == 1 && detail.friend_apply == 0"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
:icon="$legacyIcon('el-icon-circle-plus-outline')"
|
||||
@click="apply.isShow = true"
|
||||
>添加好友
|
||||
</el-button>
|
||||
@@ -90,7 +90,7 @@
|
||||
v-else-if="detail.friend_status == 2"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-s-promotion"
|
||||
:icon="$legacyIcon('el-icon-s-promotion')"
|
||||
@click="sendMessage(detail)"
|
||||
>发消息
|
||||
</el-button>
|
||||
@@ -125,6 +125,7 @@
|
||||
// import { ServeSearchUser } from "@/api/user";
|
||||
import { ServeCreateContact, ServeEditContactRemark } from "@/api/contacts";
|
||||
import { toTalk } from "@/utils/talk";
|
||||
import { defaultUserBanner } from "@/assets/images";
|
||||
|
||||
export default {
|
||||
name: "UserCardDetail",
|
||||
@@ -144,7 +145,7 @@ export default {
|
||||
friend_status: 0,
|
||||
friend_apply: 0,
|
||||
nickname_remark: "",
|
||||
bag: require("@/assets/image/default-user-banner.png"),
|
||||
bag: defaultUserBanner,
|
||||
gender: 0,
|
||||
},
|
||||
|
||||
@@ -425,7 +426,7 @@ export default {
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.el-icon-edit-outline {
|
||||
.legacy-el-icon {
|
||||
margin-left: 3px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import store from "@/store";
|
||||
import { setupElementPlus } from "@/plugins/element";
|
||||
import { setupLegacyMessage } from "@/utils/message";
|
||||
import { registerDirectives } from "@/core/directives";
|
||||
import LegacyElIcon from "@/components/global/LegacyElIcon.vue";
|
||||
import { resolveLegacyIcon } from "@/core/legacy-icon-map";
|
||||
|
||||
export default {
|
||||
install(app) {
|
||||
@@ -30,6 +32,8 @@ export default {
|
||||
setupElementPlus(cardApp);
|
||||
setupLegacyMessage(cardApp);
|
||||
registerDirectives(cardApp);
|
||||
cardApp.component("legacy-el-icon", LegacyElIcon);
|
||||
cardApp.config.globalProperties.$legacyIcon = resolveLegacyIcon;
|
||||
cardApp.use(router);
|
||||
cardApp.use(store);
|
||||
cardApp.mount(container);
|
||||
|
||||
Reference in New Issue
Block a user