Skip to content
This repository has been archived by the owner on Jan 22, 2018. It is now read-only.

HsuTing/react-mdl-page

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React MDL Page

You can use it to put your component in an array.

Use

  • This is a react class. As a result, you need to use ReactDOM.render to render.
  import React from 'ract';
  import ReactDOM from 'react-dom';
  import page from 'react-mdl-page';

  import Component from './path/to/component';

  let data = [
    {
      "id": "page-one",
      "components": [
        {
          "component": Component,
          "data": (data Copmonent use)
        }
      ]
    },
    {
      "id": "page-two",
      "components": [
        {
          "component": Component,
          "data": (data Copmonent use)
        }
      ]
    }
  ];

  ReactDOM.render(<Page data={ data }/>, document.getElementById("root"));

Data

  • data:
  data = {
    'id': 'pageId',
    'class': 'pageClass',
    'style': {color: 'black'},
    'cells': []
  }

// It will render a html like this
  <div id="pageId" class="page-content pageClass" style="color: black;"></div>
  • you not need to set all id, class, style and cells. You just use attributes needed.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published