Introduce group basic federation, event new page and notifications
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
17
js/src/mixins/resource.ts
Normal file
17
js/src/mixins/resource.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Component, Vue } from "vue-property-decorator";
|
||||
import { IResource } from "@/types/resource";
|
||||
|
||||
@Component
|
||||
export default class ResourceMixin extends Vue {
|
||||
static resourcePath(resource: IResource): string {
|
||||
const { path } = resource;
|
||||
if (path && path[0] === "/") {
|
||||
return path.slice(1);
|
||||
}
|
||||
return path || "";
|
||||
}
|
||||
|
||||
static resourcePathArray(resource: IResource): string[] {
|
||||
return ResourceMixin.resourcePath(resource).split("/");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user