Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit de002ec

Browse files
committed
feat: pass comment props via frontmatter
1 parent b235f50 commit de002ec

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/client/components/Comment.vue

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
<template>
22
<Vssue
33
v-if="commentService === 'vssue'"
4-
v-bind="propsWithoutEmptyProperties"
5-
:title="$page.title"
4+
v-bind="vssueProps"
65
/>
76
<vue-disqus
87
v-else-if="commentService === 'disqus'"
9-
v-bind="propsWithoutEmptyProperties"
10-
:identifier="$page.key"
8+
v-bind="disqusProps"
119
/>
1210
</template>
1311

@@ -74,6 +72,18 @@
7472
computed: {
7573
propsWithoutEmptyProperties () {
7674
return pickBy(this.$props, identity);
75+
},
76+
77+
commentProps () {
78+
return Object.assign({}, this.propsWithoutEmptyProperties, this.$frontmatter.comment)
79+
},
80+
81+
vssueProps () {
82+
return Object.assign({ title: this.$page.title }, this.commentProps)
83+
},
84+
85+
disqusProps () {
86+
return Object.assign({ identifier: this.$page.key }, this.commentProps)
7787
}
7888
},
7989

0 commit comments

Comments
 (0)