vue-socials
Version:
Social media share buttons and counts for Vue.js
78 lines (58 loc) • 1.56 kB
text/mdx
import { Meta, Story, Preview} from "@storybook/addon-docs/blocks"
import SGithubCount from "../SGithubCount"
<Meta title='Count/SGithubCount' component={ SGithubCount } />
<style>{`
.custom-preview .base-canvas {
height: auto;
}
`}</style>
# SGithubCount
## Preview
<Preview className="custom-preview">
<Story id='count-sgithubcount--default' />
</Preview>
## Example
```html
<template>
<s-github-count
:share-options="shareOptions"
@load="onLoad"
@error="onError"
@loading="onLoading"
></s-github-count>
</template>
<script>
import { SGithubCount } from 'vue-socials'
export default {
name: 'SGithubCountSharing',
components: { SGithubCount },
data() {
return {
tag: 'span',
shareOptions: {
username: 'webistomin',
type: 'follow',
},
}
},
methods: {
onLoad() {},
onError() {},
onLoading() {},
}
};
</script>
```
## Props
| Prop | Type | Description | Default value |
| ------ | ------ | ------ | ------ |
`shareOptions` | `object` | Your share link parameters: <br /> **username** – your GitHub username <br /> **type** – share link type (follow) <br /> | `{}`
`tag` | `string` | Dynamic HTML tag or component | `span`
## Events
| Event name | Usage |
| ------ | ------ |
`load` | the request has finished successfully |
`error` | the request has finished with error |
`loading` | the request has started |
## ⚠️ Warning
This component uses `JSONP` so the content won't be available during `SSR`.