Tag

provide/inject

0 views collected around this technical thread.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Feb 16, 2025 · Frontend Development

Creating a Universal Functional Modal Utility for Vue 3

This article demonstrates how to build a highly reusable, function‑based modal system in Vue 3 that supports lazy loading, prop passing, event binding, provide/inject data injection, custom slots, and method exposure, allowing developers to display any modal component with a single function call.

Functional ComponentModalTypeScript
0 likes · 13 min read
Creating a Universal Functional Modal Utility for Vue 3
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Feb 6, 2025 · Frontend Development

Component Communication in React 18 and Vue 3: Parent‑Child, Sibling, and Cross‑Level Patterns

This article compares React 18 and Vue 3 component communication techniques—including parent‑child, sibling, and cross‑level patterns—provides detailed code examples for props, emit, context, provide/inject, and summarizes their respective advantages and use cases in modern web development.

Component CommunicationContext APIJavaScript
0 likes · 13 min read
Component Communication in React 18 and Vue 3: Parent‑Child, Sibling, and Cross‑Level Patterns
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Dec 12, 2024 · Frontend Development

Design and Implementation of a Conditional Filter Tree Component in Vue

This article details the design, data structure, and implementation of a reusable conditional filter tree component using Vue2 and Vue3, covering node addition, deletion, relationship handling, form validation, and provide/inject communication, along with code examples and discussion of challenges and future improvements.

ComponentConditional FilterRecursive Component
0 likes · 29 min read
Design and Implementation of a Conditional Filter Tree Component in Vue
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.

Component CommunicationVueprovide/inject
0 likes · 5 min read
Using Provide/Inject and Ref for Cross-Component Communication in Vue
JD Retail Technology
JD Retail Technology
Jul 11, 2022 · Frontend Development

Design and Implementation of the NutUI Collapse Panel Component

This article explains the design principles, implementation details, and advanced features of NutUI’s Collapse panel component, covering basic interaction, height‑based animation, flexible title bar with icons, configuration upgrades, slot usage, CSS variable styling, and Vue 3 provide/inject communication, supplemented with code examples.

CSS animationCollapseComponent Design
0 likes · 12 min read
Design and Implementation of the NutUI Collapse Panel Component
37 Interactive Technology Team
37 Interactive Technology Team
Dec 10, 2019 · Frontend Development

Vue.js Component Communication Methods and Practical Examples

Vue.js offers multiple component communication techniques—including one‑way props, $emit/$on events, an event bus, $attrs/$listeners, provide/inject, direct $parent/$children/$refs access, Vuex state management, and slot‑based patterns—enabling flexible data flow between parents, children, siblings, and distant descendants.

$onComponent CommunicationEmit
0 likes · 18 min read
Vue.js Component Communication Methods and Practical Examples