1.0.0 • Published 8 years ago

f7react v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Start

  • create index.js
  • put in
var   App = new F7ReactComposite({});
App.set({
    ajax: {
        baseURL: 'http://alerts.dev.rexsoftproduction.com/',
        timeout: 4000,
    },
    notify:{
        timeout: 3000
    },
    components: Components,
});
App.initialize();

Components - object (list) of ReactJS components, needs to parse pages.

Components = {
    Form: Form,
    ...
}

USE

App.pageShow - open page by name

App.pageShow({
    name: 'index',
    reload: true, //replace current page, back button will not work,  true - default
    animatePages: false //show new page with animation, false - defaul
});

Events

App.on('pageShow',function( pageName ){
    if (pageName != 'login' && !user.id ) {
        App.pageShow({
            name: 'login',
            reload: false, //replace
            animatePages: false //without animation
        });
    }
});
App.on('pageShow.dashboard',function( pageName ){
    Orders.fetch();
});