diff --git a/packages/comment-widget/src/base-form.ts b/packages/comment-widget/src/base-form.ts index 62de873..1a7ac12 100644 --- a/packages/comment-widget/src/base-form.ts +++ b/packages/comment-widget/src/base-form.ts @@ -1,5 +1,7 @@ -import './emoji-button'; +import type { User } from '@halo-dev/api-client'; +import { consume } from '@lit/context'; import { css, html, LitElement } from 'lit'; +import { property, state } from 'lit/decorators.js'; import { createRef, Ref, ref } from 'lit/directives/ref.js'; import { allowAnonymousCommentsContext, @@ -9,12 +11,10 @@ import { kindContext, nameContext, } from './context'; -import { property, state } from 'lit/decorators.js'; -import type { User } from '@halo-dev/api-client'; +import './emoji-button'; +import './icons/icon-loading'; import baseStyles from './styles/base'; -import { consume } from '@lit/context'; import varStyles from './styles/var'; -import './icons/icon-loading'; export class BaseForm extends LitElement { @consume({ context: baseUrlContext }) @@ -41,21 +41,12 @@ export class BaseForm extends LitElement { @state() name = ''; - @property({ type: Boolean }) - captchaRequired = false; - @property({ type: String }) - captchaImage = ''; + captcha = ''; @property({ type: Boolean }) submitting = false; - @property({ type: String }) - captchaCode = ''; - - @property({ type: String }) - captchaCodeMsg = ''; - textareaRef: Ref = createRef(); get customAccount() { @@ -179,16 +170,6 @@ export class BaseForm extends LitElement { placeholder="网站" /> (已有该站点的账号) -
- - ${this.captchaCodeMsg} - captcha -
` : ''} @@ -204,6 +185,15 @@ export class BaseForm extends LitElement { ` : ''}
+ ${this.captcha + ? html` +
+ + captcha +
+ ` + : ''} +