Javascript is required
Weekly Vue News Logo Weekly Vue News

Document is empty, overwrite this content with #empty slot in <ContentDoc>.

Weekly Vue News - #61 - Expose slots from 3rd-party child component

Migrated Issue
Expect missing links and broken styling, as this issue has been migrated from my previous newsletter service.

Hi ๐Ÿ‘‹

CodeSnap is officially live ๐Ÿš€.

Use code "CODESNAP_50" to get 50% off the "Pro" plan for the first year.

This week I'll also attend the vuejs.de Conf in Berlin. Leave me a message if you will also be there.

Have a great week โ˜€๏ธ


Vue Tip: Expose slots from 3rd-party child component

Third-party components are often wrapped in a custom component. But in that way, the slots of the third-party component get lost.

The following solution exposes all slots of the third-party component to the parent component:

Image created with CodeSnap.dev

Now every component that uses WrapperComponent can use the slots of ThirdPartyComponent.

What's happening:

  1. We insert the third-party component and bind its attributes via the $attrs component instance object (official docs)
  2. We loop over all available slots using the $slots component instance object (official docs) and bind the slots props to the slot name via #="slotProps"
  3. In the slot, we use v-bind to bind all third-party slot properties (slotProps) to pass out to a parent

Curated Vue Content

๐Ÿ“• Async with Suspense

๐Ÿ‘‰๐Ÿป Learn all about Vue 3โ€™s new component called

๐Ÿ“• Testing Pinia Data Stores in Vue

๐Ÿ‘‰๐Ÿป Patrick describes how to test Pinia data stores in Vue applications.

๐Ÿ› ๏ธ Colada

๐Ÿ‘‰๐Ÿป Time-travel debugging for Pinia๐Ÿ, Vueโ€™s official state management library

๐Ÿ“† ViteConf

๐Ÿ‘‰๐Ÿป The first-ever ViteConf is happening for free online on October 11-12 with a speaker lineup thatโ€™s full of bangers

JavaScript Tip: Remove falsy values from array

.filter(Boolean) removes the following values from an array:

  • null
  • undefined
  • NaN
  • false
  • 0
  • โ€œโ€ (empty string)

Image created with CodeSnap.dev

Curated Web Development Content

๐Ÿ“• The new wave of Javascript web frameworks

๐Ÿ‘‰๐Ÿป This article presents a high-level model of popular frameworks like React, Vue, Svelte, Next, and more.

๐Ÿ‘‰๐Ÿป It looks at JavaScript's past pain points to understand the problems these frameworks solve.

๐Ÿ“• My Blog is Hilariously Overengineered To The Point People Think It's A Static Site

๐Ÿ‘‰๐Ÿป "I'm going to share the gory details on how my blog works, and why people often mistake it for a static website."

๐Ÿ˜ฎ Doom3 is running in the browser

๐Ÿ‘‰๐Ÿป An experimental port of id Tech 4 engine to Emscripten / WebAssembly

๐Ÿ› ๏ธ Nightdrive

๐Ÿ‘‰๐Ÿป James made a beautiful & relaxing JavaScript simulation of driving at night time on the motorway.

Quote of the Week

Weekly Vue News LogoWeekly newsletter that gives you high-quality tips and curated content about Vue & Nuxt.
I will never share any of your personal data.
ยฉ 2023 weekly-vue.news. All rights reserved.