heo 主题样式、交互微调

This commit is contained in:
tangly1024.com
2024-05-29 10:51:56 +08:00
parent c24f9a03ca
commit 9afacdc8e8
6 changed files with 79 additions and 53 deletions

View File

@@ -57,12 +57,10 @@ export default function CustomContextMenu(props) {
}
/**
* 鼠标点击事件
* 鼠标点击即关闭菜单
*/
const handleClick = event => {
if (menuRef.current && !menuRef.current.contains(event.target)) {
setShow(false)
}
setShow(false)
}
window.addEventListener('contextmenu', handleContextMenu)
@@ -88,7 +86,6 @@ export default function CustomContextMenu(props) {
function handleScrollTop() {
window.scrollTo({ top: 0, behavior: 'smooth' })
setShow(false)
}
function handleCopyLink() {
@@ -96,12 +93,12 @@ export default function CustomContextMenu(props) {
navigator.clipboard
.writeText(url)
.then(() => {
console.log('页面地址已复制')
// console.log('页面地址已复制')
alert(`${locale.COMMON.PAGE_URL_COPIED} : ${url}`)
})
.catch(error => {
console.error('复制页面地址失败:', error)
})
setShow(false)
}
/**
@@ -130,8 +127,6 @@ export default function CustomContextMenu(props) {
} else {
// alert("Please select some text first.");
}
setShow(false)
}
function handleChangeDarkMode() {