Tech Blog

The Design Decision to Manage App.vue Page State with a Simple currentPage Variable

Vue3 TypeScript Frontend

Introduction

The DVD rental customer-facing app manages page transitions without Vue Router, using only the currentPage variable in App.vue. This article explains the reasoning behind this design decision.

Why We Didn’t Use Vue Router

  • Given the app’s scale and requirements, simple state management was sufficient
  • We prioritized integration with the Spring Boot backend and kept the frontend structure simple

Implementation

<!-- App.vue (excerpt) -->
<script setup lang="ts">
import { ref } from 'vue'
const currentPage = ref('home')
</script>

Actual Screens

Film List Screen

Checkout Screen

What We Learned

Even with simple state management, as the number of pages grows, transition logic tends to scatter. Once the app reaches a certain scale, migrating to Vue Router is worth considering.

Feel free to send a message

Job offers, project referrals, feedback, questions — anything is welcome. I sincerely hope to connect with people who share high ambitions. I will keep taking on the challenges I have staked my life on. Thank you very much.