Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
Creación de un objeto que muestra una matriz de propiedades para la lista de películas en Vue 3 JS

Lo que estoy tratando de lograr con movie_properties es que almacene la información de las listas, como la identificación de las películas, los nombres, el género, próximamente, disponible, miniatura y vista previa.

solo una nota: esta es una llamada API con la que estoy trabajando y toda la información está allí. Solo necesito saber si lo que estoy haciendo es correcto y cómo enviaría la información anterior de la lista a su grupo respectivo.

Código Vue.js

 const url = "https://project-apis.codespace.co.za/api/movies"; const watchlistEndpoint = " https://project-apis.codespace.co.za/api/list"; const { createApp } = window.Vue; const getData = () => new Promise((resolve) => { fetch(url) .then((response) => response.json()) .then((json) => json.data.map((item) => item.name)) .then((names) => resolve(names)); }); const component = { data() { return { movie_properties:{ id:[], names:[], genre:[], comingSoon:[], avalable:[], thumbnail:[], preview:[] }, list: [], search: '' } }, computed:{ filteredList(){ return this.list.filter(item => item.includes(this.search)) }, createID(){ return this.list.id() } }, mounted() { getData().then((resolveData) => { this.list = resolveData;}) }, template: /*HTML Elements*/ `<div v-if="list.length < 1">Fetching data...</div> <div v-else> <div class="navbar"> <div class="netflix-logo"> <ul> <li>Home</li> <li>TV Shows</li> <li>Movies</li> <li>New & Popular</li> <li>My List</li> </ul> <input class="search" v-model="search"> </div> <ul> <li v-for="item in filteredList">{{ item }}</li> </ul> </div> ` } window.addEventListener("DOMContentLoaded", () => { const app = createApp(component); app.mount("#netflixApp"); });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Por favor, no se tome esto como una ofensa, pero si no sabe cómo enumerar o empujar a la matriz, parece que está tratando de saltar del segundo grado al sexto grado, omitiendo los intermedios...

 mounted() { getData().then((resolveData) => { this.list = resolveData; const result = { id:[], names:[], genre:[], comingSoon:[], available:[], thumbnail:[], preview:[] }; const tmp = new Date(); const today = tmp.getFullYear() + '-' + String(tmp.getMonth() + 1).padStart(2, '0') + '-' + String(tmp.getDate()).padStart(2, '0'); resolveData.forEach(movie => { result.id.push(movie.id); result.names.push(movie.name); result.comingSoon.push(movie.is_coming_soon > 0); result.thumbnail.push(movie.image); result.preview.push(movie.description); result.available.push(movie.release_date <= today); }); this.movie_properties = result; }); },
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!