feat:添加文章页评论权限
This commit is contained in:
@@ -15,14 +15,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-divider />
|
<el-divider />
|
||||||
<div v-hasPer="['bbs:comment:add']">
|
<div>
|
||||||
<el-input
|
<el-input
|
||||||
|
:disabled="!isAddComment"
|
||||||
v-model="topContent"
|
v-model="topContent"
|
||||||
placeholder="发表一个友善的评论吧~"
|
placeholder="发表一个友善的评论吧~"
|
||||||
:rows="5"
|
:rows="5"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
></el-input>
|
></el-input>
|
||||||
<el-button @click="addTopComment" type="primary" class="btn-top-comment"
|
<el-button
|
||||||
|
@click="addTopComment"
|
||||||
|
type="primary"
|
||||||
|
class="btn-top-comment"
|
||||||
|
:disabled="!isAddComment"
|
||||||
>发表评论</el-button
|
>发表评论</el-button
|
||||||
>
|
>
|
||||||
<el-button class="btn-top-comment">其他</el-button>
|
<el-button class="btn-top-comment">其他</el-button>
|
||||||
@@ -134,10 +139,23 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref, defineProps } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { getListByDiscussId, add, del } from "@/apis/commentApi.js";
|
import { getListByDiscussId, add, del } from "@/apis/commentApi.js";
|
||||||
import AvatarInfo from "./AvatarInfo.vue";
|
import AvatarInfo from "./AvatarInfo.vue";
|
||||||
|
import { getPermission } from "@/utils/auth";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
isComment: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const { isHasPermission: isAddComment } = getPermission(
|
||||||
|
"bbs:comment:add",
|
||||||
|
props.isComment
|
||||||
|
);
|
||||||
|
|
||||||
//数据定义
|
//数据定义
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24" class="comment">
|
<el-col :span="24" class="comment">
|
||||||
<CommentInfo />
|
<CommentInfo :isComment="isDisabledCreateComment" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<BottomInfo />
|
<BottomInfo />
|
||||||
|
|||||||
Reference in New Issue
Block a user