webview.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <view class="padding-20">
  3. <web-view :src="url"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. url: ''
  11. };
  12. },
  13. components: {},
  14. props: {},
  15. /**
  16. * 生命周期函数--监听页面加载
  17. */
  18. onLoad: function (options) {
  19. this.url=options.url || ''
  20. console.log(this.url);
  21. if (!this.$isEmpty(options.title)) {
  22. uni.setNavigationBarTitle({
  23. title:options.title
  24. })
  25. }
  26. },
  27. /**
  28. * 生命周期函数--监听页面初次渲染完成
  29. */
  30. onReady: function () {},
  31. /**
  32. * 生命周期函数--监听页面显示
  33. */
  34. onShow: function () {},
  35. /**
  36. * 生命周期函数--监听页面隐藏
  37. */
  38. onHide: function () {},
  39. /**
  40. * 生命周期函数--监听页面卸载
  41. */
  42. onUnload: function () {},
  43. /**
  44. * 页面相关事件处理函数--监听用户下拉动作
  45. */
  46. onPullDownRefresh: function () {},
  47. /**
  48. * 页面上拉触底事件的处理函数
  49. */
  50. onReachBottom: function () {},
  51. /**
  52. * 用户点击右上角分享
  53. */
  54. onShareAppMessage: function () {},
  55. methods: {}
  56. };
  57. </script>
  58. <style>
  59. /* template/webview.wxss */
  60. </style>