提交 c7c79a0a 编写于 作者: H hdx

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

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