What is $emit(\’remove\’) in vue js

Solution:

seems it connected to emit event which is bind to that element.

<button v-on:click="$emit(\'remove\')">X</button>

is connected to this piece of code in the declaration, you can see this code is just above in your example

<li
  is="todo-item"
  v-for="(todo, index) in todos"
  v-bind:title="todo"
  v-on:remove="todos.splice(index, 1)"
></li>

here you can see:

v-on:remove="todos.splice(index, 1)"

this is the event so when you click on that button this will be fired and that item will be removed from the list.

and make sure this list items are component so it use that template to render each items.

if you have further question please feel free to ask.