Get your own Vue server
  <h1>v-on Example</h1>
  <p>When the '.capture' modifier is used on the parent DIV element, the event is captured first in the parent element when the child element is clicked.</p>
  <p>If the '.capture' modifier is removed from this code, the child element will capture the click event first. This is the default behavior, that the event bubbles up, first in child element, then to the parent.</p>
  <div v-on:click.capture="this.msg.push('parent')" id="parent">
    <p>This is the parent element.</p>
    <div v-on:click="this.msg.push('child')">
      <p>This is the child element. CLICK HERE!</p>
  <p>The order of when and where the event is captured.</p>
    <li v-for="x in msg">{{ x }}</li>

export default {
  data() {
    return {
      msg: []

<style scoped>
div {
  margin: 10px;
  padding: 10px;
  border: dashed black 1px;
#parent {
  width: 250px;
  background-color: lightpink;
#parent > div {
  cursor: pointer;
  background-color: lightgreen;
import { createApp } from 'vue'

import App from './App.vue'

const app = createApp(App)