| | |
| | | <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> |
| | |
| | | @import "../../common/sassMixin"; |
| | | |
| | | .c-textarea { |
| | | .at-input__input { |
| | | .weui-input { |
| | | .at-input__container { |
| | | .weui-input, |
| | | input { |
| | | display: none; |
| | | } |
| | | .textarea { |
| | | flex: 1; |
| | | width: 100%; |
| | | height: 94px; |
| | | padding-right: 18rpx; |
| | | font-size: 32px; |
| | | textarea { |
| | | resize: none; |
| | | @include flexbox(flex, center center); |
| | | } |
| | | .textarea-placeholder { |
| | | color: #ccc; |
| | | } |
| | | } |
| | | } |
| | | .at-input__icon { |