Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@happytiptoe/ziggy-vue

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@happytiptoe/ziggy-vue

Type-safe plugin for ziggy-js and vue

  • 0.0.2
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

ziggy-vue

Type-safe plugin for ziggy-js and vue

npm version license

Installation

Install with your favourite package manager:

# yarn
yarn add ziggy-vue

# pnpm
pnpm add ziggy-vue

# npm
npm install ziggy-vue

Import as required:

// main.ts
import { createApp } from 'vue'
import { plugin as ZiggyVue } from 'ziggy-vue'
import App from './App.vue'

// create Vue app
const app = createApp(App)

// use ziggy-vue plugin
app.use(ZiggyVue)

Use in components:

<!-- script setup -->
<script setup lang="ts">
import { useRoute } from 'ziggy-vue'

const $route = useRoute()
const homeRoute = $route('home')
</script>
<!-- composition api -->
<script setup lang="ts">
import { defineComponent } from 'vue'
import { useRoute } from 'ziggy-vue'

export default defineComponent({
  setup() {
    const $route = useRoute()
    const homeRoute = $route('home')

    return { homeRoute }
  }
})
</script>
<!-- options api -->
<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
  methods: {
    getRoute(name: string) {
      return this.$route(name)
    }
  },
  computed: {
    router() {
      return this.$route()
    }
  }
})
</script>
<!-- template -->
<template>
  <Link :href="$route('dashboard')">...</Link>
</template>

Credits

  • Ziggy - For their existing Vue integration.
  • @types/ziggy-js - For providing types to ziggy-js.

License

MIT

FAQs

Package last updated on 12 Jan 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc