feat(comments): 添加评论组件自动获取页面标题和URL功能
refactor(email): 简化评论回复邮件通知逻辑 fix(docs): 移除过时的EMAIL_ADDRESS配置说明 style(store): 修改loading初始状态为true
This commit is contained in:
@@ -28,6 +28,12 @@ export class CWDComments {
|
||||
*/
|
||||
constructor(config) {
|
||||
this.config = { ...config };
|
||||
if (!this.config.postTitle && typeof document !== 'undefined') {
|
||||
this.config.postTitle = document.title || this.config.postSlug;
|
||||
}
|
||||
if (!this.config.postUrl && typeof window !== 'undefined') {
|
||||
this.config.postUrl = window.location.href;
|
||||
}
|
||||
this.hostElement = this._resolveElement(config.el);
|
||||
this.shadowRoot = null;
|
||||
this.mountPoint = null;
|
||||
|
||||
@@ -102,7 +102,7 @@ export function createCommentStore(config, fetchComments, submitComment) {
|
||||
const store = new Store({
|
||||
// 评论数据
|
||||
comments: [],
|
||||
loading: false,
|
||||
loading: true,
|
||||
error: null,
|
||||
|
||||
// 分页
|
||||
|
||||
Reference in New Issue
Block a user