View profile

Weekly Vue.js News - #46 - Use fallthrough attributes

Michael Hoffmann
Michael Hoffmann
Hi 👋
In this issue, I have curated a few interesting articles and tweets to help you in your journey to become a Vue expert.
You’ll learn how to use fallthrough attributes in Vue and how to copy text to clipboard using the Clipboard API.
Have a great week ☀️

Vue Tip: Use fallthrough attributes
A “fallthrough attribute” is an attribute or v-on event listener that is passed to a component, but is not explicitly declared in the receiving component’s props or emits. Common examples of this include class, style, and id attributes.
For example, given a <MyButton> component with the following template:
And a parent using this component with:
The final rendered DOM would be:
If the child component’s root element already has existing class or style attributes, it will be merged with the class and style values that are inherited from the parent:
Then the final rendered DOM would now become:
Vue News
Michael Hoffmann
ℹ️ Vue 2.7 will be the final minor release of Vue 2.x and its estimated 'end of life' date will be at the end of 2023
📹 An Introduction to Vue.js State Management with Pinia
How to Create a Custom Code Block With Nuxt Content v2
JavaScript Tip: Write text to the system clipboard
Example cde for Clipboard API
Example cde for Clipboard API
The Clipboard API provides the ability to respond to clipboard commands (cut, copy, and paste) as well as to asynchronously read from and write to the system clipboard. Supported by all modern browsers.
A typical use case is a button to copy the code to the clipboard:
Copy code button in a code block component on the bottom right
Copy code button in a code block component on the bottom right
Web Development News
JavaScript Tip Collection
Michael Hoffmann
💡 Why every developer should be motivated to write tests:

👉🏻 They avoid regression

👉🏻 They can help to regularly and quickly check if all requirements are fulfilled

👉🏻 They can help to document the business logic in form of test cases

What do you think?
Anatomy of a JavaScript Framework
How we deploy to production over 100 times a day
Quote of the week
Tools & Misc
🛠️ AutoAnimate
🛠️ ugit
Did you enjoy this issue? Yes No
Michael Hoffmann
Michael Hoffmann @mokkapps

This weekly Vue newsletter gives you high-quality tips and curated content to help you become a Vue.js expert.

Additionally, it provides content about web development topics like TypeScript, JavaScript, HTML5, and CSS3.

Published each Monday since June 2021.

In order to unsubscribe, click here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Created with Revue by Twitter.
Holzapfelkreuther Straße 19, 81375 Munich, Germany