Last active
July 25, 2019 04:30
-
-
Save movitto/c30375c3942b4404befe1ffe914f12db to your computer and use it in GitHub Desktop.
Embedding xrptipbot in a vuejs application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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