Skip to content

How to add Twitter Timeline #591

Answered by stritti
stritti asked this question in Q&A
Dec 27, 2021 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

I extracted the timeline part of https://github.com/tonickkozlov/vue-tweet-embed/ to an internal vuepress component, which works now for me:

docs/.vuepress/components/TwitterTimeline.vue

 <template>
  <div id="twitter-timeline"></div>
</template>

<script>
export default {
  name: "TwitterTimeline",
  props: {
    id: {
      type: String,
      required: true,
    },
    options: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      addScriptPromise: null,
      isLoaded: false,
      isAvailable: false,
    };
  },
  mounted() {
    const params = { sourceType: "profile", screenName: this.id };
    Promise.resolve(
      window.twttr
        ? window.t…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@stritti
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by stritti
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants