vue-socials
Version:
Social media share buttons and counts for Vue.js
38 lines (34 loc) • 1.05 kB
JavaScript
import { defineComponent } from 'vue';
import BaseSocials from '../../mixins/BaseSocial/BaseSocial.js';
import getSerialisedParams from '../../utils/getSerialisedParams.js';
/**
* Hey!
*
* SHackerNews component used for HackerNews social network
* @link https://news.ycombinator.com/
* @example https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fgithub.com%2F&t=Title
*/
/**
* Share parameters for link
*/
var SHackerNews = /* #__PURE__ */defineComponent({
name: 'SHackerNews',
mixins: [BaseSocials('HackerNews')],
computed: {
networkURL: function networkURL() {
var BASE_URL = 'https://news.ycombinator.com/submitlink';
var shareOptions = this.shareOptions;
var url = shareOptions.url,
title = shareOptions.title;
var serialisedParams = getSerialisedParams({
u: url,
t: title
});
return "".concat(BASE_URL).concat(serialisedParams);
}
},
render: function render() {
return this.generateComponent(this.networkURL);
}
});
export default SHackerNews;