Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilan-riviere committed Oct 1, 2023
1 parent f15351a commit 805f5b5
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,51 @@ ReactDOM.createRoot(root).render(

<br></details>

#### Nuxt 3

An example with Nuxt 3.

<details>
<summary>Click to see example</summary><br>

Installation on Nuxt 3 is easily with `nuxt.config.ts` file.

```ts
// nuxt.config.ts
import { defineNuxtConfig } from "nuxt3";

export default defineNuxtConfig({
buildModules: [
"unplugin-svg-transformer/nuxt", //
],
svgTransformer: {
/* options */
},
});
```

And you can use globally registered `SvgIcon` component or `#icons` alias.

```vue
<script setup lang="ts">
import { importSvg } from "#icons"; // `#icons` alias
const svg = ref<string>("");
importSvg("svg-name").then((icon) => {
svg.value = icon;
});
</script>
<template>
<div>
<div v-html="svg" />
<SvgIcon name="svg-name" />
</div>
</template>
```

<br></details>

## Testing

```bash
Expand Down

0 comments on commit 805f5b5

Please sign in to comment.