diff --git a/src/components/ReIcon/src/hooks.ts b/src/components/ReIcon/src/hooks.ts index 68bb810a0..adaac65af 100644 --- a/src/components/ReIcon/src/hooks.ts +++ b/src/components/ReIcon/src/hooks.ts @@ -1,11 +1,6 @@ import type { iconType } from "./types"; import { h, defineComponent, type Component } from "vue"; -import { - FontIcon, - getIconOffline, - IconifyIconOnline, - IconifyIconOffline -} from "../index"; +import { FontIcon, IconifyIconOnline, IconifyIconOffline } from "../index"; /** * 支持 `iconfont`、自定义 `svg` 以及 `iconify` 中所有的图标 @@ -57,7 +52,7 @@ export function useRenderIcon(icon: any, attrs?: iconType): Component { const IconifyIcon = icon && icon.includes(":") ? IconifyIconOnline : IconifyIconOffline; return h(IconifyIcon, { - icon: getIconOffline(icon), + icon, ...attrs }); } diff --git a/src/components/ReIcon/src/iconifyIconOffline.ts b/src/components/ReIcon/src/iconifyIconOffline.ts index e5782b2ec..d902a6611 100644 --- a/src/components/ReIcon/src/iconifyIconOffline.ts +++ b/src/components/ReIcon/src/iconifyIconOffline.ts @@ -1,4 +1,5 @@ import { h, defineComponent } from "vue"; +import { getIconOffline } from "../index"; import { Icon as IconifyIcon, addIcon } from "@iconify/vue/dist/offline"; // Iconify Icon在Vue里本地使用(用于内网环境) @@ -17,7 +18,7 @@ export default defineComponent({ return h( IconifyIcon, { - icon: this.icon, + icon: getIconOffline(this.icon), "aria-hidden": false, style: attrs?.style ? Object.assign(attrs.style, { outline: "none" }) diff --git a/src/views/login/components/LoginPhone.vue b/src/views/login/components/LoginPhone.vue index ded9251ab..6247704bd 100644 --- a/src/views/login/components/LoginPhone.vue +++ b/src/views/login/components/LoginPhone.vue @@ -10,6 +10,7 @@ import { useVerifyCode } from "../utils/verifyCode"; import { useUserStoreHook } from "@/store/modules/user"; import { useRenderIcon } from "@/components/ReIcon/src/hooks"; import Iphone from "~icons/ep/iphone"; +import Keyhole from "~icons/ri/shield-keyhole-line"; const { t } = useI18n(); const loading = ref(false); @@ -64,7 +65,7 @@ function onBack() { v-model="ruleForm.verifyCode" clearable :placeholder="t('login.pureSmsVerifyCode')" - :prefix-icon="useRenderIcon('ri:shield-keyhole-line')" + :prefix-icon="useRenderIcon(Keyhole)" /> { v-model="ruleForm.verifyCode" clearable :placeholder="t('login.pureVerifyCode')" - :prefix-icon="useRenderIcon('ri:shield-keyhole-line')" + :prefix-icon="useRenderIcon(Keyhole)" >