Todo List Completion Animation

Animate the completion of a todo list item with a strike-through effect, using Vue's <Transition> to visually indicate an item's change in state.
  <div id="app">
      <li v-for="(todo, index) in todos" :key="">
        <transition name="strikethrough">
          <div v-if="todo.completed" class="completed">{{ todo.text }}</div>
        <div v-else>{{ todo.text }}</div>
        <button @click="completeTodo(index)">Complete</button>

export default {
  data() {
    return {
      todos: [
        { id: 1, text: 'Buy groceries', completed: false },
        { id: 2, text: 'Call mom', completed: false }
  methods: {
    completeTodo(index) {
      this.todos[index].completed = !this.todos[index].completed;

.strikethrough-enter-active, .strikethrough-leave-active {
  transition: opacity 1s;
.strikethrough-enter, .strikethrough-leave-to {
  opacity: 0.1;
  text-decoration: line-through;
.completed {
  text-decoration: line-through;
In this Vue.js template, a list of todos is displayed, each with a 'Complete' button. When a button is clicked, the completeTodo method toggles the completed state of that todo, triggering a transition effect. The strikethrough transition gives a fade-out effect alongside the line-through decoration when the todo is marked as completed.