Remove JSON download functionality from App.vue and implement it in parent.html
This commit is contained in:
parent
1341a32484
commit
e0954a34e7
@ -48,7 +48,10 @@
|
|||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
window.addEventListener('message', (event) => {
|
window.addEventListener('message', (event) => {
|
||||||
console.log(event.data);
|
const elem = document.createElement('a');
|
||||||
|
elem.href = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(event.data));
|
||||||
|
elem.download = 'results.json';
|
||||||
|
elem.click();
|
||||||
});
|
});
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
const iframe = document.getElementById('iframe');
|
const iframe = document.getElementById('iframe');
|
||||||
@ -64,7 +67,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<iframe
|
<iframe
|
||||||
src="/index.html"
|
src="index.html"
|
||||||
style="width: 99vw; height: 95vh; border: none;"
|
style="width: 99vw; height: 95vh; border: none;"
|
||||||
id="iframe"></iframe>
|
id="iframe"></iframe>
|
||||||
</body>
|
</body>
|
||||||
|
@ -162,10 +162,6 @@ export default {
|
|||||||
ended: new Date().getTime(),
|
ended: new Date().getTime(),
|
||||||
results
|
results
|
||||||
}, window.origin);
|
}, window.origin);
|
||||||
const elem = document.createElement('a');
|
|
||||||
elem.href = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(results));
|
|
||||||
elem.download = 'results.json';
|
|
||||||
elem.click();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user