1.8.3 • Published 9 months ago

modapp-resource-component v1.8.3

Weekly downloads
6
License
MIT
Repository
github
Last release
9 months ago

view on npm

ModApp Resource Component

Collection of resource components following the component interface of modapp.

Installation

With npm:

npm install modapp-resource-component

With yarn:

yarn add modapp-resource-component

Usage

Import any selected component and use it.

import { ModelTxt } from 'modapp-resource-component';

let txt = new ModelTxt({ foo: "Hello World!" }, m => m.foo);
txt.render(document.body);

All components follows modapp's component interface:

Component Interface

A UI component

Kind: global interface

component.render(el) ⇒ HTMLElement | DocumentFragment | null

Renders the component by appending its own element(s) to the provided parent element. The provided element is not required to be empty, and may therefor contain other child elements. The component is not required to append any element in case it has nothing to render. Render is never called two times in succession without a call to unrender in between.

Kind: instance method of Component
Returns: HTMLElement | DocumentFragment | null - Element or document fragment appended to el. May be null or undefined if no elements was appended.

ParamTypeDescription
elHTMLElement | DocumentFragmentParent element in which to render the contents

component.unrender()

Unrenders the component and removes its element(s) from the parent element. Only called after render and never called two times in succession without a call to render in between.

Kind: instance method of Component

1.8.2

9 months ago

1.8.3

9 months ago

1.8.1

1 year ago

1.8.0

2 years ago

1.7.0

3 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago