Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown custom element: <ac-gravatar> - did you register the component correctly? For recursive components, make sure to provide the "name" option. #38

Open
dharmatv opened this issue Apr 29, 2019 · 1 comment

Comments

@dharmatv
Copy link

dharmatv commented Apr 29, 2019

<template>
  <div id="app">
    <!-- <ac-simple-card></ac-simple-card> -->
    <vuep :template="code"></vuep>
  </div>
</template>

<script>
import Vue from 'vue'
import Vuep from 'vuep'
import 'vuep/dist/vuep.css'

Vue.use(Vuep /*, { codemirror options } */)
export default {
    name: 'LiveEditor',
      created: function () {
    this.code = `<template><div>Hello, {{ name }}!<ac-gravatar :avatar_props="{ size: 100, rounded: false }" email="example@mail.com"/></div></template><script>module.exports = {data: function () {return { name: 'Vue' }}}`;
    }
}
</script>

<style>
</style>


ERROR

[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

--->


at src/components/LiveEditor.vue
at src/App.vue

I am getting above ERROR please help me, anyone,

@kalynrobinson
Copy link

You need to provide Vuep a scope for it to pick up components.

<script>
import Vuep from "vuep";
import { Gravatar } from "path/to/component";

export default {
    name: "LiveEditor",
    components: {
        Vuep
    },
    props: ["template"],
    data() {
        return {
            scope: { Gravatar },
            source: "..."
        };
    }
};
</script>

<template>
    <vuep :template="source" :scope="scope" />
</template>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants