🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

spa-link

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

spa-link

> SPA Link component for Nuxt 3

1.0.1
unpublished
latest
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

SPA Link component for Nuxt 3

This module provides an easy way to work with internal and external links in Nuxt 3.

Installation

# yarn
yarn add @heavyy/nuxt-spa-link

# npm
npm install @heavyy/nuxt-spa-link

Add @heavyy/nuxt-spa-link to the modules section of your nuxt.config.js.

import { defineNuxtConfig } from 'nuxt'

export default defineNuxtConfig({
    modules: ['@heavyy/nuxt-spa-link'],
    spalink: {
      basePath: '/' // (default) that base path to strip from internal links.
      cdn: '' // (default) the fully qualified domain (including https://) for the media files.
    }
})

Use in template

<template>
  <div class="app">
    <SpaLink link="/my/subpage">Subpage</SpaLink>
  </div>
</template>

The link property accepts value formats. Either a string containing the path or full url or an object referencing this template:

interface SpaLinkProperty {
  url: string | Record<'url', string>
}

Example

<template>
  <SpaLink link="/internal-link">Internal Link</SpaLink>
  <SpaLink link="https://example.com">External Link</SpaLink>
  <SpaLink :link="{ url: '/internal-link' }">Link with object property</SpaLink>
  <SpaLink :link="{ url: { url: '/internal-link' } }">Link with object property</SpaLink>
</template>

FAQs

Package last updated on 17 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts