[Vuejs]-How to pass an object to the html attribute for buefy component

0👍

The property you’re passing isn’t valid javascript. Also, the expected property for the time-formatter parameter isn’t a string representing a function, but an actual function. Let’s fix it:

First, let’s fix our javascript error and the callback function parameter:

:timepicker="{'time-formatter': t_formatter}"

Now let’s make sure we declare that function within our vue template:

t_formatter (time) {
  return Intl.DateTimeFormat(locale, { timezone: "UTC" }).format(time)
}

Now you should be able to modify the time appropriately.

Leave a comment