DemoTextfieldCounter.vue
774 Bytes
<script lang="ts" setup>
const title = ref('Preliminary report')
const description = ref('California is a state in the western United States')
const rules = [(v: string) => v.length <= 25 || 'Max 25 characters']
</script>
<template>
<VRow>
<VCol cols="12">
<VTextField
v-model="title"
:rules="rules"
counter="25"
placeholder="Placeholder Text"
hint="This field uses counter prop"
label="Regular"
/>
</VCol>
<VCol cols="12">
<VTextField
v-model="description"
:rules="rules"
counter
maxlength="25"
placeholder="Placeholder Text"
hint="This field uses maxlength attribute"
label="Limit exceeded"
/>
</VCol>
</VRow>
</template>