👉🏻 Create 3D scenes with Vue components and Three.js.
🔥 Vue Tip: Simpler Two-Way Binding in Vue With defineModel
v-modelv-model is a powerful feature in Vue that allows you to create two-way data bindings on your components. However, defining the props and emits in every component can be a bit verbose.
Since Vue 3.4 you can simplify two-way binding in Vue with the defineModeldefineModel compiler-macro, which is now the recommended way to define v-modelv-model bindings.
When you create a component that uses v-modelv-model, you need to define a prop and an emit for the value. For example, if you have a component that uses v-modelv-model to bind to a value prop, you would need to define the following:
defineModel is a new script setupscript setup macro that aims to simplify the implementation of components that support v-modelv-model. It automatically defines the modelValue prop and the update:modelValue emit for you.
Let's rewrite the above example using defineModeldefineModel:
1<script setup lang="ts">2const model = defineModel()3</script>45<template>6 <input v-model="model">7</template>8
I love this simple and clean syntax. It makes the code much easier to read and write.
My blog post contains additional information about multiple v-modelv-model bindings, modifiers and typing.
👉🏻 Learn how they optimize web performance by eliminating client-side rendering and reducing hydration, a feature inspired by React's Server Components.
👉🏻 Quill is a rich text editor that has official TypeScript support, support for multiple editors on the same page with different configurations, auto-scrolling container detection, a smoother editing experience, and more.
😂 Fun
Comments? Join the discussion about this issue in our Discord community.
How's it going? I was planning to release the update for Reusable Components yesterday, but things haven't gone as planned. Instead, I will be launching it next week. I need a just a bit more time to make sure that the quality is up to my standards. As I've been updating the course and re-writing all the content and step-by-step refactorings, I've also been able to simplify a few things. It's just like refactoring a piece of code, and it's one of the greatest feelings. I also looked at how much content is in there, and it looks like it will be similar to the Clean Components Toolkit. Lots of great content on how to write highly reusable components, simplified and updated — I can't wait to release the update next week! Oh, and one more thing: I'm doing a podcast with Alex Lichter ! It's called Deja Vue and we'll be releasing the first ...
Monday, November 20, 2023 I'd pay $10K up front # Matt Mullenweg : "Sales of the 100-year plan so far: 0. Hundreds of people filled out the form, though. I think we really messed something up in the follow-up, including not making it self-serve to start. Will review and try again. It's an important promise to us." # I'm very much a customer for this service. It would be worth $10K for to buy 100 years of persistence for my web writing. A simple easy to understand service that helps get the process started. # I transfer scripting.com to Automattic as registrar. # I upload the contents from S3 to Automattic server. Static files, HTML, feeds, images, code. # Automattic provides an API to keep the files updated and so I can add to them as long as I'm still writing. # The files are publicly accessible over HTTP. # Automattic agrees to renew the domain for 100 years, and manage access to the files, with reasona...
评论
发表评论