[Tips & Trick] Add Facebook Page Widget on NuxtJS
Are you looking how to add your facebook page widget on your nuxt project?
Well, you come to the right place. This tutorial is for simple use and if you know how to do it better, please write down in the comment.
Okay, so how to add the page plugin?
first, you have to install Vue-scripts2 with:
npm install vue-script2 --save
Then make a plugin on your /plugins directory with “vue-script2.js”, after that, add the code bellow to your vue-script2.js file that you just created:
import Vue from 'vue'
Then add this line into your nuxt.config.js plugin:
after done with that, next is setup your facebook plugin on https://developers.facebook.com/docs/plugins/page-plugin/.
get your facebook SDK code from there, and add it to your layout that you use. in this case i am using it on my default.vue like this:
You see that i am using client only tag, because this code wont run on server side. After that, just add your page plugin code to your desired location. dont forget to add <client-only> YOUR CODE </client-only>.
welp, thats it!
your page will now be showing normally…,
if you have any suggestion, write it down on comment bellow.. 🙂