update
This commit is contained in:
46
src/components/Comment/index.vue
Normal file
46
src/components/Comment/index.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<script setup>
|
||||
import Api from "../../api/index.js";
|
||||
import {Message} from "@arco-design/web-vue";
|
||||
|
||||
const emits = defineEmits(['success']);
|
||||
const {data, hideDelete} = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
hideDelete: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
});
|
||||
const del = async (id) => {
|
||||
const {msg} = await Api.merchant.delChildrenComment(id);
|
||||
Message.success(msg);
|
||||
emits('success');
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-for="(item, index) in data" :key="item.id" class="flex items-center">
|
||||
<div class="mr-[5px] min-w-[15px]">{{ index + 1 }}.</div>
|
||||
<div class="box">
|
||||
<div class="flex items-center whitespace-nowrap" v-if="item.pid>0">
|
||||
<img class="size-[9px] mr-[5px]" src="../../assets/images/back.png" alt=""/>
|
||||
回复{{ data.findIndex(k => k.pid === item.pid) }}:
|
||||
</div>
|
||||
<img class="size-[32px]" v-if="item.image" :src="item.image" alt=""/>
|
||||
<div class="whitespace-nowrap">{{ item.intro }}</div>
|
||||
</div>
|
||||
<a-popconfirm content="确认删除吗?" @ok="del(item.id)" v-if="!hideDelete">
|
||||
<a-button size="mini" shape="circle" type="text">
|
||||
<icon-delete/>
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.box {
|
||||
@apply p-[4px] bg-[#F2F3F5] flex items-center gap-[10px] pr-[15px] mr-[10px] min-h-[40px] flex-grow;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user