Skip to content
On this page

Input

Size

<script setup lang="ts">
import { ref } from 'vue'
import { DuInput } from 'doggy-ui-v3'

const value1 = ref<string>('')
const value2 = ref<string>('')
</script>

<template>
  <div style="display: flex; align-items: flex-end">
    <du-input v-model="value1" size="small" style="width: 100px; margin-right: 1em" />
    <du-input v-model="value2" size="default" style="width: 120px" />
  </div>
</template>

Clearable

<script setup lang="ts">
import { ref } from 'vue'
import { DuInput } from 'doggy-ui-v3'

const value = ref<string>('')
</script>

<template>
  <du-input v-model="value" clearable />
</template>

Modifier

<script setup lang="ts">
import { ref } from 'vue'
import { DuInput } from 'doggy-ui-v3'

const value1 = ref<string>('')
const value2 = ref<number>(0)
const value3 = ref<string>('')
</script>

<template>
  <du-input v-model.trim="value1" style="margin-bottom: 0.5em" />
  <du-input v-model.number="value2" style="margin-bottom: 0.5em" />
  <du-input v-model.capitalize="value3" />
</template>

API

Props

NameDescriptionTypeDefault
model-value / v-modelbinding valuestring | number-
sizeinput size'default' | 'small''default'
clearableis input clearablebooleanfalse

modelModifiers

ValueDescription
trimremove white space at start and end
numbermust input number
capitalizecapitalized the first letter