1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
| /**
| * CTextArea
| * @author Tevin
| */
|
| <template>
| <view class="c-textarea">
| <AtInput
| ref="input"
| :name="itemData.name"
| :title="itemData.label"
| :required="itemData.required"
| :error="itemData.error"
| />
| <textarea
| ref="textarea"
| class="textarea"
| :style="{height: height || '2rem'}"
| :placeholder="placeholder"
| :value="itemData.formData[itemData.name]"
| :autoFocus="true"
| @input="evt=>itemData.onChange(evt.detail.value)"
| />
| </view>
| </template>
|
| <script>
| import { $ } from '@tarojs/extend';
| import { AtInput } from 'taro-ui-vue';
| import './cTextArea.scss';
|
| export default {
| name: 'CTextArea',
| components: {
| AtInput,
| },
| props: {
| height: String,
| placeholder: String,
| itemData: Object,
| },
| data() {
| return {};
| },
| methods: {},
| mounted() {
| $(this.$refs.input.$el).find('.at-input__input').prepend(this.$refs.textarea.$el);
| },
| };
| </script>
|
|