提交 f77db297 编写于 作者: fxy060608's avatar fxy060608

chore: 调整 textarea 示例代码以同时支持web

上级 f401ca72
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
auto_focus_boolean: false, auto_focus_boolean: false,
default_value:"", default_value:"",
maxlength:-1, maxlength:-1,
inputmode_enum: [{"value":0,"name":"none"},{"value":1,"name":"text"},{"value":2,"name":"decimal"},{"value":3,"name":"numeric"},{"value":4,"name":"tel"},{"value":5,"name":"search"},{"value":6,"name":"email"},{"value":7,"name":"url"}] as ItemType[], inputmode_enum: [{"value":1,"name":"text"},{"value":2,"name":"decimal"},{"value":3,"name":"numeric"},{"value":4,"name":"tel"},{"value":5,"name":"search"},{"value":6,"name":"email"},{"value":7,"name":"url"},{"value":0,"name":"none"}] as ItemType[],
cursor_color: "#3393E2", cursor_color: "#3393E2",
inputmode_enum_current: 0 inputmode_enum_current: 0
} }
...@@ -46,11 +46,12 @@ export default { ...@@ -46,11 +46,12 @@ export default {
</script> </script>
<template> <template>
<scroll-view style="flex: 1" :scroll-y="true">
<view class="main"> <view class="main">
<textarea <textarea
:value="default_value" :value="default_value"
class="uni-textarea" class="uni-textarea"
:auto-focus="auto_focus_boolean" :auto-focus="true"
:focus="focus_boolean" :focus="focus_boolean"
:confirm-hold="confirm_hold_boolean" :confirm-hold="confirm_hold_boolean"
:auto-height="auto_height_boolean" :auto-height="auto_height_boolean"
...@@ -76,15 +77,15 @@ export default { ...@@ -76,15 +77,15 @@ export default {
style="padding: 20rpx; border: 1px solid #666" style="padding: 20rpx; border: 1px solid #666"
/> />
</view> </view>
<scroll-view style="flex: 1" :scroll-y="true">
<view class="content"> <view class="content">
<!-- #ifndef WEB -->
<boolean-data <boolean-data
:defaultValue="false" :defaultValue="false"
title="键盘弹起时,是否自动上推页面" title="键盘弹起时,是否自动上推页面"
@change="change_adjust_position_boolean" @change="change_adjust_position_boolean"
></boolean-data> ></boolean-data>
<!-- #ifdef !APP --> <!-- #endif -->
<!-- #ifdef MP -->
<boolean-data <boolean-data
:defaultValue="false" :defaultValue="false"
title="是否显示键盘上方带有“完成”按钮那一栏" title="是否显示键盘上方带有“完成”按钮那一栏"
...@@ -112,8 +113,8 @@ export default { ...@@ -112,8 +113,8 @@ export default {
@change="change_focus_boolean" @change="change_focus_boolean"
></boolean-data> ></boolean-data>
<boolean-data <boolean-data
:defaultValue="false" :defaultValue="true"
title="自动获取焦点" title="首次自动获取焦点"
@change="change_auto_focus_boolean" @change="change_auto_focus_boolean"
></boolean-data> ></boolean-data>
<boolean-data <boolean-data
...@@ -121,18 +122,20 @@ export default { ...@@ -121,18 +122,20 @@ export default {
title="改变光标颜色为透明" title="改变光标颜色为透明"
@change="change_cursor_color_boolean" @change="change_cursor_color_boolean"
></boolean-data> ></boolean-data>
<!-- #ifdef WEB -->
<enum-data <enum-data
:items="inputmode_enum" :items="inputmode_enum"
title="是一个枚举属性,它提供了用户在编辑元素或其内容时可能输入的数据类型的提示。在符合条件的高版本webview里,uni-app的 web 和 app-vue 平台中可使用本属性。" title="是一个枚举属性,它提供了用户在编辑元素或其内容时可能输入的数据类型的提示。在符合条件的高版本webview里,uni-app的 web 和 app-vue 平台中可使用本属性。"
@change="radio_change_inputmode_enum" @change="radio_change_inputmode_enum"
></enum-data> ></enum-data>
<!-- #endif -->
</view> </view>
</scroll-view> </scroll-view>
</template> </template>
<style> <style>
.main { .main {
max-height: 500rpx; min-height: 200rpx;
padding: 10rpx 0; padding: 10rpx 0;
border-bottom: 1px solid rgba(0, 0, 0, 0.06); border-bottom: 1px solid rgba(0, 0, 0, 0.06);
flex-direction: row; flex-direction: row;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册