Fluxible Plugin RoutrFluxible 路由插件
Fluxible Plugin Routr 是给 Fluxible 应用提供路由方式的插件。
示例代码:
var Fluxible = require('fluxible');
var routrPlugin = require('fluxible-plugin-routr');
var app = new Fluxible();var pluginInstance = routrPlugin({
routes: {
user: {
path: '/user/:id',
method: 'get',
// flux-router-component uses this action when the route is matched
action: function (actionContext, payload, done) {
// ...
done();
}
}
}
});
app.plug(pluginInstance);评论
