提交 0dec47e3 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

更新web-view示例

上级 1c9a551e
...@@ -6,24 +6,30 @@ ...@@ -6,24 +6,30 @@
</web-view> </web-view>
<!-- #ifdef APP --> <!-- #ifdef APP -->
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<view class="uni-input-v"> <view class="uni-btn-v">
<input class="uni-input" confirmType="go" placeholder="输入网址跳转" @confirm="confirm" maxlength="-1"/> <input class="uni-input" confirmType="go" placeholder="输入网址跳转" @confirm="confirm" maxlength="-1"/>
</view> </view>
<view class="uni-row uni-btn-v"> <view class="uni-row uni-btn-v">
<button class="uni-flex-item" type="primary" @click="back">后退</button> <button class="uni-flex-item" type="primary" @click="back">后退</button>
<button class="uni-btn-ml uni-flex-item" type="primary" @click="forward">前进</button> <button class="margin-left-5 uni-flex-item" type="primary" @click="forward">前进</button>
</view> </view>
<view class="uni-row uni-btn-v"> <view class="uni-row uni-btn-v">
<button class="uni-flex-item" type="primary" @click="reload">重新加载</button> <button class="uni-flex-item" type="primary" @click="reload">重新加载</button>
<button class="uni-btn-ml uni-flex-item" type="primary" @click="stop">停止加载</button> <button class="margin-left-5 uni-flex-item" type="primary" @click="stop">停止加载</button>
</view> </view>
<view class="uni-btn-v"> <view class="uni-btn-v">
<button type="primary" @click="nativeToWeb">原生和Web通信</button> <button type="primary" @click="nativeToWeb">原生和Web通信</button>
</view> </view>
<!-- #ifdef APP-ANDROID --> <!-- #ifdef APP-ANDROID -->
<view class="uni-row"> <view class="uni-row uni-btn-v">
<boolean-data :defaultValue="true" title="显示横向滚动条" @change="changeHorizontalScrollBarAccess"></boolean-data> <view class="uni-row uni-flex-item align-items-center">
<boolean-data :defaultValue="true" title="显示竖向滚动条" @change="changeVerticalScrollBarAccess"></boolean-data> <text>显示横向滚动条</text>
<switch class="margin-left-5" :checked="true" @change="changeHorizontalScrollBarAccess"></switch>
</view>
<view class="uni-row uni-flex-item align-items-center">
<text>显示竖向滚动条</text>
<switch class="margin-left-5" :checked="true" @change="changeVerticalScrollBarAccess"></switch>
</view>
</view> </view>
<!-- #endif --> <!-- #endif -->
</view> </view>
...@@ -97,22 +103,22 @@ ...@@ -97,22 +103,22 @@
} }
this.src = url; this.src = url;
}, },
changeHorizontalScrollBarAccess(checked : boolean) { changeHorizontalScrollBarAccess(event : UniSwitchChangeEvent) {
this.horizontalScrollBarAccess = checked; this.horizontalScrollBarAccess = event.detail.value;
}, },
changeVerticalScrollBarAccess(checked : boolean) { changeVerticalScrollBarAccess(event : UniSwitchChangeEvent) {
this.verticalScrollBarAccess = checked; this.verticalScrollBarAccess = event.detail.value;
} }
} }
} }
</script> </script>
<style> <style>
.uni-input-v { .margin-left-5 {
padding: 5px 0; margin-left: 5px;
} }
.uni-btn-ml { .align-items-center {
margin-left: 5px; align-items: center;
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册