DEV Community

Discussion on: I made DEV.to widget for websites/blogs

 
kp profile image
KP

That makes total sense @saurabhdaware . Thanks for the explanation! 🌻

I'll do some more research to see if I can get this working in vue / nuxt component pages!

Thread Thread
 
kp profile image
KP

Here's how to use your widget in Nuxt, for future reference:

@kiyuku1 's answer would work, but here's the complete solution that would work if we want to include a js (or mjs) file in ONE nuxt.js page only, instead of globally:

<template>
  <div class="container">

    <div>
        <dev-widget data-username="saurabhdaware"></dev-widget>
    </div>

  </div>
</template>

<script>

export default {
  layout: "default",

  head: {
    script: [
…
Thread Thread
 
saurabhdaware profile image
Saurabh Daware 🌻

Oh I did not know Nuxt required separate handling. Thank you so much 🌻