index.vue 715 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <div>
  3. <iframe style="width: 100%; height: 100vh" :src="link + `?token=${token}`">
  4. </iframe>
  5. </div>
  6. </template>
  7. <script>
  8. import { getToken } from '@/utils/token-util';
  9. export default {
  10. data() {
  11. return {
  12. link: '',
  13. token: ''
  14. };
  15. },
  16. mounted() {
  17. // if (this.$route.query && this.$route.query.link) {
  18. // this.link = this.$route.query.link;
  19. // }
  20. },
  21. watch: {
  22. // 监视搜索词变化
  23. '$route.query.link': {
  24. immediate: true,
  25. handler() {
  26. // console.log(2222);
  27. this.link = this.$route.query.link;
  28. this.token = getToken();
  29. }
  30. }
  31. },
  32. methods: {}
  33. };
  34. </script>
  35. <style lang="scss" scoped>
  36. </style>