react-antd-admin-panel
Version:
Easy prototyping admin panel using React and Antd
42 lines • 979 B
JavaScript
import Path from "./Path";
export default class Route {
constructor() {
this._gets = [];
this._posts = [];
this._exact = false;
this._access = true;
}
copy() {
let route = new Route();
route._path = this._path.copy();
route._gets = this._gets.map(r => r.copy());
route.Component = this.Component;
return route;
}
key(key) {
this._key = key;
this._path = new Path({ matchedPath: key });
return this;
}
get(value) {
this._gets.push(value);
return this;
}
post(value) {
this._posts.push(value);
return this;
}
exact() {
this._exact = true;
return this;
}
component(value) {
this.Component = value;
return this;
}
access(value) {
this._access = value;
return this;
}
}
//# sourceMappingURL=Route.js.map