UNPKG

verstak

Version:
18 lines (17 loc) 602 B
import { setBasis } from "reactronic"; import { Block } from "verstak"; import { rxModel } from "./common/Utils.js"; export function Image(declaration) { return (Block(setBasis(declaration, { preparation() { var _a; (_a = this.model) !== null && _a !== void 0 ? _a : (this.model = rxModel({ source: undefined })); }, body() { const m = this.model; this.style.backgroundImage = `url(${m.source})`; this.style.backgroundSize = "contain"; this.style.backgroundRepeat = "no-repeat"; }, }))); }