0.0.1 • Published 2 years ago

nuxt-bemm v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Bemm auto-import module for Nuxt.

📦 Install

  1. Install nuxt-bemm as development dependency:
npm install nuxt-lodash --save-dev
  1. Add it to the modules section of your nuxt.config:
export default defineNuxtConfig({
  modules: ["nuxt-bemm"],
});

Example

Use Bemm in all components in your Nuxt app.

<script setup>
  const bemm = createBemm("my-component");
</script>

<template>
  <div :class="bemm('something')">Test</div>
  <!-- <div class="my-component__something">Test</div>-->
</template>

Configuration

NameDefaultDescription
prefix''String to prepend before each Lodash function (false to disable)
prefixSkip[]Functions that starts with keywords in this array will be skipped by prefix
exclude[]Array of Bemm functions to exclude from auto-imports
alias[]Array of array pairs to rename specific Lodash functions (prefix is still added)

Example

export default defineNuxtConfig({
  modules: ["nuxt-bemm"],
  bemm: {
    prefix: "_",
    prefixSkip: ["createMultiBemm"],
    exclude: [],
    alias: [["createBemm", "myBemm"]],
  },
});

License

MIT License © 2022 - Sil van Diepen