提交 1cdd1c58 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

更新web-view示例

上级 c724683b
......@@ -23,6 +23,9 @@
<button type="primary" @click="stop">停止加载</button>
</view>
</view>
<view class="uni-btn-v">
<button type="primary" @click="nativeToWeb">原生和Web通信</button>
</view>
</view>
</view>
</template>
......@@ -36,7 +39,7 @@
progress: {
color: '#FF3333'
}
} as UTSJSONObject
}
}
},
methods: {
......@@ -52,6 +55,9 @@
stop() {
(this.$refs['web-view'] as IWebViewNode).stop();
},
nativeToWeb() {
(this.$refs['web-view'] as IWebViewNode).evalJS("alert('hello uni-app x')");
},
message(event : WebViewMessageEvent) {
console.log(JSON.stringify(event.detail));
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册