You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mobilizon.chapril.org-mobil.../js/src/mixins/resource.ts

18 lines
471 B

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("/");
}
}