-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
liningzhu
committed
Jan 8, 2024
1 parent
9e585d6
commit 426e5a0
Showing
4 changed files
with
5 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,3 @@ | ||
export function printElement(elementId: string) { | ||
// // 隐藏除了指定 DOM 元素之外的内容 | ||
// const allElements: NodeListOf<HTMLElement> = document.querySelectorAll('body > *:not(#' + elementId + ')'); | ||
// allElements.forEach(function(element) { | ||
// element.style.display = 'none'; | ||
// }); | ||
|
||
// // // 打印指定 DOM 元素 | ||
// const elementToPrint = document.getElementById(elementId); | ||
|
||
// let tempEl = elementToPrint | ||
// while (tempEl?.parentElement && tempEl?.parentElement !== document.body) { | ||
// tempEl.style.display = 'block'; | ||
// console.log('lnz tempEl?.parentElement', tempEl?.parentElement); | ||
// tempEl = tempEl?.parentElement | ||
// } | ||
// console.log('lnz elementToPrint', elementToPrint); | ||
|
||
window.print(); | ||
|
||
|
||
|
||
// // 恢复显示所有内容 | ||
// allElements.forEach(function(element) { | ||
// element.style.display = ''; | ||
// }); | ||
} | ||
window.print() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@buitar/tone-player", | ||
"version": "0.0.1", | ||
"main": "dist/index.esm.js", | ||
"main": "src/index.ts", | ||
"types": "dist/index.d.ts", | ||
"author": "[email protected]", | ||
"license": "MIT", | ||
|