Skip to content

pantoken / plugins/pantoken/logos/src / getLogoDataUri

פונקציה: getLogoDataUri()

getLogoDataUri(product, layout?, colorMode?, lang?): string | undefined

בטא

קבל לוגו כ-URI מבוסס base64 data:image/svg+xml.

פרמטרים

product

Product

המוצר.

layout?

LogoLayout = "horizontal"

הפריסה (ברירת מחדל "horizontal").

colorMode?

LogoColorMode = "full-color"

עיבוד הצבעים (ברירת מחדל "full-color").

lang?

LogoLang

שפת הסימן המילולי המקומי, אם נדרשת גרסה מתורגמת.

מחזיר

string | undefined

ה-URI של הנתונים, או undefined אם צירוף זה אינו קיים.

דוגמה

השתמש בלוגו כ-src של <img>

ts
import { getLogoDataUri } from "@pantoken/plugin-logos";

const uri = getLogoDataUri("mastery", "icon", "color");
const img = document.createElement("img");
if (uri) img.src = uri;