Q:

Vue.js - Typescript: Expected method shorthand in object literal

inside my input component, I have this code in order to make the v-model on the input works as a component:
computed: {
inputListeners: function() {
  const vm = this;
  return Object.assign({},
    this.$listeners,
    {
      input: (event: any) => {
        vm.$emit('input', event.target.value);
      },
    },
  );
},

This is the ufficial example:
https://vuejs.org/v2/guide/components-custom-events.html#Binding-Native-Events-to-Components
Now Typescript return me this Warning:
WARNING in /Users/../components/InputText.vue
Expected method shorthand in object literal ('{inputListeners() {...}}').
> inputListeners: function() {

Do you know the code solution?

A:

Use method shorthand format: inputListeners() { ... }

computed: {
  inputListeners() {
    ...
  }
}

