vue-socials
Version:
Social media share buttons and counts for Vue.js
43 lines (39 loc) • 1.15 kB
JavaScript
import { defineComponent } from 'vue';
import BaseSocials from '../../mixins/BaseSocial/BaseSocial.js';
import getSerialisedParams from '../../utils/getSerialisedParams.js';
/**
* Hey!
*
* SWordPress component used for WordPress social network
* @link https://wordpress.org/
*/
/**
* Share parameters for link
* @link https://codex.wordpress.org/Press_This
*/
var SWordPress = /* #__PURE__ */defineComponent({
name: 'SWordPress',
mixins: [BaseSocials('WordPress')],
computed: {
networkURL: function networkURL() {
var BASE_URL = 'wp-admin/press-this.php';
var shareOptions = this.shareOptions;
var domain = shareOptions.domain,
url = shareOptions.url,
title = shareOptions.title,
text = shareOptions.text,
image = shareOptions.image;
var serialisedParams = getSerialisedParams({
u: url,
t: title,
s: text,
i: image
});
return "".concat(domain, "/").concat(BASE_URL).concat(serialisedParams);
}
},
render: function render() {
return this.generateComponent(this.networkURL);
}
});
export default SWordPress;