5

I am trying to include a Twitter feed on my VueJS Website, with the styling from Twitter. On a classical html / JS website, this is possible using https://help.twitter.com/en/using-twitter/embed-twitter-feed . But since this method generates an <a> tag with a <script> to copy in my code, it triggers a "Fail to compile" error from VueJS when simply pasting it into a component. Is there any way to to this without requiring to rewrite a Twitter-like interface inside a custom-made component?

paupaulaz
  • 937
  • 1
  • 11
  • 20
  • 1
    Possibly duplicate: see https://stackoverflow.com/questions/45047126/how-to-add-external-js-scripts-to-vuejs-components (and https://medium.com/@lassiuosukainen/how-to-include-a-script-tag-on-a-vue-component-fe10940af9e8 ) – jjmontes Dec 07 '19 at 14:40
  • 100% efficient, thanks a lot! – paupaulaz Dec 07 '19 at 14:46
  • 1
    Based on @jjmontes help, I created a Vue component that wraps it up. You can find it here: https://github.com/paupaulaz/VueJSTwitterFeed/tree/master – paupaulaz Dec 07 '19 at 15:06

0 Answers0