0.8.0 • Published 3 years ago

vue-youtube-widget v0.8.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Vue.js YouTube widget for your website using YouTube Api 3.

vue-youtube-widget

  • Fetches channel's logo, name and subscribers count
  • Fetches initial count of videos
  • Loads additional videos

Usage

1.Install package

npm i vue-youtube-widget

2.Import "YouTubeWidget" component in you app:

<template>
  <div>
    <YouTubeWidget apiKey="YOUR_API_KEY" channelId="YOUR_CHANNEL_ID"></YouTubeWidget>
  </div>
</template>

<script>
import YouTubeWidget from 'vue-youtube-widget'

export default {
  components: {
    YouTubeWidget
  }
}
</script>

3.Configure component additional props if needed:

<template>
  <div>
    <YouTubeWidget
            apiKey="YOUR_API_KEY"
            channelId="YOUR_CHANNEL_ID"
            :resultsPerRequest="4"
            subscribersCountText="подписчиков"
            subscribeBtnText="Подписаться"
            loadMoreBtnText="Загрузить еще"
    ></YouTubeWidget>
  </div>
</template>

...

4.Import "YouTubeWidget" base styles:

...

<style>
  @import "~vue-youtube-widget/dist/YouTubeWidget.min.css";
</style>

5.Write your additional custom styles for widget.

6.Enjoy! 🎉


Props

apiKey

API key from Google API Console

Type: String

Required: true

channelId

ID of YouTube channel

Type: String

Required: true

resultsPerRequest

Number of requested videos per request

Type: Number

Required: false

Default: 1

subscribersCountText

"subscribers" word replacement for localized text using vue-i18n

Type: String

Required: false

Default: "subscribers"

subscribeBtnText

"Subscribe" word replacement in "Subscribe" button for localized text using vue-i18n

Type: String

Required: false

Default: "Subscribe"

loadMoreBtnText

"Load more" word replacement in "Load more" button for localized text using vue-i18n

Type: String

Required: false

Default: "Load more"

0.8.0

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

1.0.0

3 years ago