index.vue 415 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <view>
  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. //decodeURIComponent()函数可以识别并且分立出url
  14. onLoad(options) {
  15. console.log('options', options);
  16. let fromPath = decodeURIComponent(options.url);
  17. this.setData({
  18. url: fromPath
  19. })
  20. },
  21. methods: {
  22. }
  23. }
  24. </script>
  25. <style>
  26. </style>