about summary refs log tree commit diff
path: root/src/components/FacebookFeed.vue
blob: e4052705ffd37ba4bf95ad37f27b362d66d5a035 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<template>
  <section class="feed">
    <h1>Ostatnie wpisy</h1>
    <FacebookFindUsButton />
  </section>
</template>

<script>
import FacebookFindUsButton from "./FacebookFindUsButton.vue";

export default {
  components: {
    FacebookFindUsButton
  },
  props: {
    pageId: String
  },
  created() {
    window.fbAsyncInit = function() {
      FB.init({
        appId: "702203580219306",
        autoLogAppEvents: true,
        xfbml: true,
        version: "v4.0"
      });

      FB.api(`/${this.pageId}/feed`, function(response) {
        if (response && !response.error) {
          console.log(response);
        }
      });
    };
  }
};
</script>

<style scoped>
.feed {
  margin: 50px 0;
}
</style>