Skip to content

Instantly share code, notes, and snippets.

View CodyBontecou's full-sized avatar
💭
is enjoying life

Cody Bontecou CodyBontecou

💭
is enjoying life
View GitHub Profile
@AnalyzePlatypus
AnalyzePlatypus / vue-click-outside.md
Last active April 27, 2024 05:32
Vue.js 2.7: Detect clicks outside an element (Close modals, popups, etc.)

Detecting outside clicks in Vue.js

See this StackOverflow thread

First off, include the directive at the end of this gist.

  1. On your open button, make sure to use @click.stop to prevent the open click event from closing your modal.
  2. On your modal, add the v-click-outside directive and points it at a function to call when clicked outside.

Example:

@sapphi-red
sapphi-red / vite-4.3-perf.md
Last active September 18, 2024 03:03
Vite 4.3 performance

Terms

  • start up time: the time from "the command is executed" to the time "load event is triggered in browser".

  • root HMR time: the time from "the root file is changed" to the time "that file is executed in browser".

  • leaf HMR time: the time from "the leaf file is changed" to the time "that file is executed in browser".

  • cold start: the dependency optimization cache is deleted before each run

  • hot start: the dependency optimization cache exists by each run

Summary