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.
50 lines
1.3 KiB
50 lines
1.3 KiB
// export default {
|
|
// install(app: App) {
|
|
// // 注册功能根据app参数
|
|
// app.mixin({
|
|
// // 引入全局使用
|
|
// mounted() {
|
|
// setTimeout(() => {
|
|
// console.log('Sending height message')
|
|
// // console.log((this.$el as HTMLElement).offsetHeight);
|
|
// ;(this.$el as HTMLElement).offsetHeight
|
|
// window.parent.postMessage(
|
|
// // 向父窗口发送消息
|
|
// {
|
|
// data: {
|
|
// type: 'duobaoqibingHeight',
|
|
// data: (this.$el as HTMLElement).offsetHeight // 发送当前高度
|
|
// }
|
|
// },
|
|
// '*'
|
|
// )
|
|
// }, 800)
|
|
// }
|
|
// })
|
|
// }
|
|
// }
|
|
// 给父级发送高度
|
|
export const setHeight = (el) => {
|
|
// const sendHeight = () => {
|
|
// const height = el.offsetHeight;
|
|
|
|
// // 打印高度到控制台
|
|
// console.log('Current height:', height);
|
|
// window.parent.postMessage(
|
|
// {
|
|
// data: {
|
|
// type: 'duobaoqibingHeight',
|
|
// data: el.offsetHeight
|
|
// }
|
|
// },
|
|
// '*'
|
|
// );
|
|
|
|
// // 滚动到顶部
|
|
// window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
// };
|
|
console.log(el.offsetHeight);
|
|
|
|
// 初始发送高度
|
|
// setTimeout(sendHeight, 800);
|
|
};
|