没有结果

Input

我用几行字形容你是我的谁

import { DuInput } from 'dangoui'

示例

各种例子
<template>
  <PreviewBlock title="最简例子">
    <DuInput placeholder="请输入描述" />
  </PreviewBlock>
  <PreviewBlock title="带后缀">
    <DuInput placeholder="请输入金额" suffix="元" />
  </PreviewBlock>
  <PreviewBlock title="不带 border">
    <DuInput placeholder="请输入金额" suffix="元" without-border />
  </PreviewBlock>
  <PreviewBlock title="显示清除图标">
    <DuInput placeholder="请输入金额" suffix="元" allow-clear />
  </PreviewBlock>
  <PreviewBlock title="右侧图标">
    <DuInput placeholder="请输入金额" right-icon="arrow-heavy-right" right-icon-size="8px" />
  </PreviewBlock>
  <PreviewBlock title="显示外边框">
    <DuInput placeholder="请输入金额" bordered allow-clear />
  </PreviewBlock>
  <PreviewBlock title="显示外边框/禁用">
    <DuInput placeholder="请输入金额" bordered disabled />
  </PreviewBlock>
</template>

<script setup lang="ts">
import { DuInput } from 'dangoui'
</script>
0

API

属性

属性名类型默认值说明
type"number" | "text" | "idcard" | "digit" | "safe-password" | "nickname" | "password""text"
borderedbooleanfalse是否展示外边框
ext-classstring | string[] | Record<string, boolean>""
ext-stylestring | { [x: string]: string | number; }""
valuestring""
disabledbooleanfalse禁用
placeholderstring""
autofocusbooleanfalse自动聚焦,拉起键盘
passwordbooleanfalse是否是密码类型
maxlengthnumber-1
input-alignstring"left"
without-borderbooleanfalse是否展示底部的分割线,可能想改一下这个名字
prefixstring""前缀文本
trimbooleanfalse自动去除输入的空格
suffixstring""后缀文本
cursor-spacingnumber0cursorSpacing
confirm-typestring"done"confirmType
always-embedbooleanfalsealwaysEmbed
confirm-holdbooleanfalseconfirmHold
cursornumber0cursor
selection-startnumber-1selectionStart
selection-endnumber-1selectionEnd
adjust-positionbooleantrueadjustPosition
allow-clearbooleanfalse当有内容时,点击清除图标能够清除内容
right-iconstring - rightIcon
right-icon-sizestring - rightIconSize

事件

名称类型
confirm(event: "confirm", value: { detail: { value: string; }; }): void
update:value(event: "update:value", value: string): void
input(event: "input", value: string): void
change(event: "change", value: string): void
focus(event: "focus", value: { detail: { height: number; }; }): void
blur(event: "blur", value: { detail: {}; }): void
keyboardheightchange(event: "keyboardheightchange", value: { detail: { height: number; duration: number; }; }): void