0.0.1 • Published 1 year ago

@v-anything/unplugin-v-anything v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

unplugin-v-anything

Import v-anything on-demand automatically.

Usage

pnpm add unplugin-vue-components/vite @v-anything/unplugin-v-anything

In vite.config.ts file, add these codes:

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import VAnyResolver from '@v-anything/unplugin-v-anything'

export default defineConfig({
  /* ... */
  plugins: [
    /* ... */
    vue(),
    Components({
      resolvers: [VAnyResolver()],
    }),
  ],
})

Now you can directly enjoy v-anything in your Vue SFC. Here's an example.

<script setup lang="ts">
// no need to manually import :)
</script>

<template>
  <div
    v-highlight="{
      keywords: ['love'],
      options: {
        defaultDecoration: {
          color: 'red',
        },
      },
    }"
  >
    I love KFC.
  </div>
</template>
0.0.1

1 year ago