<template>
	<view class="demo-block">
		<text class="demo-block__title-text ultra">Textarea 多行文本框</text>
		<text class="demo-block__desc-text">用于多行文本信息输入。</text>	
		<view class="demo-block__body">
			<view class="demo-block">
				<text class="demo-block__title-text">基础使用</text>
				<view class="demo-block__body">
					<l-textarea placeholder="请输入文字"></l-textarea>
				</view>	
			</view>	
			<view class="demo-block">
				<text class="demo-block__title-text">带标题</text>
				<view class="demo-block__body">
					<l-textarea label="标签文字" placeholder="请输入文字"></l-textarea>
				</view>	
			</view>	
			<view class="demo-block">
				<text class="demo-block__title-text">自动增高</text>
				<view class="demo-block__body">
					<l-textarea label="标签文字" placeholder="请输入文字" autosize ></l-textarea>
				</view>	
			</view>	
			<view class="demo-block">
				<text class="demo-block__title-text">字符限制</text>
				<view class="demo-block__body">
					<l-textarea label="标签文字" placeholder="请输入文字"  :maxlength="500" indicator></l-textarea>
				</view>	
			</view>
			<view class="demo-block">
				<text class="demo-block__title-text">禁用</text>
				<view class="demo-block__body">
					<l-textarea label="标签文字" value="不可编辑文字" placeholder="请输入文字"  disabled></l-textarea>
				</view>	
			</view>
			<view class="demo-block">
				<text class="demo-block__title-text">竖排布局</text>
				<view class="demo-block__body">
					<l-textarea label="标签文字" placeholder="请输入文字" layout="vertical"></l-textarea>
				</view>	
			</view>
			<view class="demo-block">
				<text class="demo-block__title-text">描边</text>
				<view class="demo-block__body" style="padding: 0 10px;">
					<l-textarea label="标签文字" placeholder="请输入文字" classic :maxlength="100"></l-textarea>
				</view>	
			</view>
			<view class="demo-block">
				<text class="demo-block__title-text">自定义</text>
				<view class="demo-block__body">
					<view class="custom-box">
						<text class="custom-text">标签文字</text>
						<l-textarea placeholder="请输入文字" classic :maxlength="100" indicator l-style="height: 100px;"></l-textarea>
					</view>
				</view>	
			</view>
		</view>	
	</view>
</template>

<script lang="uts">
	export default {
		data() {
			return {
				value: '999999999999999999'
			}
		},
		methods: {
			
		},
		mounted() {
			setTimeout(()=>{
				this.value = '999999999999999999998'
			},1000)
		}
	}
</script>

<style lang="scss">
	$card-bg-color: var(--doc-card-bg-color, white);
	// $page-bg-color: var(--doc-page-bg-color, #f5f5f5);
	$title-color: var(--doc-title-color, #000000E6);
	$summary-color: var(--doc-summary-color, #00000099);
	
	.custom-box {
		padding: 16px 16px 24px; 
		background-color: $card-bg-color;
	}
	.custom-text {
		color: $title-color; 
		font-size: 12px; 
		line-height: 20px; 
		padding-bottom: 8px;
	}
	.demo-block {
		margin: 32px 0 0;
		// overflow: visible;
		&.card{
			background-color: $card-bg-color;
			transition-property: background-color;
			// transition-duration: 300ms;
			padding: 30rpx;
			margin-bottom: 20rpx !important;
		}
		&__title {
			margin: 0;
			margin-top: 8px;
			
			&-text {
				color: $summary-color;
				font-weight: 400;
				font-size: 14px;
				line-height: 16px;
				margin-left: 16px;
				&.large {
					color: $title-color;
					font-size: 18px;
					font-weight: 700;
					line-height: 26px;
					display: flex;
				}
				&.ultra {
					color: $title-color;
					font-size: 24px;
					font-weight: 700;
					line-height: 32px;
					display: flex;
				}
			}
		}
		&__desc-text {
			color: $summary-color;
			margin: 8px 16px 0 0;
			font-size: 14px;
			line-height: 22px;
			margin-left: 16px;
		}
		&__body {
			margin: 16px 0;
			overflow: visible;
			.demo-block {
				// margin-top: 0px;
				margin: 0;
			}
		}
	}
</style>