金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
980 B

  1. <template>
  2. <web-view :src="url"></web-view>
  3. </template>
  4. <script>
  5. export default {
  6. data() {
  7. return {
  8. url: ''
  9. };
  10. },
  11. onLoad(e) {
  12. console.log(e.url);
  13. if (!e.url) {
  14. this.setData({
  15. url: 'https://mp.weixin.qq.com/s/1uorX1FvMBIDjkpxthdCng'
  16. });
  17. } else {
  18. this.setData({
  19. url: e.url
  20. });
  21. }
  22. },
  23. components: {},
  24. props: {},
  25. methods: {
  26. setData: function (obj) {
  27. let that = this;
  28. let keys = [];
  29. let val, data;
  30. Object.keys(obj).forEach(function (key) {
  31. keys = key.split('.');
  32. val = obj[key];
  33. data = that.$data;
  34. keys.forEach(function (key2, index) {
  35. if (index + 1 == keys.length) {
  36. that.$set(data, key2, val);
  37. } else {
  38. if (!data[key2]) {
  39. that.$set(data, key2, {});
  40. }
  41. }
  42. data = data[key2];
  43. });
  44. });
  45. }
  46. },
  47. computed: {},
  48. watch: {}
  49. };
  50. </script>