Last active
November 14, 2024 14:28
-
-
Save Karytonn/974fdcefd979c9769510d5dae5cad953 to your computer and use it in GitHub Desktop.
Add embed code in Nuxt 3 component
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
<template> | |
<div ref="embedContainer"> | |
<div data-iframe-width="150" data-iframe-height="270" data-share-badge-id="d38052e4-817c-4700-9e79-1953638ea425" data-share-badge-host="https://www.credly.com"></div> | |
</div> | |
</template> | |
<script setup> | |
const embedContainer = ref(null); | |
onMounted(() => { | |
const script = document.createElement('script'); | |
script.src = '//cdn.credly.com/assets/utilities/embed.js'; | |
script.async = true; | |
embedContainer.value.appendChild(script); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment