s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
s
// Parent component
<template>
<child-component v-on:message="handleMessage"></child-component>
</template>
<script>
import ChildComponent from './ChildComponent.vue'
export default {
components: { ChildComponent },
methods: {
handleMessage(message) {
console.log(message)
}
}
}
</script>
// Child component
<template>
<button v-on:click="sendMessage">Send message</button>
</template>
<script>
export default {
methods: {
sendMessage() {
this.$emit('message', 'Hello from child')
}
}
}
</script>
s
No comments:
Post a Comment