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.

49 lines
1.3 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. // export default {
  2. // install(app: App) {
  3. // // 注册功能根据app参数
  4. // app.mixin({
  5. // // 引入全局使用
  6. // mounted() {
  7. // setTimeout(() => {
  8. // console.log('Sending height message')
  9. // // console.log((this.$el as HTMLElement).offsetHeight);
  10. // ;(this.$el as HTMLElement).offsetHeight
  11. // window.parent.postMessage(
  12. // // 向父窗口发送消息
  13. // {
  14. // data: {
  15. // type: 'duobaoqibingHeight',
  16. // data: (this.$el as HTMLElement).offsetHeight // 发送当前高度
  17. // }
  18. // },
  19. // '*'
  20. // )
  21. // }, 800)
  22. // }
  23. // })
  24. // }
  25. // }
  26. // 给父级发送高度
  27. export const setHeight = (el) => {
  28. // const sendHeight = () => {
  29. // const height = el.offsetHeight;
  30. // // 打印高度到控制台
  31. // console.log('Current height:', height);
  32. // window.parent.postMessage(
  33. // {
  34. // data: {
  35. // type: 'duobaoqibingHeight',
  36. // data: el.offsetHeight
  37. // }
  38. // },
  39. // '*'
  40. // );
  41. // // 滚动到顶部
  42. // window.scrollTo({ top: 0, behavior: 'smooth' });
  43. // };
  44. console.log(el.offsetHeight);
  45. // 初始发送高度
  46. // setTimeout(sendHeight, 800);
  47. };