fix build

This commit is contained in:
tangly1024
2024-01-31 13:48:45 +08:00
parent 16c4822dbb
commit 8998e046ee

View File

@@ -103,18 +103,18 @@ export default function CustomContextMenu(props) {
/**
* 复制内容
*/
function handleCopy(){
var selectedText = document.getSelection().toString();
function handleCopy() {
const selectedText = document.getSelection().toString();
if (selectedText) {
var tempInput = document.createElement("input");
tempInput.value = selectedText;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand("copy");
document.body.removeChild(tempInput);
// alert("Text copied: " + selectedText);
const tempInput = document.createElement('input');
tempInput.value = selectedText;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand('copy');
document.body.removeChild(tempInput);
// alert("Text copied: " + selectedText);
} else {
// alert("Please select some text first.");
// alert("Please select some text first.");
}
setShow(false)
@@ -178,7 +178,7 @@ export default function CustomContextMenu(props) {
<i className="fa-solid fa-copy mr-2" />
<div className='whitespace-nowrap'>{locale.MENU.COPY}</div>
</div>
)}
)}
<div onClick={handleCopyLink} title={locale.MENU.SHARE_URL} className='w-full px-2 h-10 flex justify-start items-center flex-nowrap cursor-pointer hover:bg-blue-600 hover:text-white rounded-lg duration-200 transition-all'>
<i className="fa-solid fa-arrow-up-right-from-square mr-2" />
@@ -194,8 +194,8 @@ export default function CustomContextMenu(props) {
<i className="fa-solid fa-palette mr-2" />
<div className='whitespace-nowrap'>{locale.MENU.THEME_SWITCH}</div>
</div>
)}
)}
</div>
</div>