from child to parent Error in v-on handler: "TypeError: handler.apply is not a function"

Viewed 11

I have cascader which includes handleClick event. And when it is clicked, I want to send a value as true to parent component and in parent component I want to use it. So my child component:

<el-cascader
      v-model="file"
      @change="handleChange"
    />

methods: {
handleChange() {
      this.$emit('is-file-changed', true);
    },
}

And this is how I sent it to child component (so my parent component is like in below):

<file-selector v-model="contract.file" @is-file-changed="fileSelected" />

data() {
    return {
      fileSelected: false,
    };
  },

But it gives me an error saying [Vue warn]: Error in v-on handler: "TypeError: handler.apply is not a function"

I believe I sent it all right. So what I am doing wrong?

1 Answers

You are firing the event as is-dossier-changed and listening as @is-file-changed in your parent. Isn't it typo ?

Related