| | |
| | | <textarea |
| | | ref="textarea" |
| | | class="textarea" |
| | | :style="{height: height || '94px'}" |
| | | :style="{height: areaHeight}" |
| | | :placeholder="placeholder" |
| | | :value="itemRes.formData[itemRes.name]" |
| | | :autoFocus="true" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import Taro from '@tarojs/taro'; |
| | | import { $ } from '@tarojs/extend'; |
| | | import { AtInput } from 'taro-ui-vue'; |
| | | import './cTextArea.scss'; |
| | |
| | | AtInput, |
| | | }, |
| | | props: { |
| | | height: String, |
| | | height: { |
| | | type: Number, |
| | | default: 94, |
| | | }, |
| | | placeholder: String, |
| | | itemRes: Object, |
| | | }, |
| | | data() { |
| | | return {}; |
| | | }, |
| | | computed: { |
| | | areaHeight() { |
| | | return Taro.pxTransform(this.height); |
| | | }, |
| | | }, |
| | | methods: {}, |
| | | mounted() { |
| | | $(this.$refs.input.$el).find('.at-input__input').prepend(this.$refs.textarea.$el); |
| | | if (process.env.TARO_ENV === 'h5') { |
| | | $(this.$refs.input.$el) |
| | | .find('.at-input__input') |
| | | .prepend(this.$refs.textarea.$el); |
| | | } else if (process.env.TARO_ENV === 'weapp') { |
| | | console.log(this.$refs); |
| | | $(this.$refs.input.$el) |
| | | .find('.at-input__container') |
| | | .append(this.$refs.textarea); |
| | | } |
| | | }, |
| | | }; |
| | | </script> |