element-plus/packages/input/doc/textarea.vue
Hanx 869cec59ba
Feat/input (#216)
* 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>
2020-09-04 08:24:56 +08:00

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>