feat: 完成子文章的操作

This commit is contained in:
陈淳
2023-03-12 19:49:08 +08:00
parent 1eac218910
commit 8e56667760
40 changed files with 569 additions and 337 deletions

View File

@@ -0,0 +1,42 @@
<template>
<el-tree
:data="props.data"
:props="defaultProps"
@node-click="handleNodeClick"
:expand-on-click-node="false"
node-key="id"
>
<template #default="{ node, data }">
<span class="custom-tree-node">
<span>{{ node.label }}</span>
<span>
<a style="color: #f56c6c; margin-left: 8px" @click="$emit('remove',node, data)"
> 删除 </a>
</span>
</span>
</template>
</el-tree>
</template>
<script setup>
const props = defineProps(['data'])
//数据定义
//子文章数据
// const articleData =ref([]);
//树形子文章选项
const defaultProps = {
children: "children",
label: "name",
};
// //子文章初始化
// const loadArticleData=async()=>
// {
// articleData.value= await articleall(route.params.discussId);
// }
//点击事件
const handleNodeClick = (data) => {
console.log(data);
};
</script>