Hi π
I deleted my account at
This is the first issue that is sent via my custom-built newsletter solution:
I store the subscriber list on
If you have any problems with this email, please
Be sure to add
And sorry to all of you that received some test emails...
I plan to write a blog post about how I replaced Revue with my custom-built solution.
Have a nice week βοΈ
Vue Tip: Pass Custom Arguments to Event Handler Method
In Vue, we use the v-on
(typically shortened with the @
symbol) to listen to DOM events and run some JavaScript code when triggered.
We can use inline handlers or method handlers if the logic for the event handler is more complex:
<script setup>
const name = ref('Vue.js')
const greet = (event) => {
alert(`Hello ${name.value}!`)
if (event) {
alert(event.target.tagName)
}
}
</script>
<template>
<button @click="greet">Greet</button>
</template>
Sometimes we need to pass custom arguments to the method and access the original DOM event:
<script setup>
const name = ref('Vue.js')
const greet = (event, name) => {
alert(`Hello ${name.value}!`)
if (event) {
alert(event.target.tagName)
}
}
</script>
<template>
<button @click="greet($event, βMichaelβ)">Greet</button>
</template>
The original DOM event is accessible via the unique $event
variable. Custom arguments can be added by calling the method in an inline handler instead of directly binding it to a method name.
Curated Vue Content
π This is why you should be using Vue 3βs Composition API |
ππ» "Composition API is a valuable addition to the Vue ecosystem that offers improved code organization, improved performance, and the ability to easily reuse logic across multiple components" |
medium.com |
π οΈ PortalVue 3.0 |
ππ» Feature-rich portal plugin for Vue 3. ππ» "A Portal Component for Vue 3, to render DOM outside of a component, anywhere in the document." |
github.com |
π Vue.js Nation 2023 |
ππ» Itβs all happening 25 & 26 January ππ» Get to know Quasar, Vuetify 3, Nuxt 3, Pinia, Vite, Vitest, Volar, Vue.js, Typescript, VueUse and more! ππ» Evan You is hosting the keynote for Vue.js Nation. ππ» Register free! |
vuejsnation.com |
π οΈ neodrag |
ππ» This drag-and-drop solution includes packages for React, Svelte, Vue, Solid and vanilla JavaScript. |
github.com |
Quote of the week
JavaScript Tip: A function that throws an error if a required parameter is missing
Default function parametersΒ allow named parameters to be initialized with default values if no value orΒ undefined
Β is passed.
We can use this approach to write a function that throws an error if a required parameter is missing:
const isRequired = () => {
throw new Error('Parameter is required!')
}
const foo = (bar = isRequired()) => {
console.log(bar)
}
foo() // throws the isRequired error
foo(undefined) // throws the isRequired error
foo(false) // logs "false"
foo(null) // logs "null"
foo('Test') // logs "true"
Curated Web Development Content
πΉ Learn JavaScript by coding your own card game |
ππ» Free 2 hour YouTube course. ππ» You'll use plain vanilla JavaScript to flip, shuffle, and deal cards from your deck. |
www.freecodecamp.org |
π Super Useful CSS Resources |
ππ» A collection of 70 web-based tools that can generate pure CSS without the need for JavaScript or external libraries. ππ» Categories include property generators, animations, backgrounds, typography, loaders, and layouts. |
dev.to |
π Git Notes: git's coolest, mostΒ unlovedΒΒ feature |
ππ» Git notes allow developers to stow metadata about anything tracked by git without affecting the object itself. |
tylercipriani.com |
π Why Birdie moved to Micro Frontends |
ππ» In this article, Steve from Birdie aims to break down what a micro frontend application is, why they moved to it, and what theyβve learned along the way. |
medium.com |
π οΈ Act |
ππ» It allows users to run GitHub Actions locally. ππ» It allows developers to receive fast feedback and features a local task runner. ππ» It is available on Windows, macOS, and Linux. |
github.com |
π οΈ commitgpt |
ππ» Automatically generate commit messages using ChatGPT. |
github.com |