Restrictions of Vue Data Objects

I'm currently pondering the optimal amount of data to store in a Vue data object.

Imagine I have over 4,000 objects structured like this:

personWithAppointment = {
  id: 1,
  appointment_id: 1,
  first_name: 'Jim',
  last_name: 'Jim',
  // +20 more similar attributes
}

And these objects are stored within my peopleWithAppointments data object in Vue:

data() {
  peopleWithAppointments: [
    // 4,000 personWithAppointment objects
  ],
}

Is this considered an excessive amount of data? What about if it reaches 10K or even 50K results? How can one determine an appropriate threshold?

Furthermore, would it be better to store this data in my Vuex store's state instead?

Answer №1

While there may not be a strict limit, it is advised against having an excessive number of objects in Vue. It is highly recommended to consider transitioning them to a database system such as MongoDB for better organization and scalability.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Creating a visual representation of a loading spinner prior to implementing debounce technology

Is there a way to set this.isLoading = true before the debounce function is executed in this method? I'm trying to show a loading spinner while making an asynchronous call with axios. methods: { searchAdminUsers: _.debounce(function(quer ...

Navigating through property objects in Vue: accessing individual elements

I am a newcomer to Vue and after reviewing other questions on this platform, I am struggling to figure out how to pass an object to a child component and reference individual elements within that object. My goal is to have access to all elements of the obj ...

Is there a way to properly assign an index to a multidimensional array in a Vue.js template?

My setup involves utilizing Vue along with a multidimensional array structured like this: myArray = [[1,2,3],[1,2,3],[1,2,3]] To achieve the desired HTML layout shown below (ensuring that data-item counter increments correctly): <div class="row" data ...

Styling with Radial Gradients in CSS

Struggling to create a banner with a radial gradient background? I'm almost there, but my code isn't matching the design. Any assistance would be greatly appreciated as I can't seem to get the right colors and only part of the first circle i ...

unable to store user input in a REST API using the store functionality

Welcome to my main page! Here, I have a form that I am looking to connect with an API in order to store the entered data: <div> <span>User ID</span> <input type="text" v-model="info.userId"> </div> <br> <div> ...

Which specific files do I have to edit in order for Laravel to acknowledge a new data type?

Currently, I am honing my skills in Laravel by working on a Laravel Breeze application. One task that I have set for myself is to incorporate a postal code field into the existing User model, including the registration form. To tackle this challenge, I dec ...

Solving the image path issue in a Vue Component using webpack (inside Vuepress)

Incorporating the most recent Vuepress version (1.0.0-alpha.46), I have set up the documentation off the root directory with an assets folder for image storage. Referencing these images in markdown poses no issues. For example: ![ ](../assets/foobar.jpg) ...

Switch up your vuecomponents with Vue.js toggling!

I am currently working on a simple Vue application and I am still getting the hang of Vue.js. In my project, I have two Vue components that I want to toggle between upon clicking a button. My question is whether it is possible to achieve this by using sc ...

Unable to invoke parent method from child component in Vue causing issue

I am facing an issue where I am trying to trigger a method in the parent component from the child component using $emit, but for some reason, it is not working as expected. Can someone please help me troubleshoot this problem? Parent Component <templat ...

Formula for determining the slider's span

I recently created a range slider using Vue.js It has a minimum and maximum value, assumed to be percentages as it ranges from 0 to 100. My goal is to set the minimum value at $5,000 and the maximum at $200,000, However, I struggle with math and need th ...

Launching a new window using Vuetify's v-btn and Vue router

Vue Router's recent versions support opening links in new tabs, like the example below: <router-link :to="{ name: 'fooRoute'}" target="_blank"> Link Text </router-link> This code correctly creates a link wi ...

Unable to access 'export default class extends Vue' in the template

I've recently started using Vue.js with TypeScript, but I'm having trouble accessing values from outside the class. @Component({ name: 'SidebarItem', components: { SidebarItemLink } }) export default class extends ...

When a button is clicked, the v-bind class is no longer applied

Recently, I encountered a puzzling issue that has left me scratching my head. When I pass the class name as a prop to the child component and click the button, all layout styling is lost. However, this problem doesn't occur when I hardcode the class n ...

Ensure that Vue.js Accordion items do not auto-close when a different item is selected

I'm looking to create an Accordion menu using vuejs. The requirement is for the Accordion to stay open even if another div is clicked, and to only close when the Accordion item itself is clicked. How can I achieve this? Here is the vue code: new Vue( ...

The Vue.js v-on:mouseover function is not functioning properly in displaying the menu

When I hover over a LI tag, I want to display a menu. I have successfully implemented it using a simple variable with the following code: @mouseover="hoverFormsControls=true" @mouseleave="hoverFormsControls=false" However, when I attempted to use an arr ...

Is there a way to align the navbar to the center in bootstrap vue?

I'm trying to center my navbar component, but I can't seem to figure it out. This is my first time attempting this and everything else looks good except for this issue. <template> <div class="container"> <header> &l ...

What is the best way to retrieve the value of the "Observer" object?

I am a user of Vue.js and I have the following data in this.suspendedReserveMemo: this.suspendedReserveMemo [__ob__: Observer]650: "memo3"651: "memo4"652: ""653: ""654: ""655: ""656: ""657: ""658: ""659: ""660:""661: ""662: ""length: 663__ob__: Observer {v ...

Having trouble declaring a module in an npm package with Typescript?

I'm currently working on a project using Vue.js and TypeScript. Within project "A," I am utilizing a private npm package called "B," which serves as a component library. This package "B" also incorporates another library, 'tiptap,' which unf ...

Record the actions emitted by child components

I am struggling to respond to an action emitted by a child component. The child triggers an event/action called init. I try to listen for this event in the parent component's events mapping. However, the callback function never executes, leading me to ...

Issue with Cache in VueJS Application on Windows Server 2016 Running IIS 10

I am currently running a VueJS application on a local IIS 10 server for internal company use. However, I've encountered an issue where the index.html file seems to be cached, requiring manual browser clearing to see updates. I have read about potentia ...