Sha256: 3feafe8d377beb8801925232204d36a4badfc10b0cd4012a1787cb777fa1b90d
Contents?: true
Size: 555 Bytes
Versions: 7
Compression:
Stored size: 555 Bytes
Contents
import { htmlAttributes } from "../html/html-attributes"; export class Link { attributes: Record<string, any>; children: any[]; href: string; constructor(href: string, attributes: Record<string, any> = {}) { this.children = []; this.attributes = attributes; this.href = href; } get renderWrapper(): string { return `<a href='${this.href}' ${htmlAttributes(this.attributes)}>${this.children.map(child => child.renderWrapper).join("")}</a>`; } add(child: any): Link { this.children.push(child); return this; } }
Version data entries
7 entries across 7 versions & 1 rubygems