webview.vue 897 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view>
  3. <!-- #ifndef MP -->
  4. <cu-custom :bgColor="'bg-'+theme.backgroundColor" :isBack="true"><block slot="content">{{title}}</block></cu-custom>
  5. <view class="margin-top-xl">
  6. <!-- #endif -->
  7. <web-view :src="url" :webview-styles="webviewStyles"></web-view>
  8. <!-- #ifndef MP -->
  9. </view>
  10. <!-- #endif -->
  11. </view>
  12. </template>
  13. <script>
  14. // #ifndef MP
  15. const app = getApp();
  16. // #endif
  17. export default {
  18. data() {
  19. return {
  20. // #ifndef MP
  21. theme: app.globalData.theme, //全局颜色变量
  22. // #endif
  23. url:"",
  24. title:'浏览',
  25. webviewStyles: {
  26. progress: {
  27. color: '#FF3333'
  28. }
  29. }
  30. }
  31. },
  32. onShow() {
  33. },
  34. onLoad: function(option) {
  35. this.url = option.url;
  36. if(option.title){
  37. this.title = option.title;
  38. uni.setNavigationBarTitle({
  39. title:option.title
  40. })
  41. }
  42. },
  43. methods: {
  44. }
  45. }
  46. </script>
  47. <style>
  48. </style>