Skip to content

Instantly share code, notes, and snippets.

@movitto
Last active July 25, 2019 04:30
Show Gist options
  • Save movitto/c30375c3942b4404befe1ffe914f12db to your computer and use it in GitHub Desktop.
Save movitto/c30375c3942b4404befe1ffe914f12db to your computer and use it in GitHub Desktop.
Embedding xrptipbot in a vuejs application
// VueJS does not permit <script> tags to be embedded in component templates
// Inorder to embed the xrptipbot widget (as described here: https://www.xrptipbot.com/account/embed):
// Add the following to your vuejs component template (make sure to change the tip receipient!):
<div id="xrptipbot">
<a amount="5.00" size="175" to="DevNullProd" network="twitter" href="https://www.xrptipbot.com" target="_blank"></a>
</div>
// Then add / extend the component 'mounted' hook to add the script:
mounted : function(){
var script = document.createElement("script");
script.setAttribute('src', 'https://www.xrptipbot.com/static/donate/tipper.js');
var div = document.getElementById('xrptipbot');
div.appendChild(script);
}
// Whala tips are enabled!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment