<template>
<div class="ReplyChild">
<div v-for="(item, key) in Data" :key="key">
<ForeignUser :UID="item.CUID">
<teplate slot-scope="s">
<div v-if="item.PCID == Cid" @click="childMethod(item.CID, s.Nick)">
<div>
<span>
{{ s.Nick }}
<span
>回复<span v-for="(v1, k1) in Data" :key="k1">
<span v-if="v1.CID == item.PCID">
<ForeignUser :UID="v1.CUID">
<teplate slot-scope="s">
{{ s.Nick }}
</teplate>
</ForeignUser>
</span></span
></span
> </span
>:{{ item.Desc }}
</div>
<div v-if="Cid">
<ReplyChild :cid="item.CID" :Data="Data" />
</div>
</div>
</teplate>
</ForeignUser>
</div>
</div>
</template>
<script lang="ts">
import { Component, Vue, Prop } from "vue-property-decorator";
@Component({})
export default class ReplyChild extends Vue {
@Prop() private Data!: any;
@Prop() private Cid!: any;
childMethod(e: any, nick: any) {
this.$emit("fath", [e, nick]);
}
}
</script>
<style scoped lang="less"></style>
调用
<div v-for="(item, key) in Commonts.L" :key="key">
<div class="reply" v-if="item.PCID == i.CID">
<div class="reply-main">
<ReplyChild
:Data="Commonts.L"
:Cid="i.CID"
@fath="reply($event[0], $event[1])"
/>
</div>
</div>
</div>