Giter Club home page Giter Club logo

vue-twitter's Introduction

vue-twitter

Downloads Version License

Install

npm install vue-twitter

Usage

import Vue from 'vue'
import twitter from 'vue-twitter'

Vue.use(twitter)
<template>
  <twitter>
    <a class="twitter-timeline" href="https://twitter.com/realDonaldTrump?ref_src=twsrc%5Etfw">Tweets by realDonaldTrump</a>
  </twitter>
</template>

notice

<a class="twitter-timeline" href="https://twitter.c... comes from https://publish.twitter.com/#

get your widget HTML code from above link, and parse it as default slot(except the script tag).

Use loading

<template>
  <twitter>
    <div slot="loading">loading .....</div>
    <a class="twitter-timeline" href="https://twitter.com/realDonaldTrump?ref_src=twsrc%5Etfw">Tweets by realDonaldTrump</a>
  </twitter>
</template>

Others

use as component(use vue-loader)

import { twitter } from 'vue-twitter'
export default {
  components: {
    twitter
  }
}

use as component(need template complier on Vue-cli3)

import twitter from 'vue-twitter/lib/twttr.js'
export default {
  components: {
    twitter
  }
}

vue-twitter's People

Contributors

chiaweilee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vue-twitter's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

请教如何在Nuxt.js v2.11.0中使用

您好,请教您一下,我目前的项目使用Nuxt.js v2.11.0,直接引入您的组件报错 :

ERROR  window is not defined                                                  17:26:17

  at a.data (node_modules/vue-twitter/lib/twttr.js:17:20)
  at node_modules/vue/dist/vue.runtime.common.prod.js:6:28667
  at node_modules/vue/dist/vue.runtime.common.prod.js:6:28727
  at pn (node_modules/vue/dist/vue.runtime.common.prod.js:6:28934)
  at a.e._init (node_modules/vue/dist/vue.runtime.common.prod.js:6:32700)
  at new a (node_modules/vue/dist/vue.runtime.common.prod.js:6:30340)
  at Vi (node_modules/vue-server-renderer/build.prod.js:1:66369)
  at io (node_modules/vue-server-renderer/build.prod.js:1:70599)
  at ro (node_modules/vue-server-renderer/build.prod.js:1:70272)
  at _t.eo [as renderNode] (node_modules/vue-server-renderer/build.prod.js:1:67519)

搜索了一番得知Nuxt不可以在服务端渲染,遂尝试制作了插件
vue-twitter.js
`import twitter from 'vue-twitter'
并尝试了 mode: 'client' 与 ssr: 'false'
均以失败告终

求指教~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.