Files
element-plus/docs/examples/input/length-limiting.vue
一只前端汪 ddf28c98d3 feat(components): [input] add word-limit-position attributes (#22359)
* fix: input maxlength

* fix: make error tip same line

* fix: format

* fix: use     top: 100%;

* feat: expand show-limit-word

* feat: add test

* fix: optimize code

* fix: use nsInput.is and update docs

* fix: update test case

* fix: add wordLimitPosition props

* chore: update docs

* fix: add version tag

* fix: input support outside

* fix: update docs

* fix: add backgroundcolor

* fix: Restore code

* fix: update docs demo

* fix: add input test case

* fix: Remove two useless CSS

* Merge branch 'dev' into input-max-length
2025-10-17 11:46:14 +08:00

47 lines
871 B
Vue

<template>
<el-input
v-model="text"
style="width: 240px"
maxlength="10"
placeholder="Please input"
show-word-limit
type="text"
/>
<el-input
v-model="text"
class="ml-4"
style="width: 240px"
maxlength="10"
placeholder="Please input"
show-word-limit
word-limit-position="outside"
type="text"
/>
<div style="margin: 20px 0" />
<el-input
v-model="textarea"
maxlength="30"
style="width: 240px"
placeholder="Please input"
show-word-limit
type="textarea"
/>
<el-input
v-model="textarea"
class="ml-4"
maxlength="30"
style="width: 240px"
placeholder="Please input"
show-word-limit
word-limit-position="outside"
type="textarea"
/>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const text = ref('')
const textarea = ref('')
</script>