How to use the san-router.router.start 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-store / example / todos / src / main.js View on Github external
import List from './todo/List'
import Form from './todo/Form'
import AddCategory from './category/Add'
import EditCategory from './category/Edit'

import {router} from 'san-router'

router.add({rule: '/', Component: List, target: '#app'});
router.add({rule: '/todos/category/:category', Component: List, target: '#app'});
router.add({rule: '/add', Component: Form, target: '#app'});
router.add({rule: '/edit/:id', Component: Form, target: '#app'});
router.add({rule: '/category/add', Component: AddCategory, target: '#app'});
router.add({rule: '/category/edit', Component: EditCategory, target: '#app'});

// start
router.start();
github baidu / san / example / todos-store / src / main.js View on Github external
import List from './todo/List'
import Form from './todo/Form'
import AddCategory from './category/Add'
import EditCategory from './category/Edit'

import {router} from 'san-router'

router.add({rule: '/', Component: List, target: '#app'});
router.add({rule: '/todos/category/:category', Component: List, target: '#app'});
router.add({rule: '/add', Component: Form, target: '#app'});
router.add({rule: '/edit/:id', Component: Form, target: '#app'});
router.add({rule: '/category/add', Component: AddCategory, target: '#app'});
router.add({rule: '/category/edit', Component: EditCategory, target: '#app'});

// start
router.start();
github baidu / san / example / todos-esnext / src / main.js View on Github external
import List from './todo/List'
import Form from './todo/Form'
import AddCategory from './category/Add'
import EditCategory from './category/Edit'

import {router} from 'san-router'

router.add({rule: '/', Component: List, target: '#app'});
router.add({rule: '/todos/category/:category', Component: List, target: '#app'});
router.add({rule: '/add', Component: Form, target: '#app'});
router.add({rule: '/edit/:id', Component: Form, target: '#app'});
router.add({rule: '/category/add', Component: AddCategory, target: '#app'});
router.add({rule: '/category/edit', Component: EditCategory, target: '#app'});

// start
router.start()
github ecomfe / san-realworld-app / src / index.js View on Github external
});

    router.add({rule: '/', Component: Home});
    router.add({rule: '/tag/:tag', Component: Home});
    router.add({rule: '/my-feed', Component: Home});
    router.add({rule: '/login', Component: Login});
    router.add({rule: '/register', Component: Register});
    router.add({rule: '/settings', Component: Setting});
    router.add({rule: '/profile/:user', Component: ProfileMy});
    router.add({rule: '/profile/:user/favorites', Component: ProfileFavorited});
    router.add({rule: '/editor', Component: ArticleEdit});
    router.add({rule: '/editor/:slug', Component: ArticleEdit});
    router.add({rule: '/article/:slug', Component: ArticleView});

    
    router.start();
}
github ecomfe / santd / site / src / index.js View on Github external
let doc = new Doc();
                        doc.attach(document.getElementById('content'));
                    }).catch(e => {
                        that.handleError(e);
                    });
                }
                that.hlCode();
            }
            this.nextTick(() => {
                if (window.document.documentElement.scrollTop > 110) {
                    window.scroll(0, 110);
                }
            });
        });

        router.start();
    }

san-router

Router for San

MIT
Latest version published 1 year ago

Package Health Score

52 / 100
Full package analysis

Similar packages