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

Custom component inside control component: 'Failed` to resolve component: custom-icon' #689

Closed
ArutaGerman opened this issue Feb 2, 2024 · 5 comments

Comments

@ArutaGerman
Copy link

ArutaGerman commented Feb 2, 2024

I made a custom control. This control component has custom-button component with icon from our UI library inside custom-button:

<template>
  <custom-button
    ref="editBtn"
    icon="edit"
    @click="foo"
    class="control-collapse"
  />
</template>

<script setup>
import CustomButton from '@/components/CustomButton.vue';

defineOptions({
  customOptions: {
    name: 'ControlEdit',
  },
});
</script>

Control was been rendered and he hasn't the icon: I have the error.

Error:

Failed` to resolve component: custom-icon
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. 

How to resolve this problem?

p.s. I had the same with rete v1, but I solved it. And now I don't know what I have to do

upd: I found the project with rete v1 and we used a custom-button with inside but not custom-icon component from UI library

@Ni55aN
Copy link
Member

Ni55aN commented Feb 16, 2024

custom-icon should be registered in Vue (globally or inside custom-button)

@ArutaGerman
Copy link
Author

ArutaGerman commented Feb 20, 2024

custom-icon should be registered in Vue (globally or inside custom-button)

I have it in main.js:

import Custromlibrary;
import App from './App.vue';

const app = createApp(App);
app.use(CustomLibrary)

CustomLibrary includes custom-icon. Or I have to registry custom-icon apart?

@Ni55aN
Copy link
Member

Ni55aN commented Feb 25, 2024

These are two different Vue.js instances (const app = createApp(App); and the one that renders custom-button)

@Ni55aN
Copy link
Member

Ni55aN commented Feb 25, 2024

I hope this helps

retejs/vue-plugin#79

Unfortunately, the official documentation for configuring Vue isn't ready yet, but this feature is already available

@ArutaGerman
Copy link
Author

Thanks, we'll see

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