nuxt-slugify
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

nuxt-slugify

Easy way to integrate Slugify with Nuxt 3

Setup

  1. Add nuxt-slugify dependency to your project
npm i -D nuxt-slugify
  1. Add nuxt-slugify to the modules section of nuxt.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:prepare to generate type stubs.
  • Use npm run dev to start playground in development mode.

Readme

Keywords

none

Package Sidebar

Install

npm i nuxt-slugify

Weekly Downloads

3

Version

1.1.0

License

MIT

Unpacked Size

5.76 kB

Total Files

12

Last publish

Collaborators

  • imlautaro