How to use the san-router.router function in san-router

To help you get started, we’ve selected a few san-router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github baidu / san / example / todos-amd / src / app-perf.js View on Github external
define(function (require) {
    var List = require('./todo/List-perf');
    var Form = require('./todo/Form');
    var AddCategory = require('./category/Add');
    var EditCategory = require('./category/Edit');

    var router = require('san-router').router;
    router.add({rule: '/', Component: List, target: '#wrap'});
    router.add({rule: '/todos/category/:category', Component: List, target: '#wrap'});
    router.add({rule: '/add', Component: Form, target: '#wrap'});
    router.add({rule: '/edit/:id', Component: Form, target: '#wrap'});
    router.add({rule: '/category/add', Component: AddCategory, target: '#wrap'});
    router.add({rule: '/category/edit', Component: EditCategory, target: '#wrap'});

    return {
        init: function () {
            router.start();
        }
    };

});
github baidu / san / example / todos-amd / src / app.js View on Github external
define(function (require) {
    var List = require('./todo/List');
    var Form = require('./todo/Form');
    var AddCategory = require('./category/Add');
    var EditCategory = require('./category/Edit');

    var router = require('san-router').router;
    router.add({rule: '/', Component: List, target: '#wrap'});
    router.add({rule: '/todos/category/:category', Component: List, target: '#wrap'});
    router.add({rule: '/add', Component: Form, target: '#wrap'});
    router.add({rule: '/edit/:id', Component: Form, target: '#wrap'});
    router.add({rule: '/category/add', Component: AddCategory, target: '#wrap'});
    router.add({rule: '/category/edit', Component: EditCategory, target: '#wrap'});

    return {
        init: function () {
            router.start();
        }
    };

});

san-router

Router for San

MIT
Latest version published 1 year ago

Package Health Score

52 / 100
Full package analysis

Similar packages