str2avatar
v0.0.3
Published
convert string to avatar[image] with background
Downloads
1
Maintainers
Readme
npm install str2avatar
Online Demo
<template>
<input type="text" v-model="nickname">
<img :src="avatr" alt="">
</template>
import { ref, computed } from 'vue';
import str2avatar from 'str2avatar'
const nickname = ref('')
const avatr = computed(() => str2avatar(nickname.value))
str2avatar params is object or string; the struct is below while params is object
- nickname
- size
- color
- nickname is required
- size and color is optional