1.2.0 • Published 4 years ago

minimvc v1.2.0

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

MiniMVC

MiniMVC is a lightweight solution to bind javascript objects to DOM elements

Get Started

1. Include the module

import MVC from "https://unpkg.com/minimvc";

2. Initialise MiniMVC

let data = {
    header = "My first blog post"
}

let mvc = new MVC({data});

3. Edit the DOM

<h1 data-bind="header"></h1>
<p data-bind="paragraph">
  Lorem ipsum dolor sit, amet consectetur adipisicing elit. Pariatur rerum
  consectetur nemo accusantium, quos nisi fuga eius explicabo! Est qui commodi,
  doloribus fugiat in eveniet iste iure neque voluptatem vel.
</p>

Parameters

MiniMVC can accept two parameters

ParameterDescriptionDefault
dataAn Object that contains all of the data that is to be syncronised with the DOMMiniMVC.data = {}
bindAttributeThe attribute that will be used in the HTML to identify it's data equivelentdata-bind

TODO:

  • Support Nested data object
1.2.0

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago