textarea.uvue 1.1 KB
Newer Older
Y
init  
yurj26 已提交
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
<template>
    <view>
        <page-head :title="title"></page-head>
        <view class="uni-title uni-common-pl">
            <text class="uni-title-text">
                输入区域高度自适应,不会出现滚动条
            </text>
        </view>
        <view class="uni-textarea-box">
            <textarea @blur="bindTextAreaBlur" :auto-height="true" class="uni-textarea" />
        </view>
        <view class="uni-title uni-common-pl">
            <text class="uni-title-text">
                占位符字体是红色的textarea
            </text>
        </view>
        <view class="uni-textarea-box">
            <textarea placeholder-style="color:#F76260" placeholder="占位符字体是红色的" class="uni-textarea" />
        </view>
    </view>
</template>
<script lang="ts">
    export default {
        data() {
            return {
                title: 'textarea',
                focus: false
            }
        },
        methods: {
            bindTextAreaBlur: function (e : TextareaBlurEvent) {
                console.log(e.detail.value)
            }
        }
    }
</script>