Sha256: 972fa16e725d31f95646f1c496deca85921ce8afda071e4833c5467db27b8db1
Contents?: true
Size: 541 Bytes
Versions: 17
Compression:
Stored size: 541 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 render(): string { return `<a href='${this.href}' ${htmlAttributes(this.attributes)}>${this.children.map(child => child.render).join("")}</a>`; } add(child: any): Link { this.children.push(child); return this; } }
Version data entries
17 entries across 17 versions & 1 rubygems