feat(core): Added support for renderProps in defs
This commit is contained in:
parent
53e72d148c
commit
982b3984b8
1 changed files with 12 additions and 0 deletions
|
@ -91,3 +91,15 @@ Defs.prototype.setIfUnset = function (name, value) {
|
||||||
if (typeof this.list[name] === 'undefined') this.list[name] = value
|
if (typeof this.list[name] === 'undefined') this.list[name] = value
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns defs as an object suitable for inclusion in renderprops
|
||||||
|
*
|
||||||
|
* @return {object} defs - A plain object representing the defs
|
||||||
|
*/
|
||||||
|
Defs.prototype.asRenderProps = function () {
|
||||||
|
return {
|
||||||
|
list: this.list,
|
||||||
|
forSvg: this.render(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue