给prompt-dialog添加type属性

This commit is contained in:
wurou 2022-12-01 10:33:46 +08:00
parent b7f64eef43
commit eafe4f07c4
1 changed files with 6 additions and 3 deletions

View File

@ -1,8 +1,10 @@
import {
customElement,
html,
ifDefined,
nothing,
query,
property,
CSSResultArray,
TemplateResult,
} from '@star-web-components/base/star-base-element.js'
@ -35,7 +37,8 @@ export class StarPromptDialog extends StarBaseDialog {
}
// 暴露给外部使用
@query('input') public promptInput!: HTMLInputElement
@property({type: String}) type!: string
@property({type: Number}) maxlength!: number
public static override get styles(): CSSResultArray {
return [super.styles, promptDialogStyles]
}
@ -57,10 +60,10 @@ export class StarPromptDialog extends StarBaseDialog {
: nothing}
<div class="star-prompt-main">
<input
type="text"
type=${ifDefined(this.type)}
value="${this.value}"
class="star-prompt-input"
maxlength="10"
maxlength=${ifDefined(this.maxlength)}
/>
<star-button
id="delete"