Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerkretzmar authored Nov 9, 2024
1 parent 409d4ea commit ae5e26a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,13 @@ Now you can use the `route()` function anywhere in your Vue components and templ
<a class="nav-link" :href="route('home')">Home</a>
```

In `vue 3` you need to use `inject` to access `route()`
With `<script setup>` in Vue 3 you can use `inject` to make the `route()` function available in your component script:

```vue
<script setup>
import { inject } from "vue"
const route = inject('route')
import { inject } from 'vue';
const route = inject('route');
</script>
```

Expand Down

0 comments on commit ae5e26a

Please sign in to comment.