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

289
Views
¿Cómo pasar datos a través de un evento desde un componente vue js renderizado a la vista de rieles (haml/erb)?

He renderizado un componente Vue en una página HAML en la vista de rieles.

Configurando el componente (Webpacker -> date-picker.js)

 import Vue from 'vue' import DatePicker from '../components/DatePicker.vue' document.addEventListener('DOMContentLoaded', () => { const el = document.getElementById("date-time-picker") if (!el) { return } const app = new Vue({ el, render: h => h(DatePicker) }) })

El selector de fechas.vue

 <template> <div class="input--date-time-picker"> <v-date-picker v-model="date" class="datepicker" > <template v-slot="{ inputValue, inputEvents }"> <input class="px-2 py-1 border rounded focus:outline-none focus:border-blue-300" :value="inputValue" v-on="inputEvents" /> </template> </v-date-picker> </div> </template> <script> import VCalendar from "v-calendar/lib/components/calendar.umd"; import VDatePicker from "v-calendar/lib/components/date-picker.umd"; export default { components: { VCalendar, VDatePicker, }, data() { return { date: new Date(), }; }, watch: { date(newVal, oldVal) { this.$emit("input", newVal); }, }, }; </script>

Y usando el componente en la plantilla HAML

 #date-time-picker %date-picker

Estoy disparando un evento con datos del selector de fechas del componente vue para manejar en la página HAML, pero no puedo tomar el evento de HAML para poder usar esos datos usando el JS.

estoy buscando algo como esto

 #date-time-picker %date-picker @input="handleEvent()"

La sintaxis parece incorrecta y no funciona, ¿hay alguna buena manera de manejar esto?

about 4 years ago · Santiago Gelvez
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!