Tag

Custom Directive

0 views collected around this technical thread.

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

Implement SVG Hover Color Change Using a Vue Custom Directive

This article explains how to create a reusable Vue custom directive that changes an SVG's fill color on hover, covering simple fill‑only SVGs, dynamic color parameters, and handling more complex SVGs by swapping SVG markup strings.

Custom DirectiveFrontend DevelopmentSVG
0 likes · 9 min read
Implement SVG Hover Color Change Using a Vue Custom Directive
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jan 18, 2025 · Frontend Development

Implement SVG Hover Color Change with a Vue Custom Directive

This article explains how to simplify SVG hover color changes in Vue by creating a reusable custom directive that dynamically modifies the fill attribute or swaps SVG markup, reducing duplicated markup and improving maintainability for both simple and complex SVG graphics.

Custom DirectiveFrontendSVG
0 likes · 9 min read
Implement SVG Hover Color Change with a Vue Custom Directive
政采云技术
政采云技术
Mar 30, 2021 · Frontend Development

Implementing Front‑end Exposure Tracking with a Custom Vue Directive

This article explains how to build a reliable front‑end exposure (view) tracking solution for e‑commerce pages by using the native IntersectionObserver API together with a custom Vue directive, covering the definition of effective exposure, required business rules, and complete code implementation.

Custom DirectiveFrontendIntersectionObserver
0 likes · 11 min read
Implementing Front‑end Exposure Tracking with a Custom Vue Directive