Get your own Vue server
  <h1>v-on Example</h1>
  <p>The '.stop' modifier stops the click event from propagating any further.</p>
  <p>If the '.stop' modifier is removed from this code, the parent element will also capture the click event on the child element.</p>
  <div v-on:click="this.msg.push('parent')" id="parent">
    <p>This is the parent element.</p>
    <div v-on:click.stop="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)