docs(perf): lazy import transliteration (#11893)

This commit is contained in:
neverland
2023-05-21 22:20:21 +08:00
committed by GitHub
parent b4af4022c6
commit 3bbe31da1b
2 changed files with 20 additions and 7 deletions

View File

@@ -62,13 +62,16 @@ export default {
syncMobilePos(id) {
// Getting the document at this point is to ensure that the target has been fully rendered.
if (this.iframeDocument) {
const target = this.iframeDocument.getElementById(id);
target && target.scrollIntoView(true);
} else {
if (!this.iframeDocument) {
const iframe = document.querySelector('iframe');
this.iframeDocument = iframe.contentWindow.document;
}
if (this.iframeDocument) {
const target = this.iframeDocument.getElementById(id);
if (target) {
target.scrollIntoView(true);
}
}
},
copyAction() {