Nathan Lamont

Notes to Self

Vue and Vue Adjacent

Generate documentation from .vue files?

  • Storybook
  • Vitepress
  • Vitesse
  • Nuxt "docus" theme
  • https://histoire.dev - by Vue 3 dev? What is this "story" term?
  • Swimm

2023.03.02

Vue 3, modals, and teleport

For reasons you have lost track of, with Nuxt 3, you must create a plugin to append HTML to body template (you vaguely recall you can prepend stuff via config?). In your case, you wanted an html element to act as container for modals. Plugin looks like this:


// server/plugins/teleportTarget.ts

import { defineNitroPlugin } from 'nitropack/runtime/plugin';

export default defineNitroPlugin((nitroApp) => {
  nitroApp.hooks.hook('render:html', (html, { event }) => {
    html.bodyAppend.push('<div id="modals"></div>');
  });
});

2023.03.23

Making a Package Others Can Use

Untested