Skip to content

createAvatar [object, object] in Vue. #156

Closed Answered by FlorianKoerner
Tomo5524 asked this question in Q&A
Discussion options

You must be logged in to vote

Do you have a code example? Here's what works for me. But I'm not sure if this answers your question.

<template>
  <img alt="Avatar" v-bind:src="avatar">
</template>

<script>
import { createAvatar } from "@dicebear/avatars";
import * as style from "@dicebear/open-peeps";

export default {
  name: "App",
  computed: {
    avatar: () => {
      return createAvatar(style, {
        dataUri: true,
        size: 128
     });
    }
  }
};
</script>

CodeSandbox Example:
https://codesandbox.io/s/dry-voice-x3wv5?file=/src/App.vue

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Tomo5524
Comment options

Answer selected by Tomo5524
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants