Skip to content

Instantly share code, notes, and snippets.

@Karytonn
Last active November 14, 2024 14:28
Show Gist options
  • Save Karytonn/974fdcefd979c9769510d5dae5cad953 to your computer and use it in GitHub Desktop.
Save Karytonn/974fdcefd979c9769510d5dae5cad953 to your computer and use it in GitHub Desktop.
Add embed code in Nuxt 3 component
<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