@saflib/links
@saflib/links
Interfaces
| Interface | Description |
|---|---|
| LinkOptions | Options for creating a fully-qualified url. |
Type Aliases
| Type Alias | Description |
|---|---|
| Link | A link to a page on a website, independent of the domain or protocol. |
| LinkMap | A collection of links, keyed by a name. |
Functions
| Function | Description |
|---|---|
| getClientName | Getter for the client name. |
| getHost | Utility to get the current host, including the port, e.g. "localhost:3000". |
| getProtocol | Utility to get the current protocol the same way document.location.protocol does, e.g. "http:" or "https:". |
| linkToHref | Given a Link object, return a fully-qualified url. Any provided params must be specified in the Link object. |
| linkToHrefWithHost | - |
| linkToProps | Given a Link object, return props which will work with vuetify components such as v-list-item and b-btn. What is returned is based on the current domain; if the link is to the same subdomain, this returns a "to" prop, otherwise it returns an "href" prop. That way a link will use vue-router wherever possible, to avoid full page reloads. |
| navigateToLink | Simple utility to do a full page redirect to a link. |
| setClientName | Call when the SPA starts, providing the name of the client. It should be the same as the subdomain, or "root" if it's the root domain. |