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

fix:1.修改设备信息相关接口的示例样式 2. input示例多次点击cursor设置无效问题

上级 b9298c88
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="uni-label" style="width:180px;">是否授权使用摄像头</view> <view class="uni-label" style="width:180px;">是否授权使用摄像头</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="cameraAuthorized" /> <input type="text" :disabled="true" placeholder="未获取" :value="cameraAuthorized" />
</view> </view>
</view> </view>
<view class="uni-list-cell"> <view class="uni-list-cell">
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<view class="uni-label" style="width:180px;">是否授权使用定位</view> <view class="uni-label" style="width:180px;">是否授权使用定位</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="locationAuthorized" /> <input type="text" :disabled="true" placeholder="未获取" :value="locationAuthorized" />
</view> </view>
</view> </view>
<view class="uni-list-cell"> <view class="uni-list-cell">
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<view class="uni-label" style="width:180px;">定位准确度</view> <view class="uni-label" style="width:180px;">定位准确度</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="locationAccuracy" /> <input type="text" :disabled="true" placeholder="未获取" :value="locationAccuracy" />
</view> </view>
</view> </view>
<view class="uni-list-cell"> <view class="uni-list-cell">
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<view class="uni-label" style="width:180px;">是否授权使用麦克风</view> <view class="uni-label" style="width:180px;">是否授权使用麦克风</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="microphoneAuthorized" /> <input type="text" :disabled="true" placeholder="未获取" :value="microphoneAuthorized" />
</view> </view>
</view> </view>
<view class="uni-list-cell"> <view class="uni-list-cell">
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<view class="uni-label" style="width:180px;">是否授权通知</view> <view class="uni-label" style="width:180px;">是否授权通知</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="notificationAuthorized" /> <input type="text" :disabled="true" placeholder="未获取" :value="notificationAuthorized" />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="uni-label" style="width:180px;">{{item.label}}</view> <view class="uni-label" style="width:180px;">{{item.label}}</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<textarea style="width: 100%;" :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" /> <text style="width: 100%;" :value="item.value == '' ? '未获取' : item.value " />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
}}</view> }}</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<textarea style="width: 100%;" :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" /> <text style="width: 100%;" :value="item.value == '' ? '未获取' : item.value " />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}}</view> }}</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<textarea style="width: 100%;" :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" /> <text style="width: 100%;" :value="item.value == '' ? '未获取' : item.value " />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="uni-label" style="width:180px;">蓝牙的系统开关</view> <view class="uni-label" style="width:180px;">蓝牙的系统开关</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="bluetoothEnabled" /> <input type="text" :disabled="true" placeholder="未获取" :value="bluetoothEnabled" />
</view> </view>
</view> </view>
<view class="uni-list-cell"> <view class="uni-list-cell">
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<view class="uni-label" style="width:180px;">地理位置的系统开关</view> <view class="uni-label" style="width:180px;">地理位置的系统开关</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="locationEnabled" /> <input type="text" :disabled="true" placeholder="未获取" :value="locationEnabled" />
</view> </view>
</view> </view>
<view class="uni-list-cell"> <view class="uni-list-cell">
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<view class="uni-label" style="width:180px;">Wi-Fi 的系统开关</view> <view class="uni-label" style="width:180px;">Wi-Fi 的系统开关</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="wifiEnabled" /> <input type="text" :disabled="true" placeholder="未获取" :value="wifiEnabled" />
</view> </view>
</view> </view>
<view class="uni-list-cell"> <view class="uni-list-cell">
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<view class="uni-label" style="width:180px;">设备方向</view> <view class="uni-label" style="width:180px;">设备方向</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="deviceOrientation" /> <input type="text" :disabled="true" placeholder="未获取" :value="deviceOrientation" />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="uni-label" style="width: 180px">{{ item.label }}</view> <view class="uni-label" style="width: 180px">{{ item.label }}</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<textarea style="width: 100%;" :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" /> <text style="width: 100%;" :value="item.value == '' ? '未获取' : item.value " />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<text class="uni-title-text">设置输入框聚焦时光标的位置(点击生效)</text> <text class="uni-title-text">设置输入框聚焦时光标的位置(点击生效)</text>
</view> </view>
<view class="input-wrapper"> <view class="input-wrapper">
<input ref="input" class="uni-input" value="0123456789" :cursor="cursor" /> <input ref="input" class="uni-input" value="0123456789" :cursor="cursor" @blur="onCursorBlurChange"/>
</view> </view>
</view> </view>
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
</view> </view>
<view class="input-wrapper"> <view class="input-wrapper">
<input ref="input2" class="uni-input" value="0123456789" :selection-start="selectionStart" <input ref="input2" class="uni-input" value="0123456789" :selection-start="selectionStart"
:selection-end="selectionEnd" /> :selection-end="selectionEnd" @blur="onSelectionBlurChange"/>
</view> </view>
</view> </view>
...@@ -279,11 +279,17 @@ ...@@ -279,11 +279,17 @@
(this.$refs['input'] as UniInputElement).focus(); (this.$refs['input'] as UniInputElement).focus();
this.cursor = cursor; this.cursor = cursor;
}, },
onCursorBlurChange(){
this.cursor = 0
},
setSelection: function (selectionStart : number, selectionEnd : number) { setSelection: function (selectionStart : number, selectionEnd : number) {
(this.$refs['input2'] as UniInputElement).focus(); (this.$refs['input2'] as UniInputElement).focus();
this.selectionStart = selectionStart; this.selectionStart = selectionStart;
this.selectionEnd = selectionEnd; this.selectionEnd = selectionEnd;
}, },
onSelectionBlurChange(){
this.selectionEnd = 0;
},
clearInput: function (event : UniInputEvent) { clearInput: function (event : UniInputEvent) {
this.inputClearValue = event.detail.value this.inputClearValue = event.detail.value
if (event.detail.value.length > 0) { if (event.detail.value.length > 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册