Tag

ref

0 views collected around this technical thread.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jan 12, 2025 · Frontend Development

Understanding Reactive Data in Vue 3: Using ref and reactive

This article explains Vue 3's reactive data system, detailing how ref and reactive create responsive state for primitive values and objects, demonstrates code examples, compares their return types and usage, and offers guidance on choosing the appropriate API for different scenarios.

JavaScriptReactiveVue.js
0 likes · 9 min read
Understanding Reactive Data in Vue 3: Using ref and reactive
Code Mala Tang
Code Mala Tang
Oct 5, 2024 · Frontend Development

Master Vue 3 Ref: One‑Way Data Flow, Component Communication & Custom useRefState

This article explains how to use Vue 3's ref and shallowRef for reactive state, demonstrates one‑way data flow between parent and child components via props and events, and introduces a custom useRefState composable that mimics React's useState for cleaner state management.

Vuecomponent communicationfrontend
0 likes · 10 min read
Master Vue 3 Ref: One‑Way Data Flow, Component Communication & Custom useRefState
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Oct 2, 2024 · Frontend Development

Understanding Vue 3 ref, computed, and reactive: Definitions, Usage, and Best Practices

This article explains the purpose and internal implementation of Vue 3’s ref, computed, and reactive APIs, compares their behaviours in script and template contexts, discusses watch strategies, and offers practical guidelines for choosing and modularising these reactive primitives in large‑scale frontend projects.

ReactiveVue3Watch
0 likes · 16 min read
Understanding Vue 3 ref, computed, and reactive: Definitions, Usage, and Best Practices
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Sep 23, 2024 · Frontend Development

Advanced Vue 3 Component Encapsulation: v-model, Slot Passing, and Ref Access

This article demonstrates how to create a reusable Vue 3 component with Vite and Element‑Plus, covering two‑way data binding via v‑model, slot forwarding using the h function, and exposing child component refs through a Proxy, complete with code examples and explanations.

ProxyVuecomponent
0 likes · 7 min read
Advanced Vue 3 Component Encapsulation: v-model, Slot Passing, and Ref Access
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jul 31, 2024 · Frontend Development

Understanding Vue 3 ref vs reactive: Internal Mechanisms and Why ref Is Recommended

This article explains the internal implementations of Vue 3's ref and reactive APIs, compares their behavior, highlights the limitations of reactive, and demonstrates why using ref provides a more uniform, flexible, and deep‑reactive solution for frontend developers.

JavaScriptReactiveVue3
0 likes · 12 min read
Understanding Vue 3 ref vs reactive: Internal Mechanisms and Why ref Is Recommended
Code Mala Tang
Code Mala Tang
Jul 5, 2024 · Frontend Development

Mastering React refs: When and How to Use forwardRef, useRef, and useImperativeHandle

This article explains how React refs work with native elements, class components, and function components, demonstrates using useRef, forwardRef, and useImperativeHandle, and discusses the benefits, drawbacks, and alternative patterns for exposing component instances and DOM nodes.

ReactforwardReffrontend
0 likes · 10 min read
Mastering React refs: When and How to Use forwardRef, useRef, and useImperativeHandle
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Mar 13, 2024 · Frontend Development

Using Provide/Inject and Ref for Cross-Component Communication in Vue

The article discusses common Vue component communication patterns such as props‑emit, event buses, and ref usage, then introduces a colleague's provide‑inject plus ref approach that simplifies cross‑component interactions while highlighting its trade‑offs regarding Vue's one‑way data flow.

Vuecomponent communicationprovide/inject
0 likes · 5 min read
Using Provide/Inject and Ref for Cross-Component Communication in Vue
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Sep 2, 2023 · Frontend Development

Why ref Is Preferred Over reactive in Vue 3: Limitations of reactive and Best Practices

This article explains the fundamental differences between Vue 3's reactive and ref APIs, highlighting reactive's limitation to objects, the situations where it loses reactivity, and why using ref—along with techniques like Object.assign and toRefs—provides more reliable and flexible state management.

JavaScriptReactiveVue
0 likes · 10 min read
Why ref Is Preferred Over reactive in Vue 3: Limitations of reactive and Best Practices
政采云技术
政采云技术
Aug 16, 2023 · Frontend Development

Why rc-form Fields Do Not Disappear: The Importance of Ref Callbacks and clearField in Custom Components

This article explains why fields registered with rc-form may persist and continue to run validation when using functional custom components, analyzes the internal mechanisms of getFieldMeta, clearField, and saveRef, and shows that adding forwardRef support resolves the disappearance and validation issues.

Reactcustom-componentsfield validation
0 likes · 14 min read
Why rc-form Fields Do Not Disappear: The Importance of Ref Callbacks and clearField in Custom Components
Sohu Tech Products
Sohu Tech Products
Feb 2, 2022 · Frontend Development

Understanding Vue 3 Reactivity: Ref Implementation, Dependency Tracking and Effect Optimization

This article explains Vue 3's reactivity mechanism by dissecting the ref API, showing how dependency collection and triggering work through effect functions, and describing the bit‑mask optimization introduced in Vue 3.2 to efficiently update only stale dependencies.

Dependency TrackingJavaScriptReactivity
0 likes · 24 min read
Understanding Vue 3 Reactivity: Ref Implementation, Dependency Tracking and Effect Optimization
php中文网 Courses
php中文网 Courses
Dec 12, 2021 · Frontend Development

Understanding Vue 3 Composition API: Ref, Reactive, toRefs, Computed, Watch, Provide/Inject, and Lifecycle Hooks

This article explains Vue 3's Composition API, covering how to create reactive data with ref and reactive, use toRefs, define computed properties, apply readonly, watch and watchEffect, handle lifecycle hooks, pass props, and share state via provide and inject, all with practical code examples.

Composition APIJavaScriptReactive
0 likes · 8 min read
Understanding Vue 3 Composition API: Ref, Reactive, toRefs, Computed, Watch, Provide/Inject, and Lifecycle Hooks
Test Development Learning Exchange
Test Development Learning Exchange
Oct 7, 2020 · Frontend Development

Getting Input Values in React: Using Event Objects and Refs

This article demonstrates two ways to retrieve user-entered text in a React component—by accessing the event object's target value in an onChange handler and by defining a ref to read the input value directly—along with the supporting index.js setup.

Input HandlingJavaScriptReact
0 likes · 3 min read
Getting Input Values in React: Using Event Objects and Refs