提交 c7c79a0a 编写于 作者: H hdx

fix(form示例):Web平台页面无法滚动导致内容显示不全的问题

上级 b4dff40c
<template>
<scroll-view class="page">
<form @submit="onFormSubmit" @reset="onFormReset">
<view class="uni-form-item">
<view class="title">姓名</view>
<input class="uni-input" name="nickname" :value="nickname" placeholder="请输入姓名" />
</view>
<view class="uni-form-item">
<view class="title">性别</view>
<radio-group name="gender" class="flex-row">
<view class="group-item">
<radio value="0" :checked="gender=='0'" /><text>男</text>
</view>
<view class="group-item">
<radio value="1" :checked="gender=='1'" /><text>女</text>
</view>
</radio-group>
</view>
<view class="uni-form-item">
<view class="title">爱好</view>
<checkbox-group name="loves" class="flex-row">
<view class="group-item">
<checkbox value="0" :checked="loves.indexOf('0')>-1" /><text>读书</text>
</view>
<view class="group-item">
<checkbox value="1" :checked="loves.indexOf('1')>-1" /><text>写字</text>
<!-- #ifdef APP -->
<scroll-view class="scroll-view" :scroll-y="true">
<!-- #endif -->
<view class="page">
<form @submit="onFormSubmit" @reset="onFormReset">
<view class="uni-form-item">
<view class="title">姓名</view>
<input class="uni-input" name="nickname" :value="nickname" placeholder="请输入姓名" />
</view>
<view class="uni-form-item">
<view class="title">性别</view>
<radio-group name="gender" class="flex-row">
<view class="group-item">
<radio value="0" :checked="gender=='0'" /><text>男</text>
</view>
<view class="group-item">
<radio value="1" :checked="gender=='1'" /><text>女</text>
</view>
</radio-group>
</view>
<view class="uni-form-item">
<view class="title">爱好</view>
<checkbox-group name="loves" class="flex-row">
<view class="group-item">
<checkbox value="0" :checked="loves.indexOf('0')>-1" /><text>读书</text>
</view>
<view class="group-item">
<checkbox value="1" :checked="loves.indexOf('1')>-1" /><text>写字</text>
</view>
</checkbox-group>
</view>
<view class="uni-form-item">
<view class="title">年龄</view>
<slider name="age" :value="age" :show-value="true"></slider>
</view>
<view class="uni-form-item">
<view class="title">保留选项</view>
<view>
<switch name="switch" :checked="switch" />
</view>
</checkbox-group>
</view>
<view class="uni-form-item">
<view class="title">年龄</view>
<slider name="age" :value="age" :show-value="true"></slider>
</view>
<view class="uni-form-item">
<view class="title">保留选项</view>
<view>
<switch name="switch" :checked="switch" />
</view>
</view>
<view class="uni-btn-v flex-row">
<button class="btn btn-submit" form-type="submit" type="primary">Submit</button>
<button class="btn btn-reset" type="default" form-type="reset">Reset</button>
</view>
</form>
<view class="result">提交的表单数据</view>
<textarea class="textarea" :value="formDataText"></textarea>
<view class="uni-btn-v flex-row">
<button class="btn btn-submit" form-type="submit" type="primary">Submit</button>
<button class="btn btn-reset" type="default" form-type="reset">Reset</button>
</view>
</form>
<view class="result">提交的表单数据</view>
<textarea class="textarea" :value="formDataText" :maxlength="-1" :auto-height="true"></textarea>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script>
......@@ -76,8 +82,11 @@
</script>
<style>
.page {
.scroll-view {
flex: 1;
}
.page {
padding: 15px;
}
......@@ -116,6 +125,7 @@
.textarea {
margin-top: 5px;
padding: 5px;
background-color: #fff;
}
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册