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

144
Views
Vue - InertiaJS: no se puede ingresar el objeto

En mis accesorios, paso la matriz "ticket_data" al cargar el componente Vue. Ahora quiero hacer una publicación en un controlador usando el formulario Inertia. Esto también funciona sin problemas.

Mi problema es que no puedo acceder a los valores individuales de la matriz...

Mi código:

 let props = defineProps({ ticket_data: Object, ticket_messages: Object, }); let form = useForm({ text: '', }); let submit = () => { form .transform((data) => ({ data, ticket_id: props.ticket_data.ticket_id, // null ticket_id: props.ticket_data, // gives all Data see Json })) .post('/account/user/support/ticket/send', { preserveScroll: true, onSuccess: () => form.reset('text'), }); };

Si envío props.ticket_data individualmente, la siguiente publicación llega a mi controlador:

 "ticket_id":[{"user_id":1,"ticket_id":5,"reference":"Testticket","state":0,"author":"Kevin Johnson","text":"..","created_at":"11/04/22 - 19:58"}]}

Si los datos llegan con "props.ticket_data", ¿por qué no puedo acceder a ellos simplemente con "props.ticket_data.ticket_id"?

"props.ticket_data.[1]" tampoco funciona así....

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Obtenga un boleto por ID como este:

 props.ticket_data.find(ticket => ticket.ticket_id === 5) // <-- ticket id
about 4 years ago · Santiago Trujillo 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!