More Premium Hugo Themes Premium Vue Themes

Vue Starport

Shared component across routes with animations

Vue Starport

Shared component across routes with animations

Author Avatar Theme by antfu
Github Stars Github Stars: 1903
Last Commit Last Commit: Sep 14, 2023 -
First Commit Created: Aug 27, 2024 -
default image

Overview

The document introduces a new approach called Starport for Vue.js, designed to address challenges in animating components during user navigation between routes. It discusses how the structure of Vue components can hinder smooth transitions between routes and introduces a technique called FLIP to enumerate transitions. Starport aims to solve this issue by hoisting components to the root to make them independent of routes and using a Proxy component to manage animations.

Features

  • Experimental: Vue Starport is an experimental approach designed for Vue 3.
  • Proxy Component: Introduces a Proxy component to manage component animations and positioning.
  • Teleport Component: Utilizes the component for components to “land” in expected positions.
  • Global Component Registration: Allows for registering components globally for easy usage.
  • StarportCarrier Usage: Requires adding component to the root component and nesting components within it.

Installation

To install Vue Starport:

  1. Add the component from vue-starport to your root component (app.vue).
  2. Ensure that all components are contained within component.
  3. Wrap components in routes with the component.
  4. Apply necessary styles to components to define landing areas.

Summary

The document introduces Starport, an experimental approach for Vue 3, aimed at simplifying component animations during route transitions. By hoisting components to the root and using Proxy components, Starport facilitates smooth transitions and preserves DOM structure during navigation. It provides a unique solution for managing component animations and positioning in Vue.js applications.