nuxt-slugify
v1.1.0
Published
An easy way to integrate Slugify with Nuxt
Downloads
14
Readme
nuxt-slugify
Easy way to integrate Slugify with Nuxt 3
Setup
- Add
nuxt-slugifydependency to your project
npm i -D nuxt-slugify- Add
nuxt-slugifyto themodulessection ofnuxt.config.ts.
Usage
You can use the slugify method with the injected function or with the composable:
<template>
<div>
{{ $slugify('Hello world @ Slugify! 🐱') }}
</div>
</template>
<script setup lang="ts">
const slugify = useSlugify()
onMounted(() => {
console.log(slugify('Hello world @ Slugify! 🐱'))
})
</script>Options
export default defineNuxtConfig({
modules: ['nuxt-slugify'],
slugify: {
defaults: {
// global settings
},
extend: {
// extend support
},
}
})More information in the Slugify repository
Development
- Run
npm run dev:prepareto generate type stubs. - Use
npm run devto start playground in development mode.
