How to use the san-router.Link 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 / todo / List.js View on Github external
define(function (require) {
    var san = require('san');
    var service = require('../service');
    var template = require('tpl!./List.html');

    return san.defineComponent({
        template: template,

        filters: {
            formatDate: require('../filters').formatDate
        },

        components: {
            'router-link': require('san-router').Link
        },

        route: function () {
            var route = this.data.get('route');
            var todos = service.todos(+(route.query.category || 0));

            this.data.set('todos', todos);
            if (!this.data.get('categories')) {
                this.data.set('categories', service.categories());
            }
        },

        doneTodo: function (index) {
            var todo = this.data.get('todos', index);
            service.doneTodo(todo.id);
github baidu / san / example / todos-amd / src / todo / List-perf.js View on Github external
define(function (require) {
    var san = require('san');

    var service = require('../service-perf');
    var template = require('tpl!./List.html');

    return san.defineComponent({
        template: template,

        components: {
            'router-link': require('san-router').Link
        },

        filters: {
            formatDate: require('../filters').formatDate
        },

        route: function () {
            var now = new Date();
            var route = this.data.get('route');
            var todos = service.todos(+(route.query.category || 0));

            this.data.set('todos', todos);
            if (!this.data.get('categories')) {
                this.data.set('categories', service.categories());
            }

san-router

Router for San

MIT
Latest version published 1 year ago

Package Health Score

52 / 100
Full package analysis

Similar packages