vue-jdenticon
Version:
A simple wrapper around jdenticon library for Vue3
73 lines (50 loc) • 1.66 kB
Markdown
# vue-jdenticon [](https://www.npmjs.com/package/vue-jdenticon) [](https://npmjs.org/package/vue-jdenticon) [](https://npmjs.org/package/vue-jdenticon)
A simple wrapper around [Jdenticon](https://jdenticon.com/) for Vue3.
Please consider following this project's author, [Sina Bayandorian](https://github.com/sina-byn), and consider starring the project to show your :heart: and support.
## Installation
```shell
npm i vue-jdenticon
```
## Usage
### Global - Plugin
```ts
import { createApp } from 'vue';
import App from './App.vue';
import './style.css';
import Jdenticon from 'vue-jdenticon';
const app = createApp(App);
app.use(Jdenticon);
app.mount('#app');
```
Then:
```ts
<script setup lang="ts">
import { ref } from 'vue';
const value = ref<string>('identicon');
</script>
<template>
<input type="text" v-model="value" />
<Jdenticon v-model="value" />
</template>
```
### Import
```html
<script setup lang="ts">
import { ref } from 'vue';
import { Jdenticon } from 'vue-jdenticon';
const value = ref<string>('identicon');
</script>
<template>
<input type="text" v-model="value" />
<Jdenticon v-model="value" />
</template>
```
### Static Jdenticon
```html
<script setup lang="ts">
import { StaticJdenticon } from 'vue-jdenticon';
</script>
<template>
<StaticJdenticon value="identicon" />
</template>
```