tonickkozlov / vue-tweet-embed

Embed tweets in your vue.js app
111 stars 27 forks source link

Can we have any example or demo? #1

Closed DhruvAerosol closed 7 years ago

DhruvAerosol commented 7 years ago

Help Wanted Can we have any example or demo? i am not getting how to use it in vuejs webpack template.

tonickkozlov commented 7 years ago

What confuses you, exactly? To my understanding, you'd have to ''' npm install vue-tweet-embed ''' In the root of your project, and then use it the same way as you would any other vue component (see readme). Let me know if you run into issues!

DhruvAerosol commented 7 years ago

Thanks for your reply. i am getting like this: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

main.js

import Vue from 'vue'
import App from './App.vue'
import Tweet from 'vue-tweet-embed'
new Vue({
  el: 'body',
  components: { App }
})

App.vue


<template>
  <div id="app">
    <h1>{{ title }}</h1>
    <hr>
      <Tweet :id="'692527862369357824'"></Tweet>
  </div>
</template>

<script>
import TodoList from './todo-list.vue'
import Tweet from 'vue-tweet-embed'
export default {
  data () {
    return {
      newItem: '',
      title: 'Tweet List'
    }
  },
  methods: {
  }
}
</script>
tonickkozlov commented 7 years ago

Please refer to https://vuejs.org/v2/guide/components.html#Local-Registration basically, you are missing 'components' property for the component to operate correctly.