[Vuejs]-Vue event bus emit object not passed to component

0👍

Accidentally had two script sections instead of script and style.

Before

<template>
    <div class="detail-container">
        {{details}}
    </div>
</template>

<script>
import { bus } from "../../bus.js";
export default {
    name: "ContactDetail",
    data() {
        return {
        }
    },
    props: {
        details: {
            type: String,
            required: true
        }
    }
}
</script>

<script>
</script>

After

<template>
    <div class="detail-container">
        hellow
        {{details}}
    </div>
</template>

<script>
import { bus } from "../../bus.js";
export default {
    name: "ContactDetail",
    data() {
        return {
            pfp: "",
            name: "",
            address: ""
        }
    },
    props: {
        details: {
            type: String,
            required: true
        }
    }
}
</script>

<style>
</style>

Leave a comment