Gefest/src/primitives/img.ts
2026-04-27 02:16:02 +03:00

13 lines
406 B
TypeScript

import { GefestElement } from "../element";
export class GefestImg extends GefestElement {
constructor(content : (GefestElement | string)[] | string, src: string) {
super(content);
this.setAttribute('src', src);
}
protected wrapHTML (content: string): string {
const attrString = this.attributesToString();
return `<img ${attrString}>${content}</img>`;
}
}