import MoneySpan from '@eastsideco/escshopify/src/plugins/easycurrency/MoneySpan.js'
MoneySpan
Represents an element which renders a monetary value.
Constructor Summary
Public Constructor | ||
public |
constructor(money: js-money, easyCurrency: src/plugins/easycurrency/main.js~EasyCurrency) Create a new MoneySpan instance. |
Member Summary
Private Members | ||
private |
_easyCurrency: src/plugins/easycurrency/main.js~EasyCurrency |
|
private |
_element: DOMNode |
|
private |
|
Method Summary
Public Methods | ||
public |
destroy() Destroys this MoneySpan. |
|
public |
getElement(): DOMNode Retrieves the element this money span is attached to. |
|
public |
render() Re-render the element. |
|
public |
Change the value of this MoneySpan. |
|
public |
setElement(el: DOMNode) Attaches this money span to the given element. |
|
public |
setRenderElement(element: DOMNode) Set an element which this money value will render to when changed. |
Public Constructors
Private Members
private _easyCurrency: src/plugins/easycurrency/main.js~EasyCurrency source
private _element: DOMNode source
Public Methods
public getElement(): DOMNode source
Retrieves the element this money span is attached to.
Return:
DOMNode |
public set(money: js-money) source
Change the value of this MoneySpan.
Params:
Name | Type | Attribute | Description |
money | js-money |
public setElement(el: DOMNode) source
Attaches this money span to the given element.
Params:
Name | Type | Attribute | Description |
el | DOMNode | The element to attach to. |
public setRenderElement(element: DOMNode) source
Set an element which this money value will render to when changed.
Params:
Name | Type | Attribute | Description |
element | DOMNode | The element to render to. |