Emits usage with router

I have a simple app contains two view: insert data , Home.

Let’s focus on the insert data view where the user inputs something which i want to emit to the parent (the app).

So here where ths user input :

`<textarea  type="text" v-model="insertedText" @input="insertedDataEmiter" ></textarea>`

then the function emits it:

methods:{ insertedDataEmiter(){ this.$emit("inserted-text",this.insertedText) }}

i added emits option too:
emits: ["inserted-text"],
now let’s go to the parent where we find the router links and the router view anwhichs listens to the custom event:

Home |Insert Names

<router-view u/inserted-names-array="nameslister"/>

then a simple method comes in:


the data gets to the console; But it shows a warning every I click on the other router link"Home" . as it is expecting the emit from there too but doesn’t get. So how can i use that emit for only one router link.

PS : the warning is gone when i added the emits option to the other view “Home”

emits: ["inserted-text"],

But it doesn’t make a sense as long as the home components isn’t emitting any event.

So What is going on here ?