提交 9a53eb54 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

feat:input 增加hold-keyboard示例

上级 0dfd2ab3
...@@ -155,6 +155,18 @@ ...@@ -155,6 +155,18 @@
</view> </view>
</view> </view>
<view>
<view class="uni-title" style="flex-direction: row;align-items: center;">
<text class="uni-title-text">设置hold-keyboard</text>
<switch style="margin-left: 10px;" @change="changeHoldKeyboard" :checked="holdKeyboard"></switch>
</view>
<view class="input-wrapper">
<input class="uni-input" :hold-keyboard="holdKeyboard" value="hold-keyboard" />
</view>
</view>
<view> <view>
<view class="uni-title"> <view class="uni-title">
<text class="uni-title-text">input事件</text> <text class="uni-title-text">input事件</text>
...@@ -245,7 +257,8 @@ ...@@ -245,7 +257,8 @@
onMaxLengthInputValue:"", onMaxLengthInputValue:"",
inputMaxLengthFocus:false, inputMaxLengthFocus:false,
inputPasswordValue:"", inputPasswordValue:"",
inputFocusKeyBoardChangeValue:true inputFocusKeyBoardChangeValue:true,
holdKeyboard:false
} }
}, },
methods: { methods: {
...@@ -303,8 +316,8 @@ ...@@ -303,8 +316,8 @@
return this.onMaxLengthInputValue.length return this.onMaxLengthInputValue.length
}, },
changeCursorColor(event: SwitchChangeEvent){ changeCursorColor(event: SwitchChangeEvent){
const transparent = event.detail.value; const checked = event.detail.value;
if(transparent){ if(checked){
this.cursor_color = "red" this.cursor_color = "red"
}else{ }else{
this.cursor_color = "#3393E2" this.cursor_color = "#3393E2"
...@@ -312,6 +325,10 @@ ...@@ -312,6 +325,10 @@
const input = uni.getElementById<UniInputElement>("uni-input-cursor-color") const input = uni.getElementById<UniInputElement>("uni-input-cursor-color")
input?.focus() input?.focus()
}, },
changeHoldKeyboard(event: SwitchChangeEvent){
const checked = event.detail.value;
this.holdKeyboard = checked
}
} }
} }
</script> </script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册