I have created a component like this:
<template>
<span class="my-icon">
<img :src="iSrc" :alt="iname"/>
</span>
</template>
<script>
export default {
props: ['iname'],
computed: {
iSrc() {
return require('../../../assets/images/' + this.iname + '.png')
}
}
}
</script>
Using it inside a page like this:
<template>
<div>
<h3>Share it:</h3>
<social-sharing inline-template network-tag="a">
<div class="my-icons">
<network network="facebook" class="fb-icon">
<icon name="fb" />
</network>
</div>
</social-sharing>
</div>
</template>
<script>
import Icon from '~/comps/icon.vue'
export default {
components: {
Icon
}
}
</script>
But it's throwing this error:
[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.
The <social-sharing>
component is from a Vue plugin. If I use my <icon>
component outside the <social-sharing>
tag it works fine, but inside it throws the error.