Browse Source

Merge pull request #19 from antono/patch-1

Allow custom subject in Email Share
dependabot/npm_and_yarn/lodash-4.17.19
Alexandr Shulaev 5 years ago committed by GitHub
parent
commit
4f74d2aa42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/components/EmailButton.vue

5
src/components/EmailButton.vue

@ -32,12 +32,13 @@ export default {
props: { props: {
url: { type: String, default: getDocumentHref }, url: { type: String, default: getDocumentHref },
btnText: { type: String, default: "Email" }, btnText: { type: String, default: "Email" },
hasIcon: { type: Boolean, default: true } hasIcon: { type: Boolean, default: true },
subject: { type: String, default: 'Share Link' },
}, },
methods: { methods: {
openShareWindow() { openShareWindow() {
eventEmit(this, "onShare", { name: "Email" }); eventEmit(this, "onShare", { name: "Email" });
const url = `mailto:?subject=Share%20Link&body=${encodeURIComponent( const url = `mailto:?subject=${encodeURIComponent(this.$props.subject)}&body=${encodeURIComponent(
this.$props.url this.$props.url
)}`; )}`;

Loading…
Cancel
Save