mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 09:20:51 +08:00
869cec59ba
* feat(input): migrate input component simply re #95 * feat(input): mainly complete input component & add more input tests * fix: address pr comments Co-authored-by: 陈婉玉 <simonaliachen@gmail.com>
49 lines
1011 B
Vue
49 lines
1011 B
Vue
<template>
|
|
<div class="demo-input">
|
|
<h3>文本域</h3>
|
|
<el-input
|
|
v-model="textarea1"
|
|
:rows="2"
|
|
type="textarea"
|
|
placeholder="请输入内容"
|
|
/>
|
|
</div>
|
|
<div class="demo-input">
|
|
<h3>可自适应文本高度的文本域</h3>
|
|
<el-input
|
|
v-model="textarea2"
|
|
type="textarea"
|
|
autosize
|
|
placeholder="请输入内容"
|
|
/>
|
|
<div style="margin: 20px 0;"></div>
|
|
<el-input
|
|
v-model="textarea3"
|
|
type="textarea"
|
|
:autosize="{minRows: 3, maxRows: 5}"
|
|
placeholder="请输入内容"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent } from 'vue'
|
|
|
|
const basic = defineComponent({
|
|
data() {
|
|
return {
|
|
textarea1: 'sda\ndasd\nddasdsda\ndasd\nddasdsda\ndasd\nddasdsda\ndasd\nddasd',
|
|
textarea2: 'sda\ndasd\nddasdsda\ndasd\nddasdsda\ndasd\nddasdsda\ndasd\nddasd',
|
|
textarea3: '',
|
|
}
|
|
},
|
|
})
|
|
export default basic
|
|
</script>
|
|
|
|
<style>
|
|
.demo-input .el-textarea {
|
|
width: 414px;
|
|
}
|
|
</style>
|