Skip to content
This repository was archived by the owner on Nov 24, 2020. It is now read-only.
This repository was archived by the owner on Nov 24, 2020. It is now read-only.

使用 nested routes 以及 link-to helper 替代自己编写的 helper #7

@IronBlood

Description

@IronBlood

使用 ember 的特性,便于维护,作为 #6 的子任务。

example:

import Ember from 'ember';

var Router = Ember.Router.extend({
  location: config.locationType
});

Router.map(function() {
    this.resource('section', { path: '/section/:sec_id' }, function() {
        this.resource('board', { path: '/:board_name' });
    });
});

export default Router;

下列代码将会自动变成 /section/1/syop 的链接

{{#link-to 'board' '1' 'sysop'}}sysop{{/link-to}}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions