I'm trying to use vue-social-sharing, but I get this error "Component is missing template or render function". this is my main.js file
import {library} from '@fortawesome/fontawesome-svg-core';
import {fas} from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import VueSocialShare from 'vue-social-sharing';
window.addEventListener('load', () => {
const VueApp = require('./App.vue').default;
const app = createApp({
components: { VueApp},
template: document.querySelector('#app')!.innerHTML,
});
library.add(fas);
app
.component('font-awesome-icon', FontAwesomeIcon)
.component('VueSocialShare', VueSocialShare)
.mount('#app');
});
And on a vue file I'm using it as a normal component <VueSocialSharing />
What am I doing wrong and turn it into a functional component?
You can't register it as a component. All you need is:
And in your component, use like this: