/
githubmirror
/
ionic
Обзор
Документация
Войти
/
githubmirror
/
ionic
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/vue/src/components/IonIcon.ts
54 строки
1 KB
Christian Bromann
fix(vue): update output target and resolve type issues (#30239)
13 мар 2025, 23:40
Не верифицирован
13 мар 2025, 23:40
6dcb143
Код
Авторство
О чём код?
import type { JSX } from "@ionic/core/components"; import { defineCustomElement } from "ionicons/components/ion-icon.js"; import type { PropType } from "vue"; import { h, defineComponent } from "vue"; import { getConfig } from "../utils"; export const IonIcon = /*@__PURE__*/ defineComponent<JSX.IonIcon>( (props, { slots }) => { defineCustomElement(); return () => { const { icon, ios, md, mode } = props; let iconToUse: typeof icon; const config = getConfig(); const iconMode = mode || config?.get("mode"); if (ios || md) { if (iconMode === "ios") { iconToUse = ios ?? md ?? icon; } else { iconToUse = md ?? ios ?? icon; } } else { iconToUse = icon; } return h( "ion-icon", { ...props, icon: iconToUse, }, slots ); }; }, { name: "IonIcon", props: { color: { type: String as PropType<string> }, flipRtl: { type: Boolean as PropType<boolean> }, icon: { type: String as PropType<string> }, ios: { type: String as PropType<string> }, lazy: { type: Boolean as PropType<boolean> }, md: { type: String as PropType<string> }, mode: { type: String as PropType<string> }, name: { type: String as PropType<string> }, size: { type: String as PropType<string> }, src: { type: String as PropType<string> }, }, } );