Global Plugins¶
We tend to steer clear from using Vue's globalProperties
. It does however make sense for really common functions like route()
.
These plugins are available in any template section. For use in the script setup
section, we should use composables.
Route Plugin¶
Defines a global function called route()
, which wraps Ziggy. It can be used to generate URLs from a route name.
Example
<script setup lang="ts"></script>
<template>
<div>
<a :href="route('sell-your-classic')">Link to "Sell my classic"</a>
</div>
</template>